repositories

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *golangsdk.ServiceClient, opts ListOptsBuilder) (p pagination.Pager)

Types

type CreateOpts

type CreateOpts struct {
	// Repository - name of the image repository
	Repository string `json:"repository"`
	// Category - the value can be `app_server`, `linux`, `framework_app`, `database`, `lang`, `other`, `windows`, `arm`.
	Category    string `json:"category,omitempty"`
	Description string `json:"description,omitempty"`
	IsPublic    bool   `json:"is_public"`
}

func (CreateOpts) ToRepositoryCreateMap

func (opts CreateOpts) ToRepositoryCreateMap() (map[string]interface{}, error)

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToRepositoryCreateMap() (map[string]interface{}, error)
}

type CreateResult

type CreateResult struct {
	golangsdk.ErrResult
}

func Create

func Create(client *golangsdk.ServiceClient, organization string, opts CreateOptsBuilder) (r CreateResult)

Create new repository in the organization (namespace)

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

func Delete(client *golangsdk.ServiceClient, organization, repository string) (r DeleteResult)

type GetResult

type GetResult struct {
	golangsdk.Result
}

func Get

func Get(client *golangsdk.ServiceClient, organization, repository string) (r GetResult)

func (GetResult) Extract

func (r GetResult) Extract() (*ImageRepository, error)

type ImageRepository

type ImageRepository struct {
	ID             int    `json:"id"`
	OrganizationID int    `json:"ns_id"`
	Name           string `json:"name"`
	Category       string `json:"category"`
	Description    string `json:"description"`
	CreatorID      string `json:"creator_id"`
	CreatorName    string `json:"creator_name"`
	Size           int    `json:"size"`
	IsPublic       bool   `json:"is_public"`
	NumImages      int    `json:"num_images"`
	NumDownloads   int    `json:"num_downloads"`
	URL            string `json:"url"`
	Path           string `json:"path"`
	InternalPath   string `json:"internal_path"`
	Created        string `json:"created"`
	Updated        string `json:"updated"`
	DomainID       string `json:"domain_id"`
}

func ExtractRepositories

func ExtractRepositories(p pagination.Page) ([]ImageRepository, error)

type ListOpts

type ListOpts struct {
	// Organization (namespace) name
	Organization string `q:"namespace"`
	// Image repository name
	Name string `q:"name"`
	// Image repository category.
	Category string `q:"category"`

	// Sorting by column.
	// You can set this parameter to `name`, `updated_time`, and `tag_count`.
	// The parameters OrderColumn and OrderType should always be used together.
	OrderColumn string `q:"order_column"`
	// Sorting type.
	// You can set this parameter to `desc` (descending sort) and `asc` (ascending sort).
	OrderType string `q:"order_type"`

	Offset *int `q:"offset,omitempty"` // offset 0 is a valid value
	Limit  int  `q:"limit,omitempty"`
}

func (ListOpts) ToRepositoryListQuery

func (opts ListOpts) ToRepositoryListQuery() (string, error)

type ListOptsBuilder

type ListOptsBuilder interface {
	ToRepositoryListQuery() (string, error)
}

type RepositoryPage

type RepositoryPage struct {
	pagination.OffsetPageBase
}

type UpdateOpts

type UpdateOpts struct {
	Category    string `json:"category,omitempty"`
	Description string `json:"description,omitempty"`
	IsPublic    bool   `json:"is_public"` // this is mandatory field, so no pointers
}

func (UpdateOpts) ToRepositoryUpdateMap

func (opts UpdateOpts) ToRepositoryUpdateMap() (map[string]interface{}, error)

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToRepositoryUpdateMap() (map[string]interface{}, error)
}

type UpdateResult

type UpdateResult struct {
	golangsdk.ErrResult
}

func Update

func Update(client *golangsdk.ServiceClient, organization, repository string, opts UpdateOptsBuilder) (r UpdateResult)

Jump to

Keyboard shortcuts

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