uri

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceURI

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

ResourceURI describes resource URI

func New

func New(path string) ResourceURI

New creates an instance of ResourceURI

func NewClusterURI

func NewClusterURI(profileName string) ResourceURI

NewClusterURI creates a new cluster URI for given cluster name

func NewGatewayURI

func NewGatewayURI(id string) ResourceURI

NewGatewayURI creates a gateway URI for a given ID

func Parse

func Parse(path string, validateFuncs ...ValidateFunc) (ResourceURI, error)

Parse parses provided path as a cluster URI or a cluster resource URI.

func ParseDBURI

func ParseDBURI(path string) (ResourceURI, error)

ParseDBURI parses the provided path as a database URI.

func ParseGatewayTargetURI

func ParseGatewayTargetURI(path string) (ResourceURI, error)

ParseGatewayTargetURI parses the provided path as a gateway target URI.

func (ResourceURI) AddGateway

func (r ResourceURI) AddGateway(id string) ResourceURI

AddGateway appends gateway segment to the URI

func (ResourceURI) AppendAccessRequest

func (r ResourceURI) AppendAccessRequest(id string) ResourceURI

AppendAccessRequest appends access request segment to the URI

func (ResourceURI) AppendApp

func (r ResourceURI) AppendApp(name string) ResourceURI

AppendApp appends app segment to the URI

func (ResourceURI) AppendDB

func (r ResourceURI) AppendDB(name string) ResourceURI

AppendDB appends database segment to the URI

func (ResourceURI) AppendKube

func (r ResourceURI) AppendKube(name string) ResourceURI

AppendKube appends kube segment to the URI

func (ResourceURI) AppendLeafCluster

func (r ResourceURI) AppendLeafCluster(name string) ResourceURI

AppendLeafCluster appends leaf cluster segment to the URI

func (ResourceURI) AppendServer

func (r ResourceURI) AppendServer(id string) ResourceURI

AppendServer appends server segment to the URI

func (ResourceURI) GetAppName

func (r ResourceURI) GetAppName() string

GetAppName extracts the app name from r. Returns an empty string if the path is not an app URI.

func (ResourceURI) GetClusterURI

func (r ResourceURI) GetClusterURI() ResourceURI

GetClusterURI strips any resource-specific information other than the cluster to which a given resource belongs to.

If called on a root cluster resource URI, it'll return the URI of the root cluster. If called on a leaf cluster resource URI, it'll return the URI of the leaf cluster. If called on a root cluster URI or a leaf cluster URI, it's a noop.

func (ResourceURI) GetDbName

func (r ResourceURI) GetDbName() string

GetDbName extracts the database name from r. Returns an empty string if path is not a database URI.

func (ResourceURI) GetKubeName

func (r ResourceURI) GetKubeName() string

GetKubeName extracts the kube name from r. Returns an empty string if path is not a kube URI.

func (ResourceURI) GetLeafClusterName

func (r ResourceURI) GetLeafClusterName() string

GetLeafClusterName returns leaf cluster name

func (ResourceURI) GetProfileName

func (r ResourceURI) GetProfileName() string

func (ResourceURI) GetRootClusterURI

func (r ResourceURI) GetRootClusterURI() ResourceURI

GetRootClusterURI trims the existing ResourceURI into a URI that points solely at the root cluster.

func (ResourceURI) GetServerUUID

func (r ResourceURI) GetServerUUID() string

GetServerUUID extracts the server UUID from r. Returns an empty string if path is not a server URI.

func (ResourceURI) IsApp

func (r ResourceURI) IsApp() bool

IsApp returns true if URI is an app resource.

func (ResourceURI) IsDB

func (r ResourceURI) IsDB() bool

IsDB returns true if URI is a database resource.

func (ResourceURI) IsKube

func (r ResourceURI) IsKube() bool

IsKube returns true if URI is a kube resource.

func (ResourceURI) IsLeaf

func (r ResourceURI) IsLeaf() bool

IsLeaf indicates whether the URI points at a resource that belongs to a leaf cluster.

func (ResourceURI) IsRoot

func (r ResourceURI) IsRoot() bool

IsRoot indicates whether the URI points at a resource that belongs to a root cluster.

func (ResourceURI) String

func (r ResourceURI) String() string

String returns string representation of the Resource URI

type ValidateFunc

type ValidateFunc func(ResourceURI) error

ValidateFunc validates the provided ResourceURI.

Jump to

Keyboard shortcuts

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