Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(c *golangsdk.ServiceClient, dependId string) *golangsdk.ErrResult
Delete is a method to remove the current dependency configuration using its ID.
func List ¶
func List(client *golangsdk.ServiceClient, opts ListOptsBuilder) pagination.Pager
List is a method to obtain an array of one or more dependent packages according to the query parameters.
Types ¶
type DependOpts ¶
type DependOpts struct { // Import mode. Options: obs and zip. Type string `json:"depend_type" required:"true"` // Runtime. // Enumeration values: // Java8 // Node.js6.10 // Node.js8.10 // Node.js10.16 // Node.js12.13 // Python2.7 // Python3.6 // Go1.8 // Go1.x // C#(.NET Core 2.0) // C#(.NET Core 2.1) // C#(.NET Core 3.1) // PHP 7.3 Runtime string `json:"runtime" required:"true"` // Name of the dependency. The name can contain a maximum of 96 characters and must start with a letter and end with // a letter or digit. Only letters, digits, underscores (_), periods (.), and hyphens (-) are allowed. Name string `json:"name,omitempty"` // Description of the dependency, which can contain a maximum of 512 characters. Description *string `json:"description,omitempty"` // When depend_type is set to zip, this parameter is required and indicates the file stream format. File string `json:"depend_file,omitempty"` // When depend_type is set to obs, this parameter indicates the address of the dependency stored in OBS. Link string `json:"depend_link,omitempty"` }
DependOpts is the structure required by Create and Update method to create a new dependency or update an existing dependency.
type Dependency ¶
type Dependency struct { // Dependency ID. ID string `json:"id"` // Dependency owner. Owner string `json:"owner"` // URL of the dependency in the OBS console. Link string `json:"link"` // Runtime. Runtime string `json:"runtime"` // Unique ID of the dependency. Etag string `json:"etag"` // Size of the dependency. Size int `json:"size"` // Name of the dependency. Name string `json:"name"` // Description of the dependency. Description string `json:"description"` // File name of the dependency. FileName string `json:"file_name"` }
Dependency is an object struct that represents the elements of the dependencies parameter.
func Create ¶
func Create(c *golangsdk.ServiceClient, opts DependOpts) (*Dependency, error)
Create is a method to create a new custom dependency using a ZIP file in an OBS bucket.
func Get ¶
func Get(c *golangsdk.ServiceClient, dependId string) (*Dependency, error)
Get is a method to obtain a custom dependency detail using its ID.
func Update ¶
func Update(c *golangsdk.ServiceClient, dependId string, opts DependOpts) (*Dependency, error)
Update is a method to update the current dependency configuration.
type DependencyPage ¶
type DependencyPage struct {
pagination.MarkerPageBase
}
DependencyPage represents the response pages of the List method.
func (DependencyPage) IsEmpty ¶
func (r DependencyPage) IsEmpty() (bool, error)
IsEmpty returns true if a ListResult no dependent package.
func (DependencyPage) LastMarker ¶
func (r DependencyPage) LastMarker() (string, error)
LastMarker returns the last marker index in a ListResult.
func (DependencyPage) NextPageURL ¶
func (r DependencyPage) NextPageURL() (string, error)
NextPageURL generates the URL for the page of results after this one.
type ListOpts ¶
type ListOpts struct { // Dependency type, which support public, private, and all, default to all. // public // private // all DependencyType string `q:"dependency_type"` // Runtime of function. Runtime string `q:"runtime"` // Name of the dependency. Name string `q:"name"` // Final record queried last time. Default value: 0. Marker string `q:"marker"` // Maximum number of dependencies that can be obtained in a query, default to 400. Limit string `q:"limit"` }
ListOpts allows to filter list data using given parameters.
func (ListOpts) ToListQuery ¶
ToListQuery is a method which to build a request query by the ListOpts.
type ListOptsBuilder ¶
ListOptsBuilder is an interface which to support request query build of the dependent package search.
type ListResp ¶
type ListResp struct { // Next read location. Next int `json:"next_marker"` // Total number of dependencies. Count int `json:"count"` // Dependency list. Dependencies []Dependency `json:"dependencies"` }
ListResp is an object struct that represents the result of each page.
func ExtractDependencies ¶
func ExtractDependencies(r pagination.Page) (ListResp, error)
ExtractDependencies is a method which to extract the response to a dependent package list, next marker index and count number.