Documentation ¶
Index ¶
- Constants
- func GetReferenceEntityType(resourcePattern string) (entity, entityType string, err error)
- func GetReferenceEntityValue(resourcePattern string, referred ResourceName) (string, error)
- type ApiName
- type ApiResource
- type ArtifactName
- type ArtifactResource
- type ProjectName
- type ProjectResource
- type ResourceInstance
- type ResourceName
- type SpecName
- type SpecResource
- type VersionName
- type VersionResource
Constants ¶
View Source
const ResourceKW = "$resource"
View Source
const ResourceUpdateThreshold = time.Second * 2
Variables ¶
This section is empty.
Functions ¶
func GetReferenceEntityType ¶
func GetReferenceEntityValue ¶
func GetReferenceEntityValue(resourcePattern string, referred ResourceName) (string, error)
Types ¶
type ApiName ¶
func (ApiName) ParentName ¶
func (a ApiName) ParentName() ResourceName
type ApiResource ¶
func (ApiResource) ResourceName ¶
func (a ApiResource) ResourceName() ResourceName
func (ApiResource) UpdateTimestamp ¶
func (a ApiResource) UpdateTimestamp() time.Time
type ArtifactName ¶
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 ¶
func (ArtifactResource) ResourceName ¶
func (ar ArtifactResource) ResourceName() ResourceName
func (ArtifactResource) UpdateTimestamp ¶
func (ar ArtifactResource) UpdateTimestamp() time.Time
type ProjectName ¶
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 string
}
Project is a special resource which is not available through the registry client. Hence we won't store the actual instance of the rpc.Project but instead only store the project name. ProjectResource is mainly used to identify by name when we derive the parents of certain artifacts.
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 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 ¶
func (SpecName) ParentName ¶
func (s SpecName) ParentName() ResourceName
type SpecResource ¶
func (SpecResource) ResourceName ¶
func (s SpecResource) ResourceName() ResourceName
func (SpecResource) UpdateTimestamp ¶
func (s SpecResource) UpdateTimestamp() time.Time
type VersionName ¶
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 {
Version *rpc.ApiVersion
}
func (VersionResource) ResourceName ¶
func (v VersionResource) ResourceName() ResourceName
func (VersionResource) UpdateTimestamp ¶
func (v VersionResource) UpdateTimestamp() time.Time
Click to show internal directories.
Click to hide internal directories.