Documentation ¶
Index ¶
- Constants
- func ExpandMask(m protoreflect.ProtoMessage, mask *fieldmaskpb.FieldMask) *fieldmaskpb.FieldMask
- 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) (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 ¶
const BlobEntityName = "Blob"
BlobEntityName is used to represent blobs in storage.
Variables ¶
This section is empty.
Functions ¶
func ExpandMask ¶ added in v0.3.0
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 ValidateMask ¶ added in v0.3.0
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 ¶ added in v0.2.0
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 ¶ added in v0.2.1
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 ¶ added in v0.2.0
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 ¶ added in v0.2.1
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 ¶ added in v0.2.1
BasicMessage returns the basic view of the spec resource as an RPC message.
func (*Spec) NewRevision ¶ added in v0.2.1
NewRevision returns a new revision based on the spec.
func (*Spec) RevisionName ¶ added in v0.2.1
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 ¶ added in v0.2.1
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 ¶ added in v0.2.1
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 ¶ added in v0.2.1
NewVersion initializes a new resource.
func (*Version) LabelsMap ¶ added in v0.2.0
LabelsMap returns a map representation of stored labels.
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.