Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IpAddress ¶
type IpAddress struct {
Name LocationLink `json:"name" validate:"required"`
Ip Ipv4NoCidr `json:"ip" validate:"required"`
Id string `json:"id" validate:"required"`
State IpAddressState `json:"state,omitzero" validate:"required"`
Created string `json:"created" validate:"date,required"`
}
type IpAddressState ¶
type IpAddressState string
const ( IpAddressStateBound IpAddressState = "bound" IpAddressStateUnbound IpAddressState = "unbound" )
func (IpAddressState) EnumValues ¶
func (IpAddressState) EnumValues() []string
EnumValues makes IpAddressState resolve to Joi.string().valid('bound','unbound') via the reflection Valuer registry (demonstrates the EnumValues() path; the sibling IpSetLocation.RetentionPolicy uses the `valid=` tag path instead).
type IpSet ¶
type IpSet struct {
Id string `json:"id,omitzero" validate:"uuid,readOnly"`
Name base.Name `json:"name,omitzero"`
Kind base.Kind `json:"kind,omitzero"`
Version *float64 `json:"version,omitzero" validate:"positive,integer,readOnly"`
Description string `json:"description,omitzero" validate:"trim,max=250,allow="`
Tags IpSetTags `json:"tags,omitzero" validate:"default={}"`
Created string `json:"created,omitzero" validate:"date,readOnly"`
LastModified string `json:"lastModified,omitzero" validate:"date,readOnly"`
Links base.Links `json:"links,omitzero" validate:"readOnly"`
Spec IpSetSpec `json:"spec" validate:"required"`
Status *IpSetStatus `json:"status,omitzero"`
}
func (IpSet) ValidationRule ¶
ValidationRule reflects IpSet (Base.keys({spec: required, status})).
type IpSetLocation ¶
type IpSetLocation struct {
Name LocationLink `json:"name" validate:"required"`
RetentionPolicy IpSetLocationRetentionPolicy `json:"retentionPolicy,omitzero" validate:"valid=keep|free,required"`
}
type IpSetLocationRetentionPolicy ¶
type IpSetLocationRetentionPolicy string
const ( IpSetLocationRetentionPolicyKeep IpSetLocationRetentionPolicy = "keep" IpSetLocationRetentionPolicyFree IpSetLocationRetentionPolicy = "free" )
type IpSetSpec ¶
type IpSetSpec struct {
Link WorkloadOrGvcLink `json:"link,omitzero" validate:"optional"`
Locations []IpSetLocation `json:"locations,omitzero"`
}
type IpSetStatus ¶
type IpSetTags ¶
IpSetTags is an alias for base.Tags so the reflection base-type registry (keyed on base.Tags) resolves it to the shared TagsRule.
type Ipv4NoCidr ¶
type Ipv4NoCidr string
Ipv4NoCidr ports `Joi.string().ip({ version: 'ipv4', cidr: 'forbidden' })`: a plain IPv4 dotted-quad with no CIDR suffix. The error message contains "ip address" to match Joi (ipSet.test.ts asserts `.toContain('ip address')`). Replaces the `custom=ipv4NoCidr` tag on IpAddress.Ip.
func (Ipv4NoCidr) ValidationRule ¶
func (Ipv4NoCidr) ValidationRule() *validate.Rule
ValidationRule ports ipSet.ts:7 `ip({version:'ipv4', cidr:'forbidden'})`. It used to be a net.ParseIP + dot-count heuristic, which accepted the IPv4-mapped IPv6 literal ::ffff:1.2.3.4 and rejected the leading-zero octets Joi's RFC-3986 grammar allows.
type LocationLink ¶
type LocationLink string
LocationLink ports `LocalLink.custom(toKind('location'))`: a local link that must resolve to a resource of kind `location`. Replaces the `localLink=location` tag on IpAddress.Name and IpSetLocation.Name.
func (LocationLink) ValidationRule ¶
func (LocationLink) ValidationRule() *validate.Rule
type WorkloadOrGvcLink ¶
type WorkloadOrGvcLink string
WorkloadOrGvcLink ports `LocalLink.custom(toKind('!workload', 'gvc'))`: the spec.link target, which must point to a workload (via `!workload`) or a gvc. Replaces the `localLink=!workload|gvc` tag on IpSetSpec.Link.
func (WorkloadOrGvcLink) ValidationRule ¶
func (WorkloadOrGvcLink) ValidationRule() *validate.Rule