gid

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: MPL-2.0 Imports: 5 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 (
	UserType                 Type = "U"
	RoleType                 Type = "RL"
	OrganizationType         Type = "O"
	MembershipType           Type = "M"
	ResourceLimitType        Type = "RLM"
	ProjectType              Type = "P"
	ProjectVariableType      Type = "PVAR"
	ProjectVariableSetType   Type = "PVS"
	TeamType                 Type = "T"
	TeamMemberType           Type = "TM"
	PipelineTemplateType     Type = "PT"
	PipelineType             Type = "PI"
	PipelineApprovalType     Type = "PA"
	AgentType                Type = "A"
	AgentSessionType         Type = "AS"
	JobType                  Type = "J"
	EnvironmentType          Type = "E"
	ServiceAccountType       Type = "SA"
	SCIMTokenType            Type = "ST"
	LogStreamType            Type = "LS"
	PipelineActionOutputType Type = "PAO"
	ApprovalRuleType         Type = "AR"
	LifecycleTemplateType    Type = "LT"
	ReleaseLifecycleType     Type = "RLC"
	ReleaseType              Type = "R"
	ActivityEventType        Type = "AE"
	CommentType              Type = "C"
	PluginType               Type = "PL"
	PluginVersionType        Type = "PV"
	PluginPlatformType       Type = "PP"
	ToDoItemType             Type = "TI"
	VCSProviderType          Type = "VP"
	ThreadType               Type = "TH"
	EnvironmentRuleType      Type = "ER"
	MetricType               Type = "MET"
)

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