location

package
v1.1.68-test Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IpRange

type IpRange string

IpRange is a CIDR-required leaf (String().Custom(cidrRequired)); see validate.go.

func (IpRange) ValidationRule

func (IpRange) ValidationRule() *validate.Rule

ValidationRule ports Joi.string().ip({cidr:'required'}): the value must be a valid IP in CIDR notation.

type IpRangeList

type IpRangeList []IpRange

IpRangeList is status.ipRanges: an IpRange slice deduped in place (the old `custom=dedupeEmpty` tag). Its ValidationRule lives in validate.go.

func (IpRangeList) ValidationRule

func (IpRangeList) ValidationRule() *validate.Rule

ValidationRule ports the `custom=dedupeEmpty` collection custom on status.ipRanges: an array of CIDR-required IpRanges with duplicates removed in place (makeUnique with no key — NOT an error, unlike Joi array.unique).

type Location

type Location 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         LocationTags     `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"`
	Origin       LocationOrigin   `json:"origin,omitzero" validate:"valid=builtin|default|custom,default=default,optional,readOnly"`
	Provider     LocationProvider `json:"provider,omitzero" validate:"valid=aws|gcp|azure|byok|linode|vultr|equinix|oci|cpln,unmodifiable"`
	Region       string           `json:"region,omitzero" validate:"unmodifiable"`
	Spec         *LocationSpec    `json:"spec,omitzero"`
	Status       *LocationStatus  `json:"status,omitzero"`
}

func (Location) ValidationRule

func (Location) ValidationRule() *validate.Rule

type LocationOrigin

type LocationOrigin string
const (
	LocationOriginBuiltin LocationOrigin = "builtin"
	LocationOriginDefault LocationOrigin = "default"
	LocationOriginCustom  LocationOrigin = "custom"
)

type LocationProvider

type LocationProvider string
const (
	LocationProviderAws     LocationProvider = "aws"
	LocationProviderGcp     LocationProvider = "gcp"
	LocationProviderAzure   LocationProvider = "azure"
	LocationProviderByok    LocationProvider = "byok"
	LocationProviderLinode  LocationProvider = "linode"
	LocationProviderVultr   LocationProvider = "vultr"
	LocationProviderEquinix LocationProvider = "equinix"
	LocationProviderOci     LocationProvider = "oci"
	LocationProviderCpln    LocationProvider = "cpln"
)

type LocationSpec

type LocationSpec struct {
	Enabled *bool `json:"enabled,omitzero"`
}

type LocationStatus

type LocationStatus struct {
	Geo      *LocationStatusGeo `json:"geo,omitzero"`
	IpRanges IpRangeList        `json:"ipRanges,omitzero"`
}

type LocationStatusGeo

type LocationStatusGeo struct {
	Lat       *float64 `json:"lat,omitzero"`
	Lon       *float64 `json:"lon,omitzero"`
	Country   string   `json:"country,omitzero"`
	State     string   `json:"state,omitzero"`
	City      string   `json:"city,omitzero"`
	Continent string   `json:"continent,omitzero"`
}

type LocationTags

type LocationTags = base.Tags

LocationTags aliases base.Tags for the reflection base-type registry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL