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 Project
- type Spec
- func (s *Spec) BasicMessage(name string, tags []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. Labels []byte // Serialized labels. Annotations []byte // Serialized annotations. }
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 // Api associated with artifact (if appropriate). VersionID string // Version associated with artifact (if appropriate). SpecID string // Spec 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. }
Artifact is the storage-side representation of an artifact.
func NewArtifact ¶
NewArtifact initializes a new resource.
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 within a api. SpecID string // Uniquely identifies a spec within a version. RevisionID string // Uniquely identifies a revision of a spec. 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 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 // Uniquely identifies an api within a project. VersionID string // Uniquely identifies a version within a 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. }
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 a 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. }
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 wihtin a 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. }
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.