urn

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package urn provides the PRN (Phobos Resource Name) functionalities. Primarily responsible for resolving the UUID from either a GlobalID or a PRN.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetResourceType

func GetResourceType(prn string) models.ResourceType

GetResourceType returns the resource type from a PRN.

func IsPRN

func IsPRN(value string) bool

IsPRN returns true if the value is a PRN i.e. begins with "prn:".

Types

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver resolves a resource UUID from either a GID or PRN.

func NewResolver

func NewResolver(options *ResolverOptions) *Resolver

NewResolver creates a new resolver.

func (*Resolver) ResolveResourceID

func (r *Resolver) ResolveResourceID(ctx context.Context, value string) (string, error)

ResolveResourceID resolves a resource UUID from either a GID or PRN.

type ResolverOptions

type ResolverOptions struct {
	OrganizationService      organization.Service
	AgentService             agent.Service
	ProjectService           project.Service
	ProjectVariableService   projectvariable.Service
	EnvironmentService       environment.Service
	ServiceAccountService    serviceaccount.Service
	UserService              user.Service
	TeamService              team.Service
	RoleService              role.Service
	JobService               job.Service
	MembershipService        membership.Service
	PipelineService          pipeline.Service
	PipelineTemplateService  pipelinetemplate.Service
	ApprovalRuleService      approvalrule.Service
	LifecycleTemplateService lifecycletemplate.Service
	ReleaseLifecycleService  releaselifecycle.Service
	ReleaseService           release.Service
	CommentService           comment.Service
	PluginRegistryService    pluginregistry.Service
	ToDoItemService          todoitem.Service
	VCSProviderService       vcs.Service
}

ResolverOptions are the options for the resolver.

Jump to

Keyboard shortcuts

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