gid

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package gid package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromGlobalID

func FromGlobalID(globalID string) string

FromGlobalID converts a global ID string to a DB ID string

func ToGlobalID

func ToGlobalID(idType Type, id string) string

ToGlobalID converts a model type and DB ID to a global ID string

Types

type GlobalID

type GlobalID struct {
	Type Type
	ID   string
}

GlobalID is a model ID with type information

func NewGlobalID

func NewGlobalID(modelType Type, modelID string) *GlobalID

NewGlobalID returns a new GlobalID

func ParseGlobalID

func ParseGlobalID(globalID string) (*GlobalID, error)

ParseGlobalID parses a global ID string and returns a GlobalID type

func (*GlobalID) String

func (g *GlobalID) String() string

String returns the string representation of the global ID

type Type

type Type string

Type is the type of the global ID

const (
	ApplyType                           Type = "A"
	ConfigurationVersionType            Type = "C"
	GroupType                           Type = "G"
	JobType                             Type = "J"
	LogStreamType                       Type = "LS"
	ManagedIdentityType                 Type = "M"
	ManagedIdentityAccessRuleType       Type = "MR"
	NamespaceMembershipType             Type = "NM"
	PlanType                            Type = "P"
	RunType                             Type = "R"
	RunnerType                          Type = "RNR"
	RunnerSessionType                   Type = "RS"
	ServiceAccountType                  Type = "SA"
	StateVersionType                    Type = "SV"
	StateVersionOutputType              Type = "SO"
	TeamType                            Type = "T"
	TeamMemberType                      Type = "TM"
	UserType                            Type = "U"
	VariableType                        Type = "V"
	WorkspaceType                       Type = "W"
	TerraformProviderType               Type = "TP"
	TerraformProviderVersionType        Type = "TPV"
	TerraformProviderPlatformType       Type = "TPP"
	TerraformModuleType                 Type = "TMO"
	TerraformModuleVersionType          Type = "TMV"
	TerraformModuleAttestationType      Type = "TMA"
	GPGKeyType                          Type = "GPG"
	ActivityEventType                   Type = "AE"
	VCSProviderType                     Type = "VP"
	WorkspaceVCSProviderLinkType        Type = "WPL"
	VCSEventType                        Type = "VE"
	RoleType                            Type = "RL"
	ResourceLimitType                   Type = "RLM"
	TerraformProviderVersionMirrorType  Type = "TVM"
	TerraformProviderPlatformMirrorType Type = "TPM"
	MaintenanceModeType                 Type = "MM"
)

Type constants

func (Type) IsValid

func (t Type) IsValid() error

IsValid returns true if this is a valid Type enum

Jump to

Keyboard shortcuts

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