Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) AddMemberToProject(ctx context.Context, pm *ProjectMember) (bool, error)
- func (c *Client) CreateProject(ctx context.Context, opt *ProjectInit) (bool, error)
- func (c *Client) CreateUser(ctx context.Context, opt *UserInit) (bool, error)
- func (c *Client) DelMemberToProject(ctx context.Context, username, project string) (bool, error)
- func (c *Client) DeleteProjectById(ctx context.Context, id int64) (deleted bool, err error)
- func (c *Client) DeleteProjectByName(ctx context.Context, project string) (deleted bool, err error)
- func (c *Client) DeleteRepoTag(ctx context.Context, project_name, repo_name, tag_name string) (bool, error)
- func (c *Client) DeleteUser(ctx context.Context, username string) (deleted bool, err error)
- func (c *Client) GetImageByNameAndTag(ctx context.Context, project, name, tag string) error
- func (c *Client) GetProjectById(ctx context.Context, id int64) (*models.Project, error)
- func (c *Client) GetProjectByName(ctx context.Context, projectName string) (*models.Project, error)
- func (c *Client) GetProjectMetadataByUser(ctx context.Context, username, project string) ([]*models.ProjectMember, error)
- func (c *Client) GetProjectMetadataList(ctx context.Context, project string) ([]*models.ProjectMember, error)
- func (c *Client) GetRepoTag(ctx context.Context, project_name, repo_name, tag_name string) (*models.TagDetail, error)
- func (c *Client) GetUserByName(ctx context.Context, username string) (*models.SearchUser, error)
- func (c *Client) Image(project, repo, tag string) string
- func (c *Client) ListConfigures(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) ListProjects(ctx context.Context, opt *ProjectOption) ([]*models.Project, error)
- func (c *Client) ListRepoTags(ctx context.Context, project_name, repo_name string) ([]*models.TagDetail, error)
- func (c *Client) ListRepos(ctx context.Context, project_id int64, opt *RepoOption) (int, []*models.Repo, error)
- func (c *Client) ListReposByProjectName(ctx context.Context, name string) (total int, repos []*models.Repo, err error)
- func (c *Client) ListUser(ctx context.Context, opt *UserOption) ([]*models.Users, error)
- func (c *Client) ResetPwd(ctx context.Context, username string, newPassword string) (reseted bool, err error)
- func (c *Client) Search(ctx context.Context, query string) (*models.SearchResult, error)
- func (c *Client) SearchUser(ctx context.Context, username string) ([]*models.SearchUser, error)
- func (c *Client) UpdateUserPwd(ctx context.Context, username string, upwd *UserUpPwd) (bool, error)
- func (c *Client) UserIsExist(ctx context.Context, username string) (bool, error)
- type Image
- type PageOption
- type ProjectInit
- type ProjectMember
- type ProjectOption
- type RepoOption
- type RepoSortType
- type UserInit
- type UserOption
- type UserUpPwd
Constants ¶
View Source
const ( IMAGE_GET = "/api/repositories?project_id=%s&q=%s" IMAGE_NAGE_TAG = "/api/repositories/%s/tags/%s" )
View Source
const ( PATH_FMT_PROJECT_LIST = "/api/projects" PATH_FMT_PROJECT_GET = "/api/projects/%d" PATH_FMT_PROJECT_ADD_MEMBER = "/api/projects/%d/members" PATH_FMT_PROJECT_DEL_MEMBER = "/api/projects/%d/members/%d" PATH_FMT_PROJECT_GET_MEMBERs = "/api/projects/%d/members/?entityname=" )
View Source
const ( PATH_FMT_REPO_LIST = "/api/repositories" PATH_FMT_REPOTAGS_LIST = "/api/repositories/%s/%s/tags" PATH_FMT_REPOTAG = "/api/repositories/%s/%s/tags/%s" )
View Source
const ( REPO_SORT_BYNAME_ASC = "name" REPO_SORT_BYNAME_DESC = "-name" REPO_SORT_BYCREATION_ASC = "creation_time" REPO_SORT_BYCREATION_DESC = "-creation_time" REPO_SORT_BYUPDATETIME_ASC = "update_time" REPO_SORT_BYUPDATETIME_DESC = "-update_time" )
View Source
const ( PATH_FMT_USER_CREATE = "/api/users" PATH_FMT_USER_LIST = "/api/users" PATH_FMT_USER_SEARCH = "/api/users/search?username=%s" PATH_FMT_USER_PASSWORD = "/api/users/%d/password" PATH_FMT_USER_DELETE = "/api/users/%d" )
View Source
const (
PATH_FMT_CONFIGURE_LIST = "/api/configurations"
)
View Source
const (
PATH_FMT_SEARCH = "/api/search"
)
Variables ¶
View Source
var ( NotFoundError = fmt.Errorf("not found") UserNotLoginError = fmt.Errorf("user need to login") CallApiError = fmt.Errorf("call api failed") ServerInternalError = fmt.Errorf("server internal error") NotAllowError = fmt.Errorf("not allow") )
View Source
var ( ERROR_THE_GINSENG = errors.New("Passing parameters cannot nil") ERROR_THE_FORMAT = errors.New("Unsatisfied with constraints of the user creation.") ERROR_THE_PERMISSIONS = errors.New("User registration can only be used by admin role user when self-registration is off") ERROR_THE_TYPE = errors.New("The Media Type of the request is not supported, it has to be 'application/json'") ERROR_THE_SERVER = errors.New("Unexpected internal errors") ERROR_THE_PKG = errors.New("Running errors") ERROR_THE_401 = errors.New("User need to log in first.") ERROR_THE_409 = errors.New("Maybe existing") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddMemberToProject ¶
func (*Client) CreateProject ¶
todo : lower harbor public!!!!!!!!!!!
func (*Client) CreateUser ¶
func (*Client) DelMemberToProject ¶
func (*Client) DeleteProjectById ¶
func (*Client) DeleteProjectByName ¶
func (*Client) DeleteRepoTag ¶
func (*Client) DeleteUser ¶
func (*Client) GetImageByNameAndTag ¶ added in v1.0.1
func (*Client) GetProjectById ¶
func (*Client) GetProjectByName ¶
func (*Client) GetProjectMetadataByUser ¶
func (*Client) GetProjectMetadataList ¶
func (*Client) GetRepoTag ¶
func (*Client) GetUserByName ¶
func (*Client) ListConfigures ¶
func (*Client) ListProjects ¶
func (*Client) ListRepoTags ¶
func (*Client) ListReposByProjectName ¶
func (*Client) ResetPwd ¶
func (c *Client) ResetPwd(ctx context.Context, username string, newPassword string) (reseted bool, err error)
TODO:Harbor's pwd manage is `Chaos`,pls commit ur code!!!
func (*Client) SearchUser ¶
func (*Client) UpdateUserPwd ¶
TODO:harbor api is false. the same as update password and reset password
type PageOption ¶
func (PageOption) Urls ¶
func (opt PageOption) Urls() (v url.Values)
type ProjectInit ¶
type ProjectMember ¶
type ProjectOption ¶
type ProjectOption struct {
Name string
Public string
Owner string
PageOption
}
func (*ProjectOption) Urls ¶
func (opt *ProjectOption) Urls() url.Values
type RepoOption ¶
type RepoOption struct {
Name string
Sort RepoSortType
LabelId string
PageOption
}
func (*RepoOption) Urls ¶
func (opt *RepoOption) Urls() url.Values
type RepoSortType ¶
type RepoSortType = string
type UserOption ¶
type UserOption struct {
Username string
Email string
PageOption
}
func (*UserOption) Urls ¶
func (opt *UserOption) Urls() url.Values
Source Files
¶
Click to show internal directories.
Click to hide internal directories.