-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(parsing): add parameters parsing
- Loading branch information
1 parent
d74527a
commit ba5a528
Showing
42 changed files
with
437 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package parameters | ||
|
||
import ( | ||
"fmt" | ||
"net/url" | ||
|
||
"github.com/vareversat/gics/registries" | ||
"github.com/vareversat/gics/types" | ||
) | ||
|
||
type DelegatedFromParam interface { | ||
CalendarUserAddressTypeParameter | ||
} | ||
|
||
// NewDelegatedFromParam create a new registries.DelegatedFromParam property. See [RFC-5545] ref for more info | ||
// This parameter can be used in this property : | ||
// - registries.AttendeeProp | ||
// [RFC-5545]: https://datatracker.ietf.org/doc/html/rfc5545#section-3.2.4 | ||
func NewDelegatedFromParam(value *url.URL) DelegatedFromParam { | ||
return &calendarUserAddressParameter{ | ||
ParamName: registries.DelegatedFromParam, | ||
Value: types.NewCalendarUserAddressValue(value), | ||
} | ||
} | ||
|
||
func NewDelegatedFromParamFromString(value string) (DelegatedFromParam, error) { | ||
urlValue, err := url.Parse(value) | ||
if err != nil { | ||
return nil, fmt.Errorf("%s is not a valid URL format", value) | ||
} | ||
return &calendarUserAddressParameter{ | ||
ParamName: registries.DelegatedFromParam, | ||
Value: types.NewCalendarUserAddressValue(urlValue), | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package parameters | ||
|
||
import ( | ||
"fmt" | ||
"net/url" | ||
|
||
"github.com/vareversat/gics/registries" | ||
"github.com/vareversat/gics/types" | ||
) | ||
|
||
type DelegatedToParam interface { | ||
CalendarUserAddressTypeParameter | ||
} | ||
|
||
// NewDelegatedToParam create a new registries.DelegatedToParam property. See [RFC-5545] ref for more info | ||
// This parameter can be used in this property : | ||
// - registries.AttendeeProp | ||
// [RFC-5545]: https://datatracker.ietf.org/doc/html/rfc5545#section-3.2.5 | ||
func NewDelegatedToParam(value *url.URL) DelegatedToParam { | ||
return &calendarUserAddressParameter{ | ||
ParamName: registries.DelegatedToParam, | ||
Value: types.NewCalendarUserAddressValue(value), | ||
} | ||
} | ||
|
||
func NewDelegatedToParamFromString(value string) (DelegatedToParam, error) { | ||
urlValue, err := url.Parse(value) | ||
if err != nil { | ||
return nil, fmt.Errorf("%s is not a valid URL format", value) | ||
} | ||
return &calendarUserAddressParameter{ | ||
ParamName: registries.DelegatedToParam, | ||
Value: types.NewCalendarUserAddressValue(urlValue), | ||
}, nil | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package parameters | ||
|
||
import ( | ||
"github.com/vareversat/gics/types" | ||
) | ||
|
||
func NewNonStandardParameter(parameterName string, parameterValue string) NonStandardParameter { | ||
return &nonStandardParameter{ | ||
ParamName: parameterName, | ||
Value: types.NewTextValue(parameterValue), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.