Documentation
¶
Index ¶
- func ExpandMask(m protoreflect.ProtoMessage, mask *fieldmaskpb.FieldMask) *fieldmaskpb.FieldMask
- func GUnzippedBytes(input []byte) ([]byte, error)
- func ValidateMask(message protoreflect.ProtoMessage, mask *fieldmaskpb.FieldMask) error
- type Api
- type Artifact
- type Blob
- type Deployment
- func (s *Deployment) BasicMessage(name string) (message *rpc.ApiDeployment, err error)
- func (s *Deployment) LabelsMap() (map[string]string, error)
- func (s *Deployment) Name() string
- func (s *Deployment) NewRevision() *Deployment
- func (s *Deployment) RevisionName() string
- func (s *Deployment) Update(message *rpc.ApiDeployment, mask *fieldmaskpb.FieldMask) error
- type DeploymentRevisionTag
- type Project
- type Spec
- func (s *Spec) BasicMessage(name string) (message *rpc.ApiSpec, err error)
- func (s *Spec) LabelsMap() (map[string]string, error)
- func (s *Spec) Name() string
- func (s *Spec) NewRevision() *Spec
- func (s *Spec) RevisionName() string
- func (s *Spec) Update(message *rpc.ApiSpec, mask *fieldmaskpb.FieldMask) error
- type SpecRevisionTag
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandMask ¶
func ExpandMask(m protoreflect.ProtoMessage, mask *fieldmaskpb.FieldMask) *fieldmaskpb.FieldMask
ExpandMask returns a field mask for the given message following AIP-134 guidance. When the mask argument is nil, only populated (non-default) fields are included. When the mask argument only contains the wildcard character '*', every proto fields is included.
func GUnzippedBytes ¶
GUnzippedBytes uncompresses a slice of bytes.
func ValidateMask ¶
func ValidateMask(message protoreflect.ProtoMessage, mask *fieldmaskpb.FieldMask) error
ValidateMask returns an error if and only if the given mask does not follow AIP-134 guidance.
Types ¶
type Api ¶
type Api struct {
Key string `gorm:"primaryKey"`
ProjectID string // Uniquely identifies a project.
ApiID string // Uniquely identifies an api within a project.
DisplayName string // A human-friendly name.
Description string // A detailed description.
CreateTime time.Time // Creation time.
UpdateTime time.Time // Time of last change.
Availability string // Availability of the API.
RecommendedVersion string // Recommended API version.
RecommendedDeployment string // Recommended API deployment.
Labels []byte // Serialized labels.
Annotations []byte // Serialized annotations.
ParentProjectKey string
ParentProject *Project `gorm:"foreignKey:ParentProjectKey;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}
Api is the storage-side representation of an API.
type Artifact ¶
type Artifact struct {
Key string `gorm:"primaryKey"`
ProjectID string // Project associated with artifact (required).
ApiID string `gorm:"index"` // Api associated with artifact (if appropriate).
VersionID string // Version associated with artifact (if appropriate).
SpecID string // Spec associated with artifact (if appropriate).
RevisionID string // Revision associated with parent (if appropriate).
DeploymentID string // Deployment associated with artifact (if appropriate).
ArtifactID string // Artifact identifier (required).
CreateTime time.Time // Creation time.
UpdateTime time.Time // Time of last change.
MimeType string // MIME type of artifact
SizeInBytes int32 // Size of the spec.
Hash string // A hash of the spec.
Labels []byte // Serialized labels.
Annotations []byte // Serialized annotations.
}
Artifact is the storage-side representation of an artifact.
func NewArtifact ¶
NewArtifact initializes a new resource.
func (*Artifact) LabelsMap ¶ added in v0.5.7
LabelsMap returns a map representation of stored labels.
type Blob ¶
type Blob struct {
Key string `gorm:"primaryKey"`
ProjectID string // Uniquely identifies a project.
ApiID string // Uniquely identifies an API within a project.
VersionID string // Uniquely identifies a version of an API.
SpecID string // Uniquely identifies a spec of a version.
RevisionID string // Uniquely identifies a revision of a spec.
DeploymentID string // Uniquely identifies a deployment of an API.
ArtifactID string // Uniquely identifies an artifact on a resource.
Hash string // Hash of the blob contents.
SizeInBytes int32 // Size of the blob contents.
Contents []byte // The contents of the blob.
CreateTime time.Time // Creation time.
UpdateTime time.Time // Time of last change.
}
Blob is the storage-side representation of a blob.
func NewBlobForArtifact ¶
NewBlobForArtifact creates a new Blob object to store artifact contents.
func NewBlobForSpec ¶
NewBlobForSpec creates a new Blob object to store spec contents.
type Deployment ¶ added in v0.3.9
type Deployment struct {
Key string `gorm:"primaryKey"`
ProjectID string // Uniquely identifies a project.
ApiID string `gorm:"index:idx_latest"` // Uniquely identifies an api within a project.
DeploymentID string `gorm:"index:idx_latest"` // Uniquely identifies a deployment within an api.
RevisionID string // Uniquely identifies a revision of a deployment.
DisplayName string // A human-friendly name.
Description string // A detailed description.
CreateTime time.Time // Creation time.
RevisionCreateTime time.Time `gorm:"index:idx_latest,sort:desc"` // Revision creation time.
RevisionUpdateTime time.Time // Time of last change.
ApiSpecRevision string // The spec being served by the deployment.
EndpointURI string // The address where the deployment is serving.
ExternalChannelURI string // The address of the external channel of the API.
IntendedAudience string // The intended audience of the API.
AccessGuidance string // A brief description of how to access the endpoint.
Labels []byte // Serialized labels.
Annotations []byte // Serialized annotations.
ParentApiKey string
ParentApi *Api `gorm:"foreignKey:ParentApiKey;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}
Deployment is the storage-side representation of a deployment.
func NewDeployment ¶ added in v0.3.9
func NewDeployment(name names.Deployment, body *rpc.ApiDeployment) (deployment *Deployment, err error)
NewDeployment initializes a new resource.
func (*Deployment) BasicMessage ¶ added in v0.3.9
func (s *Deployment) BasicMessage(name string) (message *rpc.ApiDeployment, err error)
BasicMessage returns the basic view of the deployment resource as an RPC message.
func (*Deployment) LabelsMap ¶ added in v0.3.9
func (s *Deployment) LabelsMap() (map[string]string, error)
LabelsMap returns a map representation of stored labels.
func (*Deployment) Name ¶ added in v0.3.9
func (s *Deployment) Name() string
Name returns the resource name of the deployment.
func (*Deployment) NewRevision ¶ added in v0.3.9
func (s *Deployment) NewRevision() *Deployment
NewRevision returns a new revision based on the deployment.
func (*Deployment) RevisionName ¶ added in v0.3.9
func (s *Deployment) RevisionName() string
RevisionName generates the resource name of the deployment revision.
func (*Deployment) Update ¶ added in v0.3.9
func (s *Deployment) Update(message *rpc.ApiDeployment, mask *fieldmaskpb.FieldMask) error
Update modifies a deployment using the contents of a message.
type DeploymentRevisionTag ¶ added in v0.3.9
type DeploymentRevisionTag struct {
Key string `gorm:"primaryKey"`
ProjectID string // Uniquely identifies a project.
ApiID string // Uniquely identifies an api within a project.
DeploymentID string // Uniquely identifies a deployment within an api.
RevisionID string // Uniquely identifies a revision of a deployment.
Tag string // The tag to use for the revision.
CreateTime time.Time // Creation time.
UpdateTime time.Time // Time of last change.
ParentDeploymentKey string
ParentDeployment *Deployment `gorm:"foreignKey:ParentDeploymentKey;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}
DeploymentRevisionTag is the storage-side representation of a deployment revision tag.
func NewDeploymentRevisionTag ¶ added in v0.3.9
func NewDeploymentRevisionTag(name names.DeploymentRevision, tag string) *DeploymentRevisionTag
NewDeploymentRevisionTag initializes a new revision tag from a given revision name and tag string.
func (*DeploymentRevisionTag) String ¶ added in v0.3.9
func (t *DeploymentRevisionTag) String() string
type Project ¶
type Project struct {
Key string `gorm:"primaryKey"`
ProjectID string // Uniquely identifies a project.
DisplayName string // A human-friendly name.
Description string // A detailed description.
CreateTime time.Time // Creation time.
UpdateTime time.Time // Time of last change.
}
Project is the storage-side representation of a project.
func NewProject ¶
NewProject initializes a new resource.
type Spec ¶
type Spec struct {
Key string `gorm:"primaryKey"`
ProjectID string // Uniquely identifies a project.
ApiID string `gorm:"index"` // Uniquely identifies an api within a project.
VersionID string // Uniquely identifies a version within an api.
SpecID string // Uniquely identifies a spec within a version.
RevisionID string // Uniquely identifies a revision of a spec.
Description string // A detailed description.
CreateTime time.Time // Creation time.
RevisionCreateTime time.Time // Revision creation time.
RevisionUpdateTime time.Time // Time of last change.
MimeType string // Spec format.
SizeInBytes int32 // Size of the spec.
Hash string // A hash of the spec.
FileName string // Name of spec file.
SourceURI string // The original source URI of the spec.
Labels []byte // Serialized labels.
Annotations []byte // Serialized annotations.
ParentVersionKey string
ParentVersion *Version `gorm:"foreignKey:ParentVersionKey;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}
Spec is the storage-side representation of a spec.
func (*Spec) BasicMessage ¶
BasicMessage returns the basic view of the spec resource as an RPC message.
func (*Spec) NewRevision ¶
NewRevision returns a new revision based on the spec.
func (*Spec) RevisionName ¶
RevisionName generates the resource name of the spec revision.
type SpecRevisionTag ¶
type SpecRevisionTag struct {
Key string `gorm:"primaryKey"`
ProjectID string // Uniquely identifies a project.
ApiID string // Uniquely identifies an api within a project.
VersionID string // Uniquely identifies a version within an api.
SpecID string // Uniquely identifies a spec within a version.
RevisionID string // Uniquely identifies a revision of a spec.
Tag string // The tag to use for the revision.
CreateTime time.Time // Creation time.
UpdateTime time.Time // Time of last change.
ParentSpecKey string
ParentSpec *Spec `gorm:"foreignKey:ParentSpecKey;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}
SpecRevisionTag is the storage-side representation of a spec revision tag.
func NewSpecRevisionTag ¶
func NewSpecRevisionTag(name names.SpecRevision, tag string) *SpecRevisionTag
NewSpecRevisionTag initializes a new revision tag from a given revision name and tag string.
func (*SpecRevisionTag) String ¶
func (t *SpecRevisionTag) String() string
type Version ¶
type Version struct {
Key string `gorm:"primaryKey"`
ProjectID string // Uniquely identifies a project.
ApiID string // Uniquely identifies an api within a project.
VersionID string // Uniquely identifies a version within an api.
DisplayName string // A human-friendly name.
Description string // A detailed description.
CreateTime time.Time // Creation time.
UpdateTime time.Time // Time of last change.
State string // Lifecycle stage.
Labels []byte // Serialized labels.
Annotations []byte // Serialized annotations.
PrimarySpec string // Primary Spec for this version.
ParentApiKey string
ParentApi *Api `gorm:"foreignKey:ParentApiKey;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}
Version is the storage-side representation of a version.
func NewVersion ¶
NewVersion initializes a new resource.
func (*Version) Message ¶
func (v *Version) Message() (message *rpc.ApiVersion, err error)
Message returns a message representing a version.
func (*Version) Update ¶
func (v *Version) Update(message *rpc.ApiVersion, mask *fieldmaskpb.FieldMask) error
Update modifies a version using the contents of a message.