Documentation
¶
Index ¶
- Constants
- func DateFromVersion(version string) (time.Time, error)
- func FindMatchesFromContentType(contentType string) []string
- func GetPreviewVersionName(contentTypeValue *openapi3.MediaType) (name string, err error)
- func IsPreviewStabilityLevel(value string) bool
- func IsPrivatePreviewStabilityLevel(value string) bool
- func IsPublicPreviewStabilityLevel(value string) bool
- func IsStableStabilityLevel(value string) bool
- func IsUpcomingStabilityLevel(value string) bool
- func Parse(contentType string) (string, error)
- func ReplaceContentType(contentType, replacement string) string
- func Sort(versions []*APIVersion)
- func ValidateStabilityLevel(value string) error
- type APIVersion
- func (v *APIVersion) Date() time.Time
- func (v *APIVersion) Equal(v2 *APIVersion) bool
- func (v *APIVersion) ExactMatchOnly() bool
- func (v *APIVersion) GreaterThan(v2 *APIVersion) bool
- func (v *APIVersion) IsPreview() bool
- func (v *APIVersion) IsPrivatePreview() bool
- func (v *APIVersion) IsPublicPreview() bool
- func (v *APIVersion) IsStable() bool
- func (v *APIVersion) IsUpcoming() bool
- func (v *APIVersion) IsZero() bool
- func (v *APIVersion) LessThan(v2 *APIVersion) bool
- func (v *APIVersion) StabilityLevel() string
- func (v *APIVersion) String() string
- type Option
Constants ¶
const ( StableStabilityLevel = "stable" PreviewStabilityLevel = "preview" UpcomingStabilityLevel = "upcoming" PrivatePreviewStabilityLevel = "private-preview" PublicPreviewStabilityLevel = "public-preview" )
Variables ¶
This section is empty.
Functions ¶
func GetPreviewVersionName ¶
GetPreviewVersionName returns the preview version name.
func IsPreviewStabilityLevel ¶
IsPreviewStabilityLevel checks if the version is a preview version, public or private.
func IsPrivatePreviewStabilityLevel ¶
IsPrivatePreviewStabilityLevel checks if the version is a private preview version.
func IsPublicPreviewStabilityLevel ¶
IsPublicPreviewStabilityLevel checks if the version is a public preview version.
func IsStableStabilityLevel ¶
IsStableStabilityLevel checks if the version is a stable version.
func IsUpcomingStabilityLevel ¶
IsUpcomingStabilityLevel checks if the version is an "upcoming" version.
func ReplaceContentType ¶
func ValidateStabilityLevel ¶
ValidateStabilityLevel checks if the version is a valid stability level.
Types ¶
type APIVersion ¶
type APIVersion struct {
// contains filtered or unexported fields
}
func FindLatestContentVersionMatched ¶
func FindLatestContentVersionMatched(op *openapi3.Operation, requestedVersion *APIVersion) *APIVersion
FindLatestContentVersionMatched finds the latest content version that matches the requested version.
func (*APIVersion) Date ¶
func (v *APIVersion) Date() time.Time
func (*APIVersion) Equal ¶
func (v *APIVersion) Equal(v2 *APIVersion) bool
func (*APIVersion) ExactMatchOnly ¶
func (v *APIVersion) ExactMatchOnly() bool
func (*APIVersion) GreaterThan ¶
func (v *APIVersion) GreaterThan(v2 *APIVersion) bool
func (*APIVersion) IsPreview ¶
func (v *APIVersion) IsPreview() bool
func (*APIVersion) IsPrivatePreview ¶
func (v *APIVersion) IsPrivatePreview() bool
func (*APIVersion) IsPublicPreview ¶
func (v *APIVersion) IsPublicPreview() bool
func (*APIVersion) IsStable ¶
func (v *APIVersion) IsStable() bool
func (*APIVersion) IsUpcoming ¶
func (v *APIVersion) IsUpcoming() bool
func (*APIVersion) IsZero ¶
func (v *APIVersion) IsZero() bool
func (*APIVersion) LessThan ¶
func (v *APIVersion) LessThan(v2 *APIVersion) bool
func (*APIVersion) StabilityLevel ¶
func (v *APIVersion) StabilityLevel() string
func (*APIVersion) String ¶
func (v *APIVersion) String() string
type Option ¶
type Option func(v *APIVersion) error
Option is a function that sets a value on the APIVersion.
func WithFullContent ¶
WithFullContent returns an Option to generate a new APIVersion given the contentType and contentValue.
func WithVersion ¶
WithVersion sets the version on the APIVersion.