regional

package
v2.40.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRegionNotFound = errors.New("could not detect region")

ErrRegionNotFound is returned when no region can be detected

Functions

func ComputedSchema

func ComputedSchema() *schema.Schema

ComputedSchema returns a standard schema for a region

func NewIDString

func NewIDString(region scw.Region, id string) string

NewIDString constructs a unique identifier based on resource region and id

func ParseID

func ParseID(regionalID string) (region scw.Region, id string, err error)

ParseID parses a regionalID and extracts the resource region and id.

func ParseNestedID

func ParseNestedID(regionalNestedID string) (region scw.Region, outerID, innerID string, err error)

ParseNestedID parses a regionalNestedID and extracts the resource region, inner and outer ID.

func Schema

func Schema() *schema.Schema

Schema returns a standard schema for a region

Types

type ID

type ID struct {
	ID     string
	Region scw.Region
}

ID represents an ID that is linked with a region, eg fr-par/11111111-1111-1111-1111-111111111111

func ExpandID

func ExpandID(id interface{}) ID

func NewID

func NewID(region scw.Region, id string) ID

func (ID) String

func (z ID) String() string

Jump to

Keyboard shortcuts

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