Documentation ¶
Index ¶
- Constants
- func NewGormLogger(ctx context.Context) logger.Interface
- type Client
- func (c *Client) Close()
- func (c *Client) Delete(ctx context.Context, q *Query) error
- func (c *Client) Get(ctx context.Context, k *Key, v interface{}) error
- func (c *Client) GetRecentSpecRevisions(ctx context.Context, offset int32, projectID, apiID, versionID string) *Iterator
- func (c *Client) IsNotFound(err error) bool
- func (c *Client) NewKey(kind, name string) *Key
- func (c *Client) NewQuery(kind string) *Query
- func (c *Client) Put(ctx context.Context, k *Key, v interface{}) (*Key, error)
- func (c *Client) Run(ctx context.Context, q *Query) *Iterator
- type Iterator
- type Key
- type Query
- type Requirement
Constants ¶
const ( // ProjectEntityName is the storage entity name for project resources. ProjectEntityName = "Project" // ApiEntityName is the storage entity name for API resources. ApiEntityName = "Api" // VersionEntityName is the storage entity name for API version resources. VersionEntityName = "Version" // SpecEntityName is the storage entity name for API spec resources. SpecEntityName = "Spec" // SpecRevisionTagEntityName is the storage entity name for API spec revision tag resources. SpecRevisionTagEntityName = "SpecRevisionTag" // ArtifactEntityName is the storage entity name for artifact resources. ArtifactEntityName = "Artifact" // BlobEntityName is the storage entity name for blob resources. BlobEntityName = "Blob" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a connection to a storage provider.
func NewClient ¶
NewClient creates a new database session using the provided driver and data source name. Driver must be one of [ sqlite3, postgres, cloudsqlpostgres ]. DSN format varies per database driver.
PostgreSQL DSN Reference: See "Connection Strings" at https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING SQLite DSN Reference: See "URI filename examples" at https://www.sqlite.org/c3ref/open.html
func (*Client) GetRecentSpecRevisions ¶
func (*Client) IsNotFound ¶
IsNotFound returns true if an error is due to an entity not being found.
type Iterator ¶
Iterator can be used to iterate through results of a query.
type Query ¶
type Query struct { Kind string Offset int Order string Requirements []*Requirement }
Query represents a query in a storage provider.
func (*Query) ApplyOffset ¶
func (*Query) Descending ¶
type Requirement ¶
type Requirement struct { Name string Value interface{} }
Requirement adds an equality filter to a query.