patterns

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ResourceKW = "$resource"
View Source
const ResourceUpdateThresholdSeconds = time.Second * 2

Variables

This section is empty.

Functions

func GetReferenceEntityType

func GetReferenceEntityType(resourcePattern string) (entity, entityType string, err error)

func GetReferenceEntityValue

func GetReferenceEntityValue(resourcePattern string, referred ResourceName) (string, error)

Types

type ApiName

type ApiName struct {
	Name names.Api
}

func (ApiName) Api

func (a ApiName) Api() string

func (ApiName) Artifact

func (a ApiName) Artifact() string

func (ApiName) ParentName

func (a ApiName) ParentName() ResourceName

func (ApiName) Project

func (a ApiName) Project() string

func (ApiName) Spec

func (a ApiName) Spec() string

func (ApiName) String

func (a ApiName) String() string

func (ApiName) Version

func (a ApiName) Version() string

type ApiResource

type ApiResource struct {
	ApiName   ResourceName
	Timestamp time.Time
}

func (ApiResource) ResourceName

func (a ApiResource) ResourceName() ResourceName

func (ApiResource) UpdateTimestamp

func (a ApiResource) UpdateTimestamp() time.Time

type ArtifactName

type ArtifactName struct {
	Name names.Artifact
}

func (ArtifactName) Api

func (ar ArtifactName) Api() string

func (ArtifactName) Artifact

func (ar ArtifactName) Artifact() string

func (ArtifactName) ParentName

func (ar ArtifactName) ParentName() ResourceName

func (ArtifactName) Project

func (ar ArtifactName) Project() string

func (ArtifactName) Spec

func (ar ArtifactName) Spec() string

func (ArtifactName) String

func (ar ArtifactName) String() string

func (ArtifactName) Version

func (ar ArtifactName) Version() string

type ArtifactResource

type ArtifactResource struct {
	ArtifactName ResourceName
	Timestamp    time.Time
}

func (ArtifactResource) ResourceName

func (ar ArtifactResource) ResourceName() ResourceName

func (ArtifactResource) UpdateTimestamp

func (ar ArtifactResource) UpdateTimestamp() time.Time

type ProjectName

type ProjectName struct {
	Name names.Project
}

func (ProjectName) Api

func (p ProjectName) Api() string

func (ProjectName) Artifact

func (p ProjectName) Artifact() string

func (ProjectName) ParentName

func (p ProjectName) ParentName() ResourceName

func (ProjectName) Project

func (p ProjectName) Project() string

func (ProjectName) Spec

func (p ProjectName) Spec() string

func (ProjectName) String

func (p ProjectName) String() string

func (ProjectName) Version

func (p ProjectName) Version() string

type ProjectResource

type ProjectResource struct {
	ProjectName ResourceName
	Timestamp   time.Time
}

func (ProjectResource) ResourceName

func (p ProjectResource) ResourceName() ResourceName

func (ProjectResource) UpdateTimestamp

func (p ProjectResource) UpdateTimestamp() time.Time

type ResourceInstance

type ResourceInstance interface {
	ResourceName() ResourceName
	UpdateTimestamp() time.Time
}

This interface is used to describe generic resource instances ResourceName is embedded, the only additional field is the UpdateTimestamp

func ListResources added in v0.5.1

func ListResources(ctx context.Context, client connection.RegistryClient, pattern, filter string) ([]ResourceInstance, error)

type ResourceName

type ResourceName interface {
	Artifact() string
	Spec() string
	Version() string
	Api() string
	Project() string
	String() string
	ParentName() ResourceName
}

This interface is used to describe generic resource names Example: projects/demo/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml projects/demo/locations/global/apis/-/versions/-/specs/-/artifacts/-

func FullResourceNameFromParent

func FullResourceNameFromParent(resourcePattern string, parent string) (ResourceName, error)

func ParseResourcePattern

func ParseResourcePattern(resourcePattern string) (ResourceName, error)

func SubstituteReferenceEntity

func SubstituteReferenceEntity(resourcePattern string, referred ResourceName) (ResourceName, error)

type SpecName

type SpecName struct {
	Name names.Spec
}

func (SpecName) Api

func (s SpecName) Api() string

func (SpecName) Artifact

func (s SpecName) Artifact() string

func (SpecName) ParentName

func (s SpecName) ParentName() ResourceName

func (SpecName) Project

func (s SpecName) Project() string

func (SpecName) Spec

func (s SpecName) Spec() string

func (SpecName) String

func (s SpecName) String() string

func (SpecName) Version

func (s SpecName) Version() string

type SpecResource

type SpecResource struct {
	SpecName  ResourceName
	Timestamp time.Time
}

func (SpecResource) ResourceName

func (s SpecResource) ResourceName() ResourceName

func (SpecResource) UpdateTimestamp

func (s SpecResource) UpdateTimestamp() time.Time

type VersionName

type VersionName struct {
	Name names.Version
}

func (VersionName) Api

func (v VersionName) Api() string

func (VersionName) Artifact

func (v VersionName) Artifact() string

func (VersionName) ParentName

func (v VersionName) ParentName() ResourceName

func (VersionName) Project

func (v VersionName) Project() string

func (VersionName) Spec

func (v VersionName) Spec() string

func (VersionName) String

func (v VersionName) String() string

func (VersionName) Version

func (v VersionName) Version() string

type VersionResource

type VersionResource struct {
	VersionName ResourceName
	Timestamp   time.Time
}

func (VersionResource) ResourceName

func (v VersionResource) ResourceName() ResourceName

func (VersionResource) UpdateTimestamp

func (v VersionResource) UpdateTimestamp() time.Time

Jump to

Keyboard shortcuts

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