Documentation ¶
Index ¶
- type Client
- func (c *Client) CreateOrUpdate(ctx context.Context, account string, name string) errordeprecated
- func (c *Client) CreateOrUpdateWithOptions(ctx context.Context, account, name string, opts ...CreateOrUpdateOption) error
- func (c *Client) Delete(ctx context.Context, account, name string) error
- func (c *Client) Get(ctx context.Context, account, name string) (*RepositoryResponse, error)
- func (c *Client) List(ctx context.Context, account string, opts ...common.ListOption) (*RepositoryListResponse, error)
- type CreateOrUpdateOption
- type Package
- type PackageStatusType
- type Repository
- type RepositoryCreateOrUpdateRequest
- type RepositoryListResponse
- type RepositoryResponse
- type RepositoryType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
*up.Config
}
Client is a repositories client.
func NewClient ¶
func NewClient(cfg *up.Config) *Client
NewClient build a repositories client from the passed config.
func (*Client) CreateOrUpdate
deprecated
func (*Client) CreateOrUpdateWithOptions ¶ added in v1.9.1
func (c *Client) CreateOrUpdateWithOptions(ctx context.Context, account, name string, opts ...CreateOrUpdateOption) error
CreateOrUpdateWithOptions creates or updates a repository on Upbound. Repositories will be created as or made private by default.
func (*Client) List ¶
func (c *Client) List(ctx context.Context, account string, opts ...common.ListOption) (*RepositoryListResponse, error)
List all repositories in the given account on Upbound.
type CreateOrUpdateOption ¶ added in v1.9.1
type CreateOrUpdateOption func(*RepositoryCreateOrUpdateRequest)
CreateOrUpdateOption is an option for the CreateOrUpdateWithOptions method.
func WithPrivate ¶ added in v1.9.1
func WithPrivate() CreateOrUpdateOption
WithPrivate makes a repository private.
func WithPublic ¶ added in v1.9.1
func WithPublic() CreateOrUpdateOption
WithPublic makes a repository public.
type Package ¶
type Package struct { PackageID uint `json:"packageId"` RepositoryID uint `json:"repositoryId"` Version string `json:"version"` Status PackageStatusType `json:"status"` Digest string `json:"digest"` Reason *string `json:"reason,omitempty"` CreatedAt time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` }
Package describes a package in a repository.
type PackageStatusType ¶
type PackageStatusType string
PackageStatusType indicates the status of a package.
const ( // PackageStatusReceived indicates a package was received and no further // action has been taken. PackageStatusReceived PackageStatusType = "received" // PackageStatusAnalyzing indicates a package is in the process of being // validated. PackageStatusAnalyzing PackageStatusType = "analyzing" // PackageStatusRejected indicates the package failed validation. PackageStatusRejected PackageStatusType = "rejected" // PackageStatusAccepted indicates the package has been validated. PackageStatusAccepted PackageStatusType = "accepted" // PackageStatusPublished indicates the package has been validated and is // now published in Upbound Marketplace. PackageStatusPublished PackageStatusType = "published" )
type Repository ¶
type Repository struct { RepositoryID uint `json:"repositoryId"` AccountID uint `json:"accountId"` Name string `json:"name"` Type *RepositoryType `json:"type,omitempty"` Public bool `json:"public"` Official bool `json:"official"` CurrentVersion *string `json:"currentVersion,omitempty"` CreatedAt time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` }
Repository describes a repository.
type RepositoryCreateOrUpdateRequest ¶ added in v1.9.1
type RepositoryCreateOrUpdateRequest struct {
Public bool `json:"public"`
}
RepositoryCreateOrUpdateRequest is the HTTP body for creating or updating a repository.
type RepositoryListResponse ¶
type RepositoryListResponse struct { Repositories []Repository `json:"repositories"` Size int `json:"size"` Page int `json:"page"` Count int `json:"count"` }
RepositoryListResponse is the HTTP body returned when listing repositories.
type RepositoryResponse ¶
type RepositoryResponse struct { Repository Versions []Package `json:"versions"` }
RepositoryResponse is the HTTP body returned when fetching a repository.
type RepositoryType ¶
type RepositoryType string
RepositoryType is the base type for repository types
const ( // RepositoryTypeProvider indicates that the repository contains a provider. RepositoryTypeProvider RepositoryType = "provider" // RepositoryTypeConfiguration indicates that the repository contains a // configuration. RepositoryTypeConfiguration RepositoryType = "configuration" // RepositoryTypeFunction indicates that the repository contains a // function. RepositoryTypeFunction RepositoryType = "function" )