storage

package
v0.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGormLogger added in v0.4.2

func NewGormLogger(ctx context.Context) logger.Interface

Types

type ApiList

type ApiList struct {
	Apis  []models.Api
	Token string
}

ApiList contains a page of api resources.

type ArtifactList

type ArtifactList struct {
	Artifacts []models.Artifact
	Token     string
}

ArtifactList contains a page of artifact resources.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a connection to a storage provider.

func NewClient

func NewClient(ctx context.Context, driver, dsn string) (*Client, error)

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) Close added in v0.4.2

func (c *Client) Close()

Close closes a database session.

func (*Client) DatabaseName added in v0.4.2

func (c *Client) DatabaseName() string

func (*Client) DeleteApi

func (c *Client) DeleteApi(ctx context.Context, name names.Api, cascade bool) error

func (*Client) DeleteArtifact

func (c *Client) DeleteArtifact(ctx context.Context, name names.Artifact) error

func (*Client) DeleteDeployment added in v0.3.9

func (c *Client) DeleteDeployment(ctx context.Context, name names.Deployment, cascade bool) error

func (*Client) DeleteDeploymentRevision added in v0.3.9

func (c *Client) DeleteDeploymentRevision(ctx context.Context, name names.DeploymentRevision) error

func (*Client) DeleteProject

func (c *Client) DeleteProject(ctx context.Context, name names.Project, cascade bool) error

func (*Client) DeleteSpec

func (c *Client) DeleteSpec(ctx context.Context, name names.Spec, cascade bool) error

func (*Client) DeleteSpecRevision

func (c *Client) DeleteSpecRevision(ctx context.Context, name names.SpecRevision) error

func (*Client) DeleteVersion

func (c *Client) DeleteVersion(ctx context.Context, name names.Version, cascade bool) error

func (*Client) EnsureTables added in v0.4.2

func (c *Client) EnsureTables() error

EnsureTables ensures that all necessary tables exist in the database.

func (*Client) GetApi

func (c *Client) GetApi(ctx context.Context, name names.Api) (*models.Api, error)

func (*Client) GetArtifact

func (c *Client) GetArtifact(ctx context.Context, name names.Artifact) (*models.Artifact, error)

func (*Client) GetArtifactContents

func (c *Client) GetArtifactContents(ctx context.Context, name names.Artifact) (*models.Blob, error)

func (*Client) GetDeployment added in v0.3.9

func (c *Client) GetDeployment(ctx context.Context, name names.Deployment) (*models.Deployment, error)

func (*Client) GetDeploymentRevision added in v0.3.9

func (c *Client) GetDeploymentRevision(ctx context.Context, name names.DeploymentRevision) (*models.Deployment, error)

func (*Client) GetProject

func (c *Client) GetProject(ctx context.Context, name names.Project) (*models.Project, error)

func (*Client) GetSpec

func (c *Client) GetSpec(ctx context.Context, name names.Spec) (*models.Spec, error)

func (*Client) GetSpecRevision

func (c *Client) GetSpecRevision(ctx context.Context, name names.SpecRevision) (*models.Spec, error)

func (*Client) GetSpecRevisionContents

func (c *Client) GetSpecRevisionContents(ctx context.Context, name names.SpecRevision) (*models.Blob, error)

func (*Client) GetVersion

func (c *Client) GetVersion(ctx context.Context, name names.Version) (*models.Version, error)

func (*Client) ListApiArtifacts

func (c *Client) ListApiArtifacts(ctx context.Context, parent names.Api, opts PageOptions) (ArtifactList, error)

func (*Client) ListApis

func (c *Client) ListApis(ctx context.Context, parent names.Project, opts PageOptions) (ApiList, error)

func (*Client) ListDeploymentArtifacts added in v0.3.12

func (c *Client) ListDeploymentArtifacts(ctx context.Context, parent names.Deployment, opts PageOptions) (ArtifactList, error)

func (*Client) ListDeploymentRevisions added in v0.3.9

func (c *Client) ListDeploymentRevisions(ctx context.Context, parent names.Deployment, opts PageOptions) (DeploymentList, error)

func (*Client) ListDeployments added in v0.3.9

func (c *Client) ListDeployments(ctx context.Context, parent names.Api, opts PageOptions) (DeploymentList, error)

func (*Client) ListProjectArtifacts

func (c *Client) ListProjectArtifacts(ctx context.Context, parent names.Project, opts PageOptions) (ArtifactList, error)

func (*Client) ListProjects

func (c *Client) ListProjects(ctx context.Context, opts PageOptions) (ProjectList, error)

func (*Client) ListSpecArtifacts

func (c *Client) ListSpecArtifacts(ctx context.Context, parent names.Spec, opts PageOptions) (ArtifactList, error)

func (*Client) ListSpecRevisions

func (c *Client) ListSpecRevisions(ctx context.Context, parent names.Spec, opts PageOptions) (SpecList, error)

func (*Client) ListSpecs

func (c *Client) ListSpecs(ctx context.Context, parent names.Version, opts PageOptions) (SpecList, error)

func (*Client) ListVersionArtifacts

func (c *Client) ListVersionArtifacts(ctx context.Context, parent names.Version, opts PageOptions) (ArtifactList, error)

func (*Client) ListVersions

func (c *Client) ListVersions(ctx context.Context, parent names.Api, opts PageOptions) (VersionList, error)

func (*Client) Migrate added in v0.4.2

func (c *Client) Migrate(kind string) error

func (*Client) RowCount added in v0.4.2

func (c *Client) RowCount(tableName string) (int64, error)

func (*Client) SaveApi

func (c *Client) SaveApi(ctx context.Context, v *models.Api) error

func (*Client) SaveArtifact

func (c *Client) SaveArtifact(ctx context.Context, v *models.Artifact) error

func (*Client) SaveArtifactContents

func (c *Client) SaveArtifactContents(ctx context.Context, artifact *models.Artifact, contents []byte) error

func (*Client) SaveDeploymentRevision added in v0.3.9

func (c *Client) SaveDeploymentRevision(ctx context.Context, v *models.Deployment) error

func (*Client) SaveDeploymentRevisionTag added in v0.3.9

func (c *Client) SaveDeploymentRevisionTag(ctx context.Context, v *models.DeploymentRevisionTag) error

func (*Client) SaveProject

func (c *Client) SaveProject(ctx context.Context, v *models.Project) error

func (*Client) SaveSpecRevision

func (c *Client) SaveSpecRevision(ctx context.Context, v *models.Spec) error

func (*Client) SaveSpecRevisionContents

func (c *Client) SaveSpecRevisionContents(ctx context.Context, spec *models.Spec, contents []byte) error

func (*Client) SaveSpecRevisionTag

func (c *Client) SaveSpecRevisionTag(ctx context.Context, v *models.SpecRevisionTag) error

func (*Client) SaveVersion

func (c *Client) SaveVersion(ctx context.Context, v *models.Version) error

func (*Client) TableNames added in v0.4.2

func (c *Client) TableNames() ([]string, error)

type DeploymentList added in v0.3.9

type DeploymentList struct {
	Deployments []models.Deployment
	Token       string
}

DeploymentList contains a page of deployment resources.

type PageOptions

type PageOptions struct {
	// Size is the maximum number of resources to include in the response.
	// If unspecified, page size defaults to 50. Values above 1000 are coerced to 1000.
	Size int32
	// Filter is the filter string for this listing request, as described at https://google.aip.dev/160.
	Filter string
	// Token is a value returned from with a previous page in a series of listing requests.
	// If specified, listing will continue from the end of the previous page. Otherwise,
	// the first page in a listing series will be returned.
	Token string
}

PageOptions contains custom arguments for listing requests.

type ProjectList

type ProjectList struct {
	Projects []models.Project
	Token    string
}

ProjectList contains a page of project resources.

type SpecList

type SpecList struct {
	Specs []models.Spec
	Token string
}

SpecList contains a page of spec resources.

type VersionList

type VersionList struct {
	Versions []models.Version
	Token    string
}

VersionList contains a page of version resources.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL