Documentation ¶
Overview ¶
API client for hub.docker.com
Index ¶
- Constants
- type Auth
- type Client
- func (c *Client) CreateGroup(ctx context.Context, organisation string, createGroup Group) (Group, error)
- func (c *Client) CreatePersonalAccessToken(ctx context.Context, createPersonalAccessToken CreatePersonalAccessToken) (CreatePersonalAccessTokenResponse, error)
- func (c *Client) CreateRepository(ctx context.Context, createRepository Repository) (Repository, error)
- func (c *Client) CreateRepositoryGroup(ctx context.Context, repository string, createRepositoryGroup RepositoryGroup) (RepositoryGroup, error)
- func (c *Client) DeleteGroup(ctx context.Context, organisation string, id string) error
- func (c *Client) DeletePersonalAccessToken(ctx context.Context, uuid string) error
- func (c *Client) DeleteRepository(ctx context.Context, id string) error
- func (c *Client) DeleteRepositoryGroup(ctx context.Context, repository string, id string) error
- func (c *Client) GetGroup(ctx context.Context, organisation string, id string) (Group, error)
- func (c *Client) GetPersonalAccessToken(ctx context.Context, uuid string) (CreatePersonalAccessTokenResponse, error)
- func (c *Client) GetRepository(ctx context.Context, id string) (Repository, error)
- func (c *Client) GetRepositoryGroup(ctx context.Context, repository string, id string) (RepositoryGroup, error)
- func (c *Client) UpdateGroup(ctx context.Context, organisation string, id string, updateGroup Group) (Group, error)
- func (c *Client) UpdateRepository(ctx context.Context, id string, updateRepository Repository) error
- func (c *Client) UpdateRepositoryGroup(ctx context.Context, repository string, id string, ...) (RepositoryGroup, error)
- type CreatePersonalAccessToken
- type CreatePersonalAccessTokenResponse
- type Group
- type GroupMember
- type Repository
- type RepositoryGroup
- type Token
Constants ¶
const BaseURLV2 = "https://hub.docker.com/v2"
APIs default base URL.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { BaseURL string HTTPClient *http.Client // contains filtered or unexported fields }
func (*Client) CreateGroup ¶ added in v2.1.0
func (c *Client) CreateGroup(ctx context.Context, organisation string, createGroup Group) (Group, error)
Create a group / team in organization POST https://hub.docker.com/v2/orgs/organisation_name/groups/ BODY: {"name":"test"} RESPONSE: {"id":123,"name":"test","description":""}
func (*Client) CreatePersonalAccessToken ¶
func (c *Client) CreatePersonalAccessToken(ctx context.Context, createPersonalAccessToken CreatePersonalAccessToken) (CreatePersonalAccessTokenResponse, error)
Personal Access Token ----------------------
func (*Client) CreateRepository ¶
func (c *Client) CreateRepository(ctx context.Context, createRepository Repository) (Repository, error)
Repository -----------
func (*Client) CreateRepositoryGroup ¶ added in v2.1.0
func (c *Client) CreateRepositoryGroup(ctx context.Context, repository string, createRepositoryGroup RepositoryGroup) (RepositoryGroup, error)
Create a repository --> group association in organization POST https://hub.docker.com/v2/repositories/organisation_name/example-fixture-loader/groups/ BODY: {"group_id":123,"groupid":123,"group_name":"example","groupname":"example","permission":"write"} permission: "read" / "write" / "admin"
func (*Client) DeleteGroup ¶ added in v2.1.0
Delete a group in organization DELETE /v2/orgs/organization_name/groups/group_name/
func (*Client) DeletePersonalAccessToken ¶
func (*Client) DeleteRepository ¶
func (*Client) DeleteRepositoryGroup ¶ added in v2.1.0
Delete a repository --> group association in organization DELETE /v2/repositories/organisation_name/example-fixture-loader/groups/123/
func (*Client) GetGroup ¶ added in v2.1.0
Read a group / team in organization GET /v2/orgs/organization_name/groups/group_name/ RESPONSE: {"id": 123, "name": "test", "description": "x"}
func (*Client) GetPersonalAccessToken ¶ added in v2.0.2
func (c *Client) GetPersonalAccessToken(ctx context.Context, uuid string) (CreatePersonalAccessTokenResponse, error)
Note: Returned token will always be blank.
func (*Client) GetRepository ¶
func (*Client) GetRepositoryGroup ¶ added in v2.1.0
func (c *Client) GetRepositoryGroup(ctx context.Context, repository string, id string) (RepositoryGroup, error)
Get a repository --> group association in organization GET /v2/repositories/organisation_name/example-fixture-loader/groups/123/
func (*Client) UpdateGroup ¶ added in v2.1.0
func (c *Client) UpdateGroup(ctx context.Context, organisation string, id string, updateGroup Group) (Group, error)
Edit a group / team in organization PATCH /v2/orgs/organisation_name/groups/group_name/ BODY: {"name":"test","description":"x"} RESPONSE: {"id": 123, "name": "test", "description": "x"}
func (*Client) UpdateRepository ¶
func (*Client) UpdateRepositoryGroup ¶ added in v2.1.0
func (c *Client) UpdateRepositoryGroup(ctx context.Context, repository string, id string, updateRepositoryGroup RepositoryGroup) (RepositoryGroup, error)
Edit a repository --> group association in organization PATCH /v2/repositories/organisation_name/example-fixture-loader/groups/123/ BODY: {"group_id":123,"group_name":"example","groupname":"example","permission":"admin"}
type GroupMember ¶ added in v2.1.0
type Repository ¶
type RepositoryGroup ¶ added in v2.1.0
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
get_repository
Example of reading a repository
|
Example of reading a repository |