Documentation ¶
Index ¶
- Constants
- func Bool(v bool) *bool
- func CheckResponse(resp *http.Response) error
- func Int(v int) *int
- func String(v string) *string
- func Stringify(message interface{}) string
- type BasicAuthTransport
- type Client
- type Image
- type OrganizationsService
- type Property
- type RepoDesc
- type RepositoriesSearchResult
- type RepositoriesService
- func (s *RepositoriesService) DeleteRepo(repo string) (string, *Response, error)
- func (s *RepositoriesService) DeleteTag(repo string, tag string) (string, *Response, error)
- func (s *RepositoriesService) Get(repo string) (*Property, *Response, error)
- func (s *RepositoriesService) GetRepoDesc(repo string) (*RepoDesc, *Response, error)
- func (s *RepositoriesService) GetUserRepo() (*UserRepoResult, *Response, error)
- func (s *RepositoriesService) Set(repo string, property *Property) (string, *Response, error)
- func (s *RepositoriesService) SetRepoDesc(repo string, repoDesc *RepoDesc) (string, *Response, error)
- type Repository
- type Response
- type SearchOptions
- type SearchService
- type StatusService
- type User
- type UserInfo
- type UserInfoService
- type UserRepo
- type UserRepoResult
- type UsersService
Constants ¶
const (
EuropaURL = "http://rnd-dockerhub.huawei.com:9999"
)
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func CheckResponse ¶
CheckResponse check the API response for errors A response is considered an error if it has astatus code outside the 200 range
func Int ¶
Int is a helper routine that allocates a new int32 value to store v and returns a pointer to it.
Types ¶
type BasicAuthTransport ¶
type BasicAuthTransport struct { Username string Password string // Transport is the underlying HTTP transport to use when making requests. //It will default to http.DefaultTransport if nil. Transport http.RoundTripper }
BasicAuthTransport is an http.RoundTripper that authenticates all requests using HTTP Basic Authentication with the provided username and password.
func (*BasicAuthTransport) Client ¶
func (t *BasicAuthTransport) Client() *http.Client
Client returns an *http.Client that makes request that are authenticated using HTTP Basic Authentication
type Client ¶
type Client struct { // Bse URL for API request. BaseURL *url.URL // User agent used when communicating with the API UserAgent string // Servcie used for talking to different parts of the rnd-dockerhub API Repositories *RepositoriesService Organizations *OrganizationsService Search *SearchService Status *StatusService UserInfo *UserInfoService Users *UsersService // contains filtered or unexported fields }
A Client manages communication with the rnd-dockerhub API.
func NewClient ¶
NewClient returns a new rnd-dockerhub API client. if a nil httpclient is provided, http.DefaultClient will be used.
type OrganizationsService ¶
type OrganizationsService struct {
// contains filtered or unexported fields
}
OrganizationsService provides access to the organization related functions in the rnd-dockerhub API
type Property ¶
type Property struct { NumberDL *int `json:"download_num,omitempty"` ImageList []Image `json:"image_list,omitempty"` NumberImage *int `json:"image_num,omitempty"` Property *string `json:"property,omitempty"` RepoName *string `json:"repo,omitempty"` Size *int `json:"size,omitempty"` }
Property represents a rund-dockerhub repo's property
type RepositoriesSearchResult ¶
type RepositoriesSearchResult struct { NumberResults *int `json:"num_results,omitempty"` QueryString *string `json:"query,omitempty"` Repositories []Repository `json:"results,omitempty"` }
RepositoriesSearchResult represents the result of a repositories search
type RepositoriesService ¶
type RepositoriesService struct {
// contains filtered or unexported fields
}
RepositoriesService handles communication with the repository related methods of the rnd-dockerhub API
func (*RepositoriesService) DeleteRepo ¶
func (s *RepositoriesService) DeleteRepo(repo string) (string, *Response, error)
func (*RepositoriesService) Get ¶
func (s *RepositoriesService) Get(repo string) (*Property, *Response, error)
func (*RepositoriesService) GetRepoDesc ¶
func (s *RepositoriesService) GetRepoDesc(repo string) (*RepoDesc, *Response, error)
func (*RepositoriesService) GetUserRepo ¶
func (s *RepositoriesService) GetUserRepo() (*UserRepoResult, *Response, error)
func (*RepositoriesService) SetRepoDesc ¶
type Repository ¶
type Repository struct { Description *string `json:"description,omitempty"` IsOfficial *bool `json:"is_official,omitempty"` IsTrusted *bool `json:"is_trusted,omitempty"` Name *string `json:"name,omitempty"` StarCount *int `json:"star_count,omitempty"` }
Repository represents a rmd-dockerhub repository
func (Repository) String ¶
func (r Repository) String() string
type Response ¶
Response is a rnd-dockerhub API response. This wraps the standard http.Response returnef from rnd-dockerhub.
type SearchOptions ¶
type SearchOptions struct { // How to sort the search results. Sort string `url:"sort,omitempty"` // Sort order if sort parameter is provided. Possible values are asc, desc // Default is desc Order string `url:"order,omitempty"` }
SearchOptions specties optional parameters to the SearchService methods
type SearchService ¶
type SearchService struct {
// contains filtered or unexported fields
}
SearchService provides access to the search related functions in the rnd-dockerhub API.
rnd-dockerhub API docks: http://code.huawei.com/docker-incubator/index/blob/master/docs/api.md
func (*SearchService) Repositories ¶
func (s *SearchService) Repositories(query string, opt *SearchOptions) (*RepositoriesSearchResult, *Response, error)
Repositories searches repositories via various criteria.
type StatusService ¶
type StatusService struct {
// contains filtered or unexported fields
}
type User ¶
type UserInfo ¶
type UserInfo struct { NumberImage *int `json:"image_num,omitempty"` NumberImagePrivate *int `json:"private_image_num,omitempty"` NumberImageProtect *int `json:"protect_image_num,omitempty"` NumberImagePublic *int `json:"public_image_num,omitempty"` Namespace *string `json:"namespace,omitempty"` Product *string `json:"product,omitempty"` Quote *int64 `json:"quota,omitempty"` UsedSpace *int64 `json:"used_space,omitempty"` Username *string `json:"username,omitempty"` }
UserInfo represents a rnd-dockerhub userinfo
type UserInfoService ¶
type UserInfoService struct {
// contains filtered or unexported fields
}
type UserRepo ¶
type UserRepoResult ¶
type UserRepoResult struct {
RepoList []UserRepo `json:"repo_list,omitempty"`
}
func (UserRepoResult) String ¶
func (u UserRepoResult) String() string
type UsersService ¶
type UsersService struct {
// contains filtered or unexported fields
}
UsersService handles communication with the user related method of the Rnd-dockerhub API
API docs: http://code.huawei.com/h00283522/europa/blob/master/docs/api.md