Documentation ¶
Index ¶
- Constants
- func ErrorIs404(err error) bool
- type APIError
- type Chart
- type Client
- func (client *Client) DeleteChart(project string, chart string) error
- func (client *Client) DeleteCharts(project string, charts []*Chart) error
- func (client *Client) DeleteLabel(id string) error
- func (client *Client) DeleteProject(id string) error
- func (client *Client) DeleteRepositories(projectName string, repos []*Repository) error
- func (client *Client) DeleteRepository(projectName string, repoName string) error
- func (client *Client) DeleteRobotAccount(id string) error
- func (client *Client) DeleteWebhook(id string) error
- func (client *Client) GetCharts(id string) ([]*Chart, error)
- func (client *Client) GetLabel(id string) (*Label, error)
- func (client *Client) GetProject(id string) (*Project, error)
- func (client *Client) GetRepositories(projectName string) ([]*Repository, error)
- func (client *Client) GetResource(id string) (interface{}, error)
- func (client *Client) GetRobotAccount(id string) (*RobotAccount, error)
- func (client *Client) GetWebhook(id string) (*Webhook, error)
- func (client *Client) NewLabel(label *Label) (string, error)
- func (client *Client) NewProject(project *ProjectReq) (string, error)
- func (client *Client) NewRobotAccount(projectID string, robot *RobotAccountCreate) (*RobotAccountPostRep, string, error)
- func (client *Client) NewWebhook(projectID string, webhook *Webhook) (string, error)
- func (client *Client) UpdateLabel(id string, label *Label) error
- func (client *Client) UpdateProject(id string, project *ProjectReq) error
- func (client *Client) UpdateRobotAccount(id string, robot *RobotAccountUpdate) error
- func (client *Client) UpdateWebhook(id string, webhook *Webhook) error
- type Label
- type Project
- type ProjectMetadata
- type ProjectReq
- type Repository
- type RobotAccount
- type RobotAccountAccess
- type RobotAccountCreate
- type RobotAccountPostRep
- type RobotAccountUpdate
- type Webhook
- type WebhookTargetObj
Constants ¶
View Source
const ( APIURLVersion1 = "/api" APIURLVersion2 = "/api/v2.0" )
Variables ¶
This section is empty.
Functions ¶
func ErrorIs404 ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DeleteChart ¶ added in v0.1.0
func (*Client) DeleteCharts ¶ added in v0.1.0
func (*Client) DeleteLabel ¶ added in v0.3.2
func (*Client) DeleteProject ¶
func (*Client) DeleteRepositories ¶ added in v0.1.0
func (client *Client) DeleteRepositories(projectName string, repos []*Repository) error
func (*Client) DeleteRepository ¶ added in v0.1.0
func (*Client) DeleteRobotAccount ¶
func (*Client) DeleteWebhook ¶ added in v0.3.1
func (*Client) GetRepositories ¶ added in v0.1.0
func (client *Client) GetRepositories(projectName string) ([]*Repository, error)
func (*Client) GetResource ¶ added in v0.3.0
func (*Client) GetRobotAccount ¶
func (client *Client) GetRobotAccount(id string) (*RobotAccount, error)
func (*Client) GetWebhook ¶ added in v0.3.1
func (*Client) NewProject ¶
func (client *Client) NewProject(project *ProjectReq) (string, error)
func (*Client) NewRobotAccount ¶
func (client *Client) NewRobotAccount(projectID string, robot *RobotAccountCreate) (*RobotAccountPostRep, string, error)
func (*Client) NewWebhook ¶ added in v0.3.1
func (*Client) UpdateLabel ¶ added in v0.3.2
func (*Client) UpdateProject ¶
func (client *Client) UpdateProject(id string, project *ProjectReq) error
func (*Client) UpdateRobotAccount ¶
func (client *Client) UpdateRobotAccount(id string, robot *RobotAccountUpdate) error
type Label ¶ added in v0.3.2
type Label struct { CreationTime string `json:"creation_time,omitempty"` UpdateTime string `json:"update_time,omitempty"` Deleted bool `json:"deleted,omitempty"` ID int64 `json:"id,omitempty"` Name string `json:"name"` Description string `json:"description"` Color string `json:"color"` Scope string `json:"scope"` ProjectID int64 `json:"project_id"` }
type Project ¶
type Project struct { UpdateTime string `json:"update_time"` OwnerName string `json:"owner_name"` Name string `json:"name"` Deleted bool `json:"deleted"` OwnerID int32 `json:"owner_id"` RepoCount int `json:"repo_count"` CreationTime string `json:"creation_time"` Togglable bool `json:"togglable"` ProjectID int32 `json:"project_id"` CurrentUserRoleIDs []int32 `json:"current_user_role_ids"` ChartCount int `json:"chart_count"` // CVEWhitelist `json:"cve_whitelist"` Metadata ProjectMetadata `json:"metadata"` }
type ProjectMetadata ¶
type ProjectMetadata struct { EnableContentTrust string `json:"enable_content_trust,omitempty"` AutoScan bool `json:"auto_scan,string"` Severity string `json:"severity,omitempty"` ReuseSysCveWhitelist string `json:"reuse_sys_cve_whitelist,omitempty"` Public bool `json:"public,string"` PreventVul string `json:"prevent_vul,omitempty"` }
type ProjectReq ¶
type ProjectReq struct { CountLimit int64 `json:"count_limit,omitempty"` ProjectName string `json:"project_name,omitempty"` // CVEWhitelist `json:"cve_whitelist"` StorageLimit int64 `json:"storage_limit,omitempty"` Metadata ProjectMetadata `json:"metadata,omitempty"` }
type Repository ¶ added in v0.1.0
type Repository struct { ID int `json:"id"` Name string `json:"name"` ProjectID int `json:"project_id"` Description string `json:"description"` PullCount int `json:"pull_count"` StarCount int `json:"star_count"` TagsCount int `json:"tags_count"` Labels []interface{} `json:"labels"` CreationTime time.Time `json:"creation_time"` UpdateTime time.Time `json:"update_time"` }
type RobotAccount ¶
type RobotAccountAccess ¶
type RobotAccountCreate ¶
type RobotAccountCreate struct { Access []RobotAccountAccess `json:"access,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` ExpiresAt int64 `json:"expires_at,omitempty"` }
type RobotAccountPostRep ¶
type RobotAccountUpdate ¶
type RobotAccountUpdate struct {
Disabled bool `json:"disabled,omitempty"`
}
type Webhook ¶ added in v0.3.1
type Webhook struct { UpdateTime string `json:"update_time,omitempty"` Description string `json:"description,omitempty"` Creator string `json:"creator,omitempty"` CreationTime string `json:"creation_time,omitempty"` Enabled bool `json:"enabled"` EventTypes []string `json:"event_types"` ProjectID int `json:"project_id,omitempty"` ID int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` Targets []WebhookTargetObj `json:"targets"` }
Click to show internal directories.
Click to hide internal directories.