Documentation
¶
Index ¶
- Constants
- Variables
- func DownloadFile(url string, filepath string) error
- func NewHarborClient(options *root.GlobalOptions) *harborClient
- func Test()
- type Chart
- type ChartInfo
- type HarborChartInterface
- type HarborClientInterface
- type HarborImageInterface
- type HarborProjectInterface
- type HarborRegistryInterface
- type HarborReplicationInterface
- type Image
- type Project
- type Registry
- func (r *Registry) CreateRegistry() error
- func (r *Registry) CreateRegistryByConfigInfo(name string, replaceName string) error
- func (r *Registry) DeleteRegistry(id int64) error
- func (h Registry) GetImageTagsByImageName(name string) map[string]string
- func (r *Registry) SearchRegistry(name string) error
- func (r *Registry) SearchRegistryByID(id string, isPrint bool) (*models.Registry, error)
- func (r *Registry) SearchRegistryList() error
- type RegistryInfo
- type RegistryInputParams
- type Replication
- func (r *Replication) CreateReplication(id string, isPull bool) error
- func (r *Replication) DeleteReplication(id int64) error
- func (h Replication) GetImageTagsByImageName(name string) map[string]string
- func (r *Replication) GetReplicationInfo(id string) *models.ReplicationPolicy
- func (r *Replication) ModifyReplication(id string)
- func (r *Replication) SearchExecutionByID(id string)
- func (r *Replication) SearchReplication(name string) error
- func (r *Replication) SearchReplicationByID(id string, isPrint bool) (*models.ReplicationPolicy, error)
- func (r *Replication) SearchReplicationList() error
- func (r *Replication) SearchTasksByID(id string, size string)
- func (r *Replication) StartExecution(id string)
- func (re *Replication) StartExecutionFromConfig(id string, path string)
- type ReplicationInfo
- type ReplicationRules
- type ScanImage
- func (s *ScanImage) FilterHarborImageTagContains(image *scan.Image, harborImage map[string]string) (ok bool, imageName string, imageTag string)
- func (s *ScanImage) FilterHarborImageTagEqual(image *scan.Image, harborImage map[string]string) (ok bool, imageName string, imageTag string)
- func (s *ScanImage) FilterHarborImageTagNoContains(image *scan.Image, harborImage map[string]string) (ok bool, imageName string, imageTag string)
- func (s *ScanImage) FilterHarborImageTagNoEqual(image *scan.Image, harborImage map[string]string) (ok bool, imageName string, imageTag string)
- func (h ScanImage) GetImageTagsByImageName(name string) map[string]string
- func (s *ScanImage) PrintCompare() *ScanImage
- func (s *ScanImage) PrintDiff() *ScanImage
- func (s *ScanImage) PrintFile()
- func (s *ScanImage) ReadDataFromFile(path string) []byte
- func (s *ScanImage) WithImagesFromHarbor()
Constants ¶
View Source
const (
RegistryURLPath = "/api/v2.0/registries"
)
Variables ¶
View Source
var ( InsecureTransport http.RoundTripper = &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, DualStack: true, }).DialContext, TLSClientConfig: &tls.Config{ InsecureSkipVerify: true, }, MaxIdleConns: 100, IdleConnTimeout: 90 * time.Second, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, } )
Functions ¶
func DownloadFile ¶
func NewHarborClient ¶
func NewHarborClient(options *root.GlobalOptions) *harborClient
Types ¶
type Chart ¶
type Chart struct {
// contains filtered or unexported fields
}
func NewChart ¶
func NewChart(options *root.GlobalOptions) *Chart
func (*Chart) DownloadChart ¶
func (Chart) GetImageTagsByImageName ¶
scan use
func (*Chart) SearchChart ¶
type ChartInfo ¶
type ChartInfo struct {
Name string `json:"name"`
Home string `json:"home"`
Sources []string `json:"sources"`
Version string `json:"version"`
Description string `json:"description"`
Keywords []string `json:"keywords"`
Maintainers []struct {
Name string `json:"name"`
Email string `json:"email"`
} `json:"maintainers"`
Icon string `json:"icon"`
APIVersion string `json:"apiVersion"`
AppVersion string `json:"appVersion"`
Annotations struct {
ArtifacthubIoLinks string `json:"artifacthub.io/links"`
ArtifacthubIoOperator string `json:"artifacthub.io/operator"`
} `json:"annotations"`
KubeVersion string `json:"kubeVersion"`
Dependencies []struct {
Name string `json:"name"`
Version string `json:"version"`
Repository string `json:"repository"`
Condition string `json:"condition"`
} `json:"dependencies"`
Type string `json:"type"`
Urls []string `json:"urls"`
Created time.Time `json:"created"`
Digest string `json:"digest"`
Labels []interface{} `json:"labels"`
}
type HarborChartInterface ¶
type HarborChartInterface interface {
Download()
}
type HarborClientInterface ¶
type HarborClientInterface interface {
HarborRegistryInterface
HarborReplicationInterface
}
type HarborImageInterface ¶
type HarborProjectInterface ¶
type HarborRegistryInterface ¶
type HarborReplicationInterface ¶
type HarborReplicationInterface interface {
}
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
func NewImage ¶
func NewImage(options *root.GlobalOptions) *Image
func (*Image) DownloadImage ¶
func (Image) GetImageTagsByImageName ¶
scan use
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
func NewProject ¶
func NewProject(options *root.GlobalOptions) *Project
func (*Project) CreateProject ¶
func (*Project) DeleteProject ¶
func (Project) GetImageTagsByImageName ¶
scan use
func (*Project) SearchProjects ¶
func (*Project) SearchProjectsList ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry(options *root.GlobalOptions) *Registry
func (*Registry) CreateRegistry ¶
func (*Registry) CreateRegistryByConfigInfo ¶
func (*Registry) DeleteRegistry ¶
func (Registry) GetImageTagsByImageName ¶
scan use
func (*Registry) SearchRegistry ¶
func (*Registry) SearchRegistryByID ¶
func (*Registry) SearchRegistryList ¶
type RegistryInfo ¶
type RegistryInfo struct {
ID int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"`
URL string `json:"url"`
TokenServiceURL string `json:"token_service_url"`
Credential struct {
Type string `json:"type"`
AccessKey string `json:"access_key"`
AccessSecret string `json:"access_secret"`
} `json:"credential"`
Insecure bool `json:"insecure"`
Status string `json:"status"`
CreationTime time.Time `json:"creation_time"`
UpdateTime time.Time `json:"update_time"`
}
type RegistryInputParams ¶
type RegistryInputParams struct {
// contains filtered or unexported fields
}
type Replication ¶
type Replication struct {
// contains filtered or unexported fields
}
func NewReplication ¶
func NewReplication(options *root.GlobalOptions) *Replication
func (*Replication) CreateReplication ¶
func (r *Replication) CreateReplication(id string, isPull bool) error
func (*Replication) DeleteReplication ¶
func (r *Replication) DeleteReplication(id int64) error
func (Replication) GetImageTagsByImageName ¶
scan use
func (*Replication) GetReplicationInfo ¶
func (r *Replication) GetReplicationInfo(id string) *models.ReplicationPolicy
func (*Replication) ModifyReplication ¶
func (r *Replication) ModifyReplication(id string)
func (*Replication) SearchExecutionByID ¶
func (r *Replication) SearchExecutionByID(id string)
func (*Replication) SearchReplication ¶
func (r *Replication) SearchReplication(name string) error
func (*Replication) SearchReplicationByID ¶
func (r *Replication) SearchReplicationByID(id string, isPrint bool) (*models.ReplicationPolicy, error)
func (*Replication) SearchReplicationList ¶
func (r *Replication) SearchReplicationList() error
func (*Replication) SearchTasksByID ¶
func (r *Replication) SearchTasksByID(id string, size string)
func (*Replication) StartExecution ¶
func (r *Replication) StartExecution(id string)
根据replicationID 直接开始推送
func (*Replication) StartExecutionFromConfig ¶
func (re *Replication) StartExecutionFromConfig(id string, path string)
type ReplicationInfo ¶
type ReplicationInfo struct {
ID int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Creator string `json:"creator"`
SrcRegistry struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"`
URL string `json:"url"`
TokenServiceURL string `json:"token_service_url"`
Credential struct {
Type string `json:"type"`
AccessKey string `json:"access_key"`
AccessSecret string `json:"access_secret"`
} `json:"credential"`
Insecure bool `json:"insecure"`
Status string `json:"status"`
CreationTime time.Time `json:"creation_time"`
UpdateTime time.Time `json:"update_time"`
} `json:"src_registry"`
DestRegistry struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"`
URL string `json:"url"`
TokenServiceURL string `json:"token_service_url"`
Credential struct {
Type string `json:"type"`
AccessKey string `json:"access_key"`
AccessSecret string `json:"access_secret"`
} `json:"credential"`
Insecure bool `json:"insecure"`
Status string `json:"status"`
CreationTime time.Time `json:"creation_time"`
UpdateTime time.Time `json:"update_time"`
} `json:"dest_registry"`
DestNamespace string `json:"dest_namespace"`
Filters []struct {
Type interface{} `json:"type"`
Value interface{} `json:"value"`
} `json:"filters"`
Trigger struct {
Type string `json:"type"`
TriggerSettings struct {
Cron string `json:"cron"`
} `json:"trigger_settings"`
} `json:"trigger"`
Deletion bool `json:"deletion"`
Override bool `json:"override"`
Enabled bool `json:"enabled"`
CreationTime time.Time `json:"creation_time"`
UpdateTime time.Time `json:"update_time"`
}
type ReplicationRules ¶
type ScanImage ¶
type ScanImage struct {
FilePathAndImagesName map[string][]*scan.Image `json:"file_path_and_images_name"`
FilePathAndImages map[string][]*scan.Image `json:"file_path_and_images"`
WithFile bool
WithCompare bool
WithCompareOnlyFalse bool
// contains filtered or unexported fields
}
func NewScanImage ¶
func NewScanImage(options *root.GlobalOptions, withFile, withCompare, withCompareOnlyFalse bool, path, release string) *ScanImage
func (*ScanImage) FilterHarborImageTagContains ¶
func (*ScanImage) FilterHarborImageTagEqual ¶
func (*ScanImage) FilterHarborImageTagNoContains ¶
func (*ScanImage) FilterHarborImageTagNoEqual ¶
func (ScanImage) GetImageTagsByImageName ¶
scan use
func (*ScanImage) PrintCompare ¶
func (*ScanImage) ReadDataFromFile ¶
func (*ScanImage) WithImagesFromHarbor ¶
func (s *ScanImage) WithImagesFromHarbor()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.