names

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiRegexp

func ApiRegexp() *regexp.Regexp

ApiRegexp returns a regular expression that matches a api resource name.

func ApisRegexp

func ApisRegexp() *regexp.Regexp

ApisRegexp returns a regular expression that matches collection of apis.

func ArtifactRegexp added in v0.2.0

func ArtifactRegexp() *regexp.Regexp

ArtifactRegexp returns a regular expression that matches an artifact resource name.

func ArtifactsRegexp added in v0.2.0

func ArtifactsRegexp() *regexp.Regexp

ArtifactsRegexp returns a regular expression that matches collection of artifacts.

func GenerateID added in v0.2.0

func GenerateID() string

GenerateID generates a random resource ID.

func ProjectRegexp

func ProjectRegexp() *regexp.Regexp

ProjectRegexp returns a regular expression that matches a project resource name.

func ProjectsRegexp

func ProjectsRegexp() *regexp.Regexp

ProjectsRegexp returns a regular expression that matches collection of projects.

func SpecRegexp

func SpecRegexp() *regexp.Regexp

SpecRegexp returns a regular expression that matches a spec resource name with an optional revision identifier.

func SpecsRegexp

func SpecsRegexp() *regexp.Regexp

SpecsRegexp returns a regular expression that matches a collection of specs.

func VersionRegexp

func VersionRegexp() *regexp.Regexp

VersionRegexp returns a regular expression that matches a version resource name.

func VersionsRegexp

func VersionsRegexp() *regexp.Regexp

VersionsRegexp returns a regular expression that matches a collection of versions.

Types

type Api added in v0.2.1

type Api struct {
	ProjectID string
	ApiID     string
}

Api represents a resource name for an API.

func ParseApi added in v0.2.0

func ParseApi(name string) (Api, error)

ParseApi parses the name of an Api.

func (Api) Artifact added in v0.2.1

func (a Api) Artifact(id string) Artifact

Artifact returns an artifact with the provided ID and this resource as its parent.

func (Api) Project added in v0.2.1

func (a Api) Project() Project

Project returns the name of this resource's parent project.

func (Api) String added in v0.2.1

func (a Api) String() string

func (Api) Validate added in v0.2.1

func (a Api) Validate() error

Validate returns an error if the resource name is invalid. For backward compatibility, names should only be validated at creation time.

func (Api) Version added in v0.2.1

func (a Api) Version(id string) Version

Version returns an API version with the provided ID and this resource as its parent.

type Artifact added in v0.2.1

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

Artifact represents a resource name for an artifact.

func ParseArtifact added in v0.2.1

func ParseArtifact(name string) (Artifact, error)

ParseArtifact parses the name of an artifact.

func (Artifact) ApiID added in v0.2.1

func (a Artifact) ApiID() string

ApiID returns the artifact's API ID, or empty string if it doesn't have one.

func (Artifact) ArtifactID added in v0.2.1

func (a Artifact) ArtifactID() string

ArtifactID returns the artifact's ID.

func (Artifact) ProjectID added in v0.2.1

func (a Artifact) ProjectID() string

ProjectID returns the artifact's project ID, or empty string if it doesn't have one.

func (Artifact) SpecID added in v0.2.1

func (a Artifact) SpecID() string

SpecID returns the artifact's spec ID, or empty string if it doesn't have one.

func (Artifact) String added in v0.2.1

func (a Artifact) String() string

func (Artifact) Validate added in v0.2.1

func (a Artifact) Validate() error

Validate returns an error if the resource name is invalid. For backward compatibility, names should only be validated at creation time.

func (Artifact) VersionID added in v0.2.1

func (a Artifact) VersionID() string

VersionID returns the artifact's version ID, or empty string if it doesn't have one.

type Project added in v0.2.1

type Project struct {
	ProjectID string
}

Project represents a resource name for a project.

func ParseProject added in v0.2.0

func ParseProject(name string) (Project, error)

ParseProject parses the name of a project.

func (Project) Api added in v0.2.1

func (p Project) Api(id string) Api

Api returns an API with the provided ID and this resource as its parent.

func (Project) Artifact added in v0.2.1

func (p Project) Artifact(id string) Artifact

Artifact returns an artifact with the provided ID and this resource as its parent.

func (Project) String added in v0.2.1

func (p Project) String() string

func (Project) Validate added in v0.2.1

func (p Project) Validate() error

Validate returns an error if the resource name is invalid. For backward compatibility, names should only be validated at creation time.

type Spec added in v0.2.1

type Spec struct {
	ProjectID string
	ApiID     string
	VersionID string
	SpecID    string
}

Spec represents a resource name for an API spec.

func ParseSpec added in v0.2.0

func ParseSpec(name string) (Spec, error)

ParseSpec parses the name of a spec.

func (Spec) Api added in v0.2.1

func (s Spec) Api() Api

Api returns the parent API for this resource.

func (Spec) Artifact added in v0.2.1

func (s Spec) Artifact(id string) Artifact

Artifact returns an artifact with the provided ID and this resource as its parent.

func (Spec) Normal added in v0.3.0

func (s Spec) Normal() Spec

Normal returns the resource name with normalized identifiers.

func (Spec) Project added in v0.2.1

func (s Spec) Project() Project

Project returns the parent project for this resource.

func (Spec) Revision added in v0.2.1

func (s Spec) Revision(id string) SpecRevision

Revision returns an API spec revision with the provided ID and this resource as its parent.

func (Spec) String added in v0.2.1

func (s Spec) String() string

func (Spec) Validate added in v0.2.1

func (s Spec) Validate() error

Validate returns an error if the resource name is invalid. For backward compatibility, names should only be validated at creation time.

func (Spec) Version added in v0.2.1

func (s Spec) Version() Version

Version returns the parent API version for this resource.

type SpecRevision added in v0.2.1

type SpecRevision struct {
	ProjectID  string
	ApiID      string
	VersionID  string
	SpecID     string
	RevisionID string
}

SpecRevision represents a resource name for an API spec revision.

func ParseSpecRevision added in v0.2.1

func ParseSpecRevision(name string) (SpecRevision, error)

ParseSpecRevision parses the name of a spec.

func (SpecRevision) Spec added in v0.2.1

func (s SpecRevision) Spec() Spec

Spec returns the parent spec for this resource.

func (SpecRevision) String added in v0.2.1

func (s SpecRevision) String() string

type Version added in v0.2.1

type Version struct {
	ProjectID string
	ApiID     string
	VersionID string
}

Version represents a resource name for an API version.

func ParseVersion added in v0.2.0

func ParseVersion(name string) (Version, error)

ParseVersion parses the name of a version.

func (Version) Api added in v0.2.1

func (v Version) Api() Api

Api returns the parent API for this resource.

func (Version) Artifact added in v0.2.1

func (v Version) Artifact(id string) Artifact

Artifact returns an artifact with the provided ID and this resource as its parent.

func (Version) Project added in v0.2.1

func (v Version) Project() Project

Project returns the parent project for this resource.

func (Version) Spec added in v0.2.1

func (v Version) Spec(id string) Spec

Spec returns an API spec with the provided ID and this resource as its parent.

func (Version) String added in v0.2.1

func (v Version) String() string

func (Version) Validate added in v0.2.1

func (v Version) Validate() error

Validate returns an error if the resource name is invalid. For backward compatibility, names should only be validated at creation time.

Jump to

Keyboard shortcuts

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