types

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SyncImageInitializing = "Initializing"
	SyncImageRunning      = "Running"
	SyncImageError        = "Error"
	SyncImageComplete     = "Completed"
)
View Source
const (
	SyncNamespaceLogoType        = 0
	SyncNamespaceLabelType       = 1
	SyncNamespaceDefaultLogoType = 2
)
View Source
const (
	AddImageLabelType        = 0
	DeleteImageLabelType     = 1
	IdempotentImageLabelType = 2
)
View Source
const (
	SkopeoDriver = "skopeo"
	DockerDriver = "docker"
)
View Source
const (
	FreeUserType = 0
	PayUserType  = 1
)
View Source
const (
	ImageHubDocker = "dockerhub"
	ImageHubGCR    = "gcr.io"
	ImageHubQuay   = "quay.io"
	ImageHubAll    = "all"
)
View Source
const (
	FuzzySearch    = 0 // 模糊查询
	AccurateSearch = 1 // 精准查询
)
View Source
const (
	DefaultGCRNamespace       = "google-containers"
	DefaultDockerhubNamespace = "library"
)
View Source
const (
	OpCreateAction = iota + 1
	OpGetAction
	OpCreateIfNotAction
)
View Source
const (
	SearchTypeRepo = iota + 1
	SearchTypeTag
	SearchTypeTagInfo
	GetTypeRepo
)
View Source
const (
	CallGithubType        = 5
	CallKubernetesTagType = 6
	CallSearchType        = 7
)
View Source
const (
	UserNotifyRole   = 0
	SystemNotifyRole = 1

	DingtalkNotifyType = "dingtalk"
	QiWeiNotifyType    = "qiwei"
	FeiShuNotifyType   = "feishu"
	EmailNotifyType    = "email"
	WebhookNotifyType  = "webhook"
)
View Source
const (
	GithubAPIBase = "https://api.github.com"
)
View Source
const (
	SyncTaskInitializing = "initializing"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Avatar

type Avatar struct {
	Name  string `json:"name"`
	Hash  string `json:"hash"`
	Color string `json:"color"`
	Kind  string `json:"kind"`
}

type BindImageLabels

type BindImageLabels struct {
	OP       int     `json:"op"` // add or delete, 默认添加
	LabelIds []int64 `json:"label_ids"`
}

type CallGithubRequest

type CallGithubRequest struct {
	ClientId string `json:"client_id,omitempty"`

	Op    int      `json:"op,omitempty"` // 操作类型
	Repo  string   `json:"repo,omitempty"`
	Repos []string `json:"repos,omitempty"`
}

type CallKubernetesTagRequest

type CallKubernetesTagRequest struct {
	ClientId string `json:"client_id"`
	SyncAll  bool   `json:"sync_all"`
}

type CallMetaRequest

type CallMetaRequest struct {
	Type int    `json:"type"` // 操作类型,必填
	Uid  string `json:"uid"`

	CallGithubRequest        *CallGithubRequest        `json:"callGithubRequest,omitempty"`
	CallKubernetesTagRequest *CallKubernetesTagRequest `json:"callKubernetesTagRequest,omitempty"`
	CallSearchRequest        *CallSearchRequest        `json:"callSearchRequest,omitempty"`
}

type CallResult

type CallResult struct {
	Result     []byte
	ErrMessage string
	StatusCode int
}

type CallSearchRequest

type CallSearchRequest struct {
	ClientId string `json:"client_id" form:"client_id"` // 指定后端执行 clientId

	Hub        string `json:"hub" form:"hub"`
	SearchType int    `json:"search_type" form:"search_type"` // 搜索类型,镜像搜索,kubernetesTag 等
	TargetType int    `json:"target_type" form:"target_type"` // 目标类型,搜索镜像,搜索镜像版本,查询镜像详情

	Namespace  string `json:"namespace" form:"namespace"`
	Repository string `json:"repository" form:"repository"`
	Tag        string `json:"tag" form:"tag"`

	Query    string `json:"query" form:"query"`
	Page     int    `json:"page" form:"page"`
	PageSize int    `json:"page_size" form:"page_size"`

	CustomConfig *SearchCustomConfig `json:"custom_config,omitempty" form:"custom_config,omitempty"`
}

func (*CallSearchRequest) SetDefaultPageOption

func (o *CallSearchRequest) SetDefaultPageOption()

func (*CallSearchRequest) SetNamespace

func (o *CallSearchRequest) SetNamespace()

type Category

type Category struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type ChartDetail

type ChartDetail struct {
	Metadata     ChartMetadata `json:"metadata"`
	Dependencies []Dependency  `json:"dependencies"`
	Values       interface{}   `json:"values"`
	Files        ChartFiles    `json:"files"`
	Security     Security      `json:"security"`
	Labels       []string      `json:"labels"`
}

ChartDetail Chart 详情

type ChartFiles

type ChartFiles struct {
	READMEMD   string `json:"README.md"`
	ValuesYAML string `json:"values.yaml"`
}

ChartFiles Chart 文件

type ChartInfo

type ChartInfo struct {
	Name          string    `json:"name"`
	TotalVersions int       `json:"total_versions"`
	LatestVersion string    `json:"latest_version"`
	Created       time.Time `json:"created"`
	Updated       time.Time `json:"updated"`
	Icon          string    `json:"icon"`
	Home          string    `json:"home"`
	Deprecated    bool      `json:"deprecated"`
}

type ChartMetaRequest

type ChartMetaRequest struct {
	Project string `uri:"project" binding:"required" form:"project"`
	Chart   string `uri:"chart" form:"chart"`
	Version string `uri:"version" form:"version"`
}

type ChartMetadata

type ChartMetadata struct {
	Name         string            `json:"name"`
	Sources      []string          `json:"sources"`
	Version      string            `json:"version"`
	Description  string            `json:"description"`
	Maintainers  []Maintainer      `json:"maintainers"`
	Icon         string            `json:"icon"`
	APIVersion   string            `json:"apiVersion"`
	AppVersion   string            `json:"appVersion"`
	Annotations  map[string]string `json:"annotations"`
	Dependencies []Dependency      `json:"dependencies"`
	Type         string            `json:"type"`
	URLs         []string          `json:"urls"`
	Created      time.Time         `json:"created"`
	Digest       string            `json:"digest"`
}

ChartMetadata Chart 元数据

type ChartSaved

type ChartSaved struct {
	Saved bool `json:"saved"`
}

type ChartVersion

type ChartVersion struct {
	Name         string            `json:"name"`
	Sources      []string          `json:"sources"`
	Version      string            `json:"version"`
	Description  string            `json:"description"`
	Maintainers  []Maintainer      `json:"maintainers"`
	Icon         string            `json:"icon"`
	APIVersion   string            `json:"apiVersion"`
	AppVersion   string            `json:"appVersion"`
	Annotations  map[string]string `json:"annotations"`
	Dependencies []Dependency      `json:"dependencies"`
	Type         string            `json:"type"`
	URLs         []string          `json:"urls"`
	Created      time.Time         `json:"created"`
	Digest       string            `json:"digest"`
	Labels       []string          `json:"labels"`
}

ChartVersion 表示 Chart 的版本信息

type CommonSearchRepositoryResult

type CommonSearchRepositoryResult struct {
	Name         string  `json:"name"`
	Registry     string  `json:"registry"`
	Stars        int     `json:"stars"` //  点赞数
	LastModified int64   `json:"last_modified"`
	Pull         int64   `json:"pull"`        // 下载数量
	IsOfficial   bool    `json:"is_official"` // 在 dockerhub 时生效
	ShortDesc    *string `json:"short_desc"`
}

type CommonSearchTagInfoResult

type CommonSearchTagInfoResult struct {
	Name     string  `json:"name"`
	FullSize int64   `json:"full_size"`
	Digest   string  `json:"digest"`
	Images   []Image `json:"images"`
}

CommonSearchTagInfoResult TODO

type CommonSearchTagResult

type CommonSearchTagResult struct {
	Hub        string      `json:"hub"`
	Namespace  string      `json:"namespace"`
	Repository string      `json:"repository"`
	Total      int         `json:"total"`
	Page       int         `json:"page"`
	PageSize   int         `json:"page_size"`
	TagResult  []CommonTag `json:"tags"`
}

type CommonTag

type CommonTag struct {
	Name           string  `json:"name"`
	Size           int64   `json:"size"`
	LastModified   string  `json:"last_modified"`
	ManifestDigest string  `json:"manifest_digest"`
	Images         []Image `json:"images"` // 可能存在多架构
}

type CreateAccessRequest

type CreateAccessRequest struct {
	UserId     string  `json:"user_id" binding:"required"`
	UserName   string  `json:"user_name"`
	ExpireTime *string `json:"expire_time"`
}

type CreateAgentRequest

type CreateAgentRequest struct {
	AgentName        string `json:"agent_name"`
	Type             string `json:"type"`
	GithubUser       string `json:"github_user"`       // github 后端用户名
	GithubRepository string `json:"github_repository"` // github 仓库地址
	GithubToken      string `json:"github_token"`      // github token
	GithubEmail      string `json:"github_email"`
	RainbowdName     string `json:"rainbowd_name"`
}

type CreateBuildMessageRequest

type CreateBuildMessageRequest struct {
	Id      int64  `json:"id"`
	Message string `json:"message"`
}

type CreateBuildRequest

type CreateBuildRequest struct {
	UserId         string `json:"user_id"`
	Name           string `json:"name"`
	Arch           string `json:"arch"`        // 架构
	Dockerfile     string `json:"dockerfile"`  // 镜像构建 dockerfile
	RegistryId     int64  `json:"registry_id"` // 推送镜像仓库
	AgentName      string `json:"agent_name"`  // 执行代理
	Namespace      string `json:"namespace"`
	Repo           string `json:"repo"` // 构建完成后的镜像名称
	DockerfilePath string `yaml:"dockerfile_path"`
}

type CreateImageRequest

type CreateImageRequest struct {
	TaskId     int64  `json:"task_id"`
	TaskName   string `json:"task_name"`
	UserId     string `json:"user_id"`
	RegisterId int64  `json:"register_id"`
	Name       string `json:"name"`
	Status     string `json:"status"`
	Message    string `json:"message"`
	IsPublic   bool   `json:"is_public"`
	IsLocked   bool   `json:"is_locked"`
	Arch       string `json:"arch"`
}

type CreateImagesRequest

type CreateImagesRequest struct {
	TaskId   int64    `json:"task_id"`
	TaskName string   `json:"task_name"`
	Names    []string `json:"names"`
}

type CreateLabelRequest

type CreateLabelRequest struct {
	Name        string `json:"name" binding:"required"`
	Description string `json:"description"`
}

type CreateLogoRequest

type CreateLogoRequest struct {
	Name string `json:"name" binding:"required"`
}

type CreateNamespaceRequest

type CreateNamespaceRequest struct {
	Name        string `json:"name"`
	Label       string `json:"label"`
	Description string `json:"description"`
}

type CreateNotificationRequest

type CreateNotificationRequest struct {
	UserMetaRequest `json:",inline"`

	Name      string      `json:"name"`
	Role      int         `json:"role"` // 1 管理员 0 普通用户
	Enable    bool        `json:"enable"`
	Type      string      `json:"type"` // 支持 webhook, dingtalk, wecom
	PushCfg   *PushConfig `json:"push_cfg,omitempty"`
	ShortDesc string      `json:"short_desc"`
}

type CreateRegistryRequest

type CreateRegistryRequest struct {
	Name       string `json:"name"`
	UserId     string `json:"user_id"`
	Repository string `json:"repository"`
	Namespace  string `json:"namespace"`
	Username   string `json:"username"`
	Password   string `json:"password"`
	Role       int    `json:"role"`
}

type CreateSubscribeRequest

type CreateSubscribeRequest struct {
	UserMetaRequest `json:",inline"`

	Path       string        `json:"path"`   // 默认会自动填充命名空间,比如 nginx 表示 library/nginx, jenkins/jenkins 则直接使用
	Enable     bool          `json:"enable"` // 启动或者关闭
	Size       int           `json:"size"`   // 同步最新多少个版本, 最多 100 个,普通用户 5
	RegisterId int64         `json:"register_id"`
	Namespace  string        `json:"namespace"`
	Interval   time.Duration `json:"interval"`   // 间隔多久同步一次
	ImageFrom  string        `json:"image_from"` // 镜像来源,支持 dockerhub, gcr, quay.io
	Policy     string        `json:"policy"`     // 默认定义所有版本镜像,支持正则表达式,比如 v1.*
	Arch       string        `json:"arch"`       // 支持的架构,默认不限制  linux/amd64
	Rewrite    bool          `json:"rewrite"`    // 是否覆盖推送
}

type CreateTaskMessageRequest

type CreateTaskMessageRequest struct {
	Id      int64  `json:"id"`
	Message string `json:"message"`
}

type CreateTaskRequest

type CreateTaskRequest struct {
	Name              string   `json:"name"`
	UserId            string   `json:"user_id"`
	UserName          string   `json:"user_name"`
	RegisterId        int64    `json:"register_id"`
	Type              int      `json:"type"` // 0:直接指定镜像列表 1: 指定 kubernetes 版本
	KubernetesVersion string   `json:"kubernetes_version"`
	Images            []string `json:"images"` // 镜像列表中含镜像和架构,格式类似 nginx:1.0.1/amd64,直接指定架构优先级高于任务 arch
	AgentName         string   `json:"agent_name"`
	Mode              int64    `json:"mode"`
	PublicImage       bool     `json:"public_image"`
	Driver            string   `json:"driver"`
	Namespace         string   `json:"namespace"`
	IsOfficial        bool     `json:"is_official"`
	Architecture      string   `json:"architecture"`
	OwnerRef          int      `json:"owner_ref"` // 任务所属,直接创建 0,订阅创建 1
	SubscribeId       int64    `json:"subscribe_id"`
}

type CreateUserRequest

type CreateUserRequest struct {
	Name        string  `json:"name"`
	UserId      string  `json:"user_id"`
	UserType    int     `json:"user_type"` // 个人版,专有版
	PaymentType int     `json:"payment_type"`
	ExpireTime  *string `json:"expire_time"` // payment_type为 0 时无需设置
	RemainCount int     `json:"remain_count"`
	Sync        bool    `json:"sync"`
}

type CreateUsersRequest

type CreateUsersRequest struct {
	Users []CreateUserRequest
}

type CustomMeta

type CustomMeta struct {
	Status       int    `form:"status"`
	Namespace    string `form:"namespace"`
	Agent        string `form:"agent"`
	OwnerRef     string `form:"ownerRef"`
	SubscribeId  int64  `form:"subscribe_id"`
	Project      string `form:"project"`
	AgentStatus  string `form:"agent_status"`
	CustomStatus string `form:"custom_status"`
	LabelIds     string `form:"label_ids"`
	Trusted      int    `form:"trusted"`
	ExtendLimit  int    `form:"extend_limit"`
	Arch         string `form:"arch"`
	AccessKey    string `form:"access_key"`
}

type Dependency

type Dependency struct {
	Name       string `json:"name"`
	Version    string `json:"version"`
	Repository string `json:"repository"`
	Condition  string `json:"condition"`
	Alias      string `json:"alias,omitempty"` // omitempty 表示别名可选
}

Dependency 依赖项

type DingtalkConfig

type DingtalkConfig struct {
	URL string `json:"url"`
}

type DockerToken

type DockerToken struct {
	Token string `json:"token"`
}

type DockerhubSearchTagResult

type DockerhubSearchTagResult struct {
	Name string   `json:"name"`
	Tags []string `json:"tags"`
}

type DownflowMeta

type DownflowMeta struct {
	ImageId   int64  `form:"image_id"`
	StartTime string `form:"startTime"`
	EndTime   string `form:"endTime"`
}

type EmailConfig

type EmailConfig struct {
}

type EnableChartRepoRequest

type EnableChartRepoRequest struct {
	UserId      string `json:"user_id,omitempty"`
	UserName    string `json:"user_name,omitempty"`
	ProjectName string `json:"project_name,omitempty"`
	Password    string `json:"password"`
	Email       string `json:"email"`
	Public      bool   `json:"is_public,omitempty"`
}

type FixImageSpec

type FixImageSpec struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

type FixRequest

type FixRequest struct {
	Type   string       `json:"type"` // 修复资源类型
	UserId string       `json:"user_id"`
	Image  FixImageSpec `json:"image"`
}

type GCRSearchTagResult

type GCRSearchTagResult struct {
	Name string   `json:"name"`
	Tags []string `json:"tags"`
}

type GetRepositoryResult

type GetRepositoryResult struct {
	User              string      `json:"user"`
	Name              string      `json:"name"`
	Namespace         string      `json:"namespace"`
	RepositoryType    string      `json:"repository_type"`
	Status            int         `json:"status"`
	StatusDescription string      `json:"status_description"`
	Description       string      `json:"description"`
	IsPrivate         bool        `json:"is_private"`
	IsAutomated       bool        `json:"is_automated"`
	StarCount         int         `json:"star_count"`
	PullCount         int64       `json:"pull_count"`
	LastUpdated       string      `json:"last_updated"`
	LastModified      string      `json:"last_modified"`
	DateRegistered    string      `json:"date_registered"`
	CollaboratorCount int         `json:"collaborator_count"`
	Affiliation       interface{} `json:"affiliation"` // can be null
	HubUser           string      `json:"hub_user"`
	HasStarred        bool        `json:"has_starred"`
	//FullDescription       string                `json:"full_description"`
	Permissions           Permissions           `json:"permissions"`
	MediaTypes            []string              `json:"media_types"`
	ContentTypes          []string              `json:"content_types"`
	Categories            []Category            `json:"categories"`
	ImmutableTagsSettings ImmutableTagsSettings `json:"immutable_tags_settings"`
	StorageSize           int64                 `json:"storage_size"`
	Source                interface{}           `json:"source"` // can be null
}

type GitHubRepository

type GitHubRepository struct {
	Name     string `json:"name"`
	FullName string `json:"full_name"`
	Private  bool   `json:"private"`
}

type HubSearchResponse

type HubSearchResponse struct {
	Count    int                `json:"count"`
	Next     string             `json:"next"`
	Previous string             `json:"previous"`
	Results  []RepositoryResult `json:"results"`
}

type HubTagResponse

type HubTagResponse struct {
	Count    int         `json:"count"`
	Next     string      `json:"next"`
	Previous string      `json:"previous"` // 可能是 null 或字符串
	Results  []TagResult `json:"results"`
}

type IdMeta

type IdMeta struct {
	ID int64 `uri:"Id" binding:"required"`
}

type IdMetaRequest

type IdMetaRequest struct {
	Id              int64 `json:"id"`
	ResourceVersion int64 `json:"resource_version"`
}

type IdNameMeta

type IdNameMeta struct {
	ID   int64  `uri:"Id" binding:"required" form:"id"`
	Name string `uri:"name" binding:"required" form:"name"`
}

type Image

type Image struct {
	Features     string    `json:"features,omitempty"`
	Variant      *string   `json:"variant,omitempty"` // 可能是 null
	Digest       string    `json:"digest,omitempty"`
	OS           string    `json:"os,omitempty"`
	OSFeatures   string    `json:"os_features,omitempty"`
	OSVersion    *string   `json:"os_version,omitempty"` // 可能是 null
	Size         int64     `json:"size,omitempty"`
	Status       string    `json:"status,omitempty"`
	LastPulled   time.Time `json:"last_pulled,omitempty"`
	LastPushed   time.Time `json:"last_pushed,omitempty"`
	Architecture string    `json:"architecture,omitempty"`
}

type ImageManifest

type ImageManifest struct {
	SchemaVersion int        `json:"schemaVersion"`
	MediaType     string     `json:"mediaType"`
	Manifests     []Manifest `json:"manifests"`
}

type ImageTag

type ImageTag struct {
	Features     string    `json:"features"`
	Variant      *string   `json:"variant"` // 可能是 null
	Digest       string    `json:"digest"`
	OS           string    `json:"os"`
	OSFeatures   string    `json:"os_features"`
	OSVersion    *string   `json:"os_version"` // 可能是 null
	Size         int64     `json:"size"`
	Status       string    `json:"status"`
	LastPulled   time.Time `json:"last_pulled"`
	LastPushed   time.Time `json:"last_pushed"`
	Architecture string    `json:"architecture"`
}

type ImmutableTagsSettings

type ImmutableTagsSettings struct {
	Enabled bool     `json:"enabled"`
	Rules   []string `json:"rules"`
}

type ListOptions

type ListOptions struct {
	CustomMeta `json:",inline"`

	UserMeta `json:",inline"`
	TaskMeta `json:",inline"`

	PageRequest `json:",inline"` // 分页请求属性
	QueryOption `json:",inline"` // 搜索内容
}

ListOptions is the query options to a standard REST list call.

func (*ListOptions) SetDefaultPageOption

func (o *ListOptions) SetDefaultPageOption()

type Maintainer

type Maintainer struct {
	Name  string `json:"name"`
	Email string `json:"email,omitempty"` // omitempty 表示如果 email 为空则不包含在 JSON 中
}

Maintainer 维护者信息

type Manifest

type Manifest struct {
	MediaType string   `json:"mediaType"`
	Size      int      `json:"size"`
	Digest    string   `json:"digest"`
	Platform  Platform `json:"platform"`
}

type NameMeta

type NameMeta struct {
	Namespace string `uri:"namespace" binding:"required" form:"name"`
	Name      string `uri:"name" binding:"required" form:"name"`
}

type Namespace

type Namespace struct {
	Title  string  `json:"title"`
	Kind   string  `json:"kind"`
	Avatar Avatar  `json:"avatar"`
	Name   string  `json:"name"`
	Score  float64 `json:"score"`
	Href   string  `json:"href"`
}

type NotificationResult

type NotificationResult struct {
	Id              int64     `json:"id"`
	GmtCreate       time.Time `json:"gmt_create"`
	GmtModified     time.Time `json:"gmt_modified"`
	ResourceVersion int64     `json:"resource_version"`

	CreateNotificationRequest `json:",inline"`
}

type PageRequest

type PageRequest struct {
	Page  int `form:"page" json:"page"`   // 页数,表示第几页
	Limit int `form:"limit" json:"limit"` // 每页数量,表示每页几个对象
}

PageRequest 分页配置

type PageResult

type PageResult struct {
	PageRequest `json:",inline"`

	Total   int64       `json:"total"`   // 总记录数
	Items   interface{} `json:"items"`   // 数据列表
	Message string      `json:"message"` // 正常或异常信息
}

type Permissions

type Permissions struct {
	Read  bool `json:"read"`
	Write bool `json:"write"`
	Admin bool `json:"admin"`
}

type Platform

type Platform struct {
	Architecture string  `json:"architecture"`
	OS           string  `json:"os"`
	Variant      *string `json:"variant,omitempty"` // 使用指针处理可选字段
	OSVersion    *string `json:"os.version,omitempty"`
}

type PushConfig

type PushConfig struct {
	Webhook  *WebhookConfig  `json:"webhook,omitempty"`
	Dingtalk *DingtalkConfig `json:"dingtalk,omitempty"`
	QiWei    *QiWeiConfig    `json:"qiwei,omitempty"`
	Email    *EmailConfig    `json:"email,omitempty"`
}

func (*PushConfig) Marshal

func (pc *PushConfig) Marshal() (string, error)

func (*PushConfig) Unmarshal

func (pc *PushConfig) Unmarshal(s string) error

type QiWeiConfig

type QiWeiConfig struct {
	URL string `json:"url"`
}

type QuaySearchTagResult

type QuaySearchTagResult struct {
	Tags          []QuayTag `json:"tags"`
	Page          int       `json:"page"`
	HasAdditional bool      `json:"has_additional"`
}

type QuayTag

type QuayTag struct {
	Name           string `json:"name"`
	Reversion      bool   `json:"reversion"`
	StartTS        int64  `json:"start_ts"`
	EndTS          int64  `json:"end_ts"`
	ManifestDigest string `json:"manifest_digest"`
	IsManifestList bool   `json:"is_manifest_list"`
	Size           *int64 `json:"size"` // 使用指针处理可能的null值
	LastModified   string `json:"last_modified"`
}

type QueryOption

type QueryOption struct {
	LabelSelector string `form:"labelSelector" json:"labelSelector"` // 标签搜索
	NameSelector  string `form:"nameSelector" json:"nameSelector"`   // 名称搜索
}

QueryOption 搜索配置

type RemoteMetaRequest

type RemoteMetaRequest struct {
	Type                    int
	Uid                     string `json:"uid"`
	RepositorySearchRequest RemoteSearchRequest
	TagSearchRequest        RemoteTagSearchRequest
	TagInfoSearchRequest    RemoteTagInfoSearchRequest
}

type RemoteSearchRequest

type RemoteSearchRequest struct {
	Hub       string `json:"hub" form:"hub"`
	ClientId  string `json:"client_id" form:"client_id"` // 指定后端执行 clientId
	Namespace string `json:"namespace" form:"namespace"`
	Query     string `json:"query" form:"query"`
	Page      string `json:"page" form:"page"`
	PageSize  string `json:"page_size" form:"page_size"`
}

type RemoteTagInfoSearchRequest

type RemoteTagInfoSearchRequest struct {
	Hub        string `json:"hub" form:"hub"`
	ClientId   string `json:"client_id" form:"client_id"`
	Namespace  string `json:"namespace" form:"namespace"`
	Repository string `json:"repository" form:"repository"`
	Tag        string `json:"tag" form:"tag"`
}

type RemoteTagSearchRequest

type RemoteTagSearchRequest struct {
	Hub        string        `json:"hub" form:"hub"`
	ClientId   string        `json:"client_id" form:"client_id"`
	Namespace  string        `json:"namespace" form:"namespace"`
	Repository string        `json:"repository" form:"repository"` // repo_name <namespace>/<repository_name>
	Query      string        `json:"query" form:"query"`
	Page       int           `json:"page" form:"page"`
	PageSize   int           `json:"page_size" form:"page_size"`
	SearchType int           `json:"search_type" form:"search_type"` // 0 模糊搜索 1 精准查询
	Config     *SearchConfig `json:"config"`
}

type Repository

type Repository struct {
	Kind         string    `json:"kind"`
	Title        string    `json:"title"`
	Namespace    Namespace `json:"namespace"`
	Name         string    `json:"name"`
	Description  *string   `json:"description"` // 使用指针来处理可能的 null 值
	IsPublic     bool      `json:"is_public"`
	Score        float64   `json:"score"`
	Href         string    `json:"href"`
	LastModified int64     `json:"last_modified"`
	Stars        int       `json:"stars"`
	Popularity   int       `json:"popularity"`
}

type RepositoryResult

type RepositoryResult struct {
	RepoName         string `json:"repo_name"`
	ShortDescription string `json:"short_description"`
	StarCount        int    `json:"star_count"`
	PullCount        int64  `json:"pull_count"` // 使用 int64 因为拉取计数可能非常大
	RepoOwner        string `json:"repo_owner"`
	IsAutomated      bool   `json:"is_automated"`
	IsOfficial       bool   `json:"is_official"`
}

type Response

type Response struct {
	Code    int           `json:"code"`              // 返回的状态码
	Result  []model.Image `json:"result,omitempty"`  // 正常返回时的数据,可以为任意数据结构
	Message string        `json:"message,omitempty"` // 异常返回时的错误信息
}

type RunSubscribeRequest

type RunSubscribeRequest struct {
	UserMetaRequest `json:",inline"`

	SubscribeId int64 `json:"subscribe_id"`
}

type SearchConfig

type SearchConfig struct {
	Page      int    `json:"page"`
	Size      int    `json:"size"`
	ImageFrom string `json:"image_from"`
	Policy    string `json:"policy"`
	Arch      string `json:"arch"`
}

type SearchCustomConfig

type SearchCustomConfig struct {
	Policy string `json:"policy"`
	Arch   string `json:"arch"`
}

type SearchDockerhubTagInfoResult

type SearchDockerhubTagInfoResult struct {
	Name                string    `json:"name"`
	Creator             int64     `json:"creator,omitempty"`
	ID                  int64     `json:"id,omitempty"`
	Images              []Image   `json:"images"`
	LastUpdated         time.Time `json:"last_updated"`
	LastUpdater         int64     `json:"last_updater"`
	LastUpdaterUsername string    `json:"last_updater_username"`
	Repository          int64     `json:"repository"`
	FullSize            int64     `json:"full_size"`
	V2                  bool      `json:"v2"`
	TagStatus           string    `json:"tag_status"`
	TagLastPulled       time.Time `json:"tag_last_pulled"`
	TagLastPushed       time.Time `json:"tag_last_pushed"`
	MediaType           string    `json:"media_type"`
	ContentType         string    `json:"content_type"`
	Digest              string    `json:"digest"`
}

type SearchGCRResult

type SearchGCRResult struct {
	Child    []string               `json:"child"`
	Manifest map[string]interface{} `json:"manifest"`
	Name     string                 `json:"name"`
	Tags     []string               `json:"tags"`
}

type SearchQuayResult

type SearchQuayResult struct {
	Results       []Repository `json:"results"`
	HasAdditional bool         `json:"has_additional"`
	Page          int          `json:"page"`
	PageSize      int          `json:"page_size"`
	StartIndex    int          `json:"start_index"`
}

type SearchResult

type SearchResult struct {
	Result     []byte
	ErrMessage string
	StatusCode int
}

type Security

type Security struct {
	Signature SecuritySignature `json:"signature"`
}

type SecuritySignature

type SecuritySignature struct {
	Signed   bool   `json:"signed"`
	ProvFile string `json:"prov_file"`
}

SecuritySignature 安全签名

type SendNotificationRequest

type SendNotificationRequest struct {
	CreateNotificationRequest `json:",inline"`

	Email   string `json:"email"`   // 系统通知,用户注册时使用
	DryRun  bool   `json:"dry_run"` // 测试连通性
	Content string `json:"content"` // 用户通知,用于存储镜像内容
}

type SyncNamespaceRequest

type SyncNamespaceRequest struct {
	Id int64 `json:"id"`

	SyncType int  `json:"sync_type"` // 0 logo 1 label 2 默认logo
	Rewrite  bool `json:"rewrite"`   // 覆盖现有配置
}

type TagResult

type TagResult struct {
	Images              []Image   `json:"images,omitempty"`
	LastUpdated         time.Time `json:"last_updated,omitempty"`
	LastUpdater         int64     `json:"last_updater,omitempty"`
	LastUpdaterUsername string    `json:"last_updater_username,omitempty"`
	Name                string    `json:"name,omitempty"`
	Repository          int64     `json:"repository,omitempty"`
	FullSize            int64     `json:"full_size,omitempty"`
	V2                  bool      `json:"v2,omitempty"`
	TagStatus           string    `json:"tag_status,omitempty"`
	TagLastPulled       time.Time `json:"tag_last_pulled,omitempty"`
	TagLastPushed       time.Time `json:"tag_last_pushed,omitempty"`
	MediaType           string    `json:"media_type,omitempty"`
	ContentType         string    `json:"content_type,omitempty"`
	Digest              string    `json:"digest,omitempty"`
}

type TaskMeta

type TaskMeta struct {
	TaskId int64 `form:"task_id"`
}

type UpdateAgentRequest

type UpdateAgentRequest struct {
	AgentName string `json:"agent_name"`

	GithubUser       string `json:"github_user"`       // github 后端用户名
	GithubRepository string `json:"github_repository"` // github 仓库地址
	GithubToken      string `json:"github_token"`      // github token
	GithubEmail      string `json:"github_email"`
	RainbowdName     string `json:"rainbowd_name"`
}

type UpdateAgentStatusRequest

type UpdateAgentStatusRequest struct {
	AgentName string `json:"agent_name"`
	Status    string `json:"status"`
}

type UpdateBuildRequest

type UpdateBuildRequest struct {
	Id              int64  `json:"id"`
	Status          string `json:"status"`
	ResourceVersion int64  `json:"resource_version"`

	CreateBuildRequest `json:",inline"`
}

type UpdateBuildStatusRequest

type UpdateBuildStatusRequest struct {
	BuildId int64  `json:"build_id"`
	Status  string `json:"status"`
}

type UpdateImageRequest

type UpdateImageRequest struct {
	Id              int64  `json:"id"`
	ResourceVersion int64  `json:"resource_version"`
	Name            string `json:"name"`
	Namespace       string `json:"namespace"`
	Label           string `json:"label"`
	IsPublic        bool   `json:"is_public"`
	Description     string `json:"description"`
	IsLocked        bool   `json:"is_locked"`
}

type UpdateImageStatusRequest

type UpdateImageStatusRequest struct {
	Name       string `json:"name"` // 对应仓里的镜像名称 比如,nginx
	ImageId    int64  `json:"image_id"`
	TaskId     int64  `json:"task_id"`
	RegistryId int64  `json:"registry_id"`
	Status     string `json:"status"`
	Message    string `json:"message"`
	Target     string `json:"target"`
}

type UpdateLabelRequest

type UpdateLabelRequest struct {
	Id              int64  `json:"id"`
	ResourceVersion int64  `json:"resource_version"`
	Name            string `json:"name" binding:"required"`
	Description     string `json:"description"`
}

type UpdateLogoRequest

type UpdateLogoRequest struct {
	Id              int64  `json:"id"`
	ResourceVersion int64  `json:"resource_version"`
	Name            string `json:"name" binding:"required"`
}

type UpdateNamespaceRequest

type UpdateNamespaceRequest struct {
	Id              int64 `json:"id"`
	ResourceVersion int64 `json:"resource_version"`

	Name        string `json:"name"`
	Label       string `json:"label"`
	Description string `json:"description"`
}

type UpdateNotificationRequest

type UpdateNotificationRequest struct {
	IdMetaRequest   `json:",inline"`
	UserMetaRequest `json:",inline"`

	Name      string      `json:"name"`
	Role      int         `json:"role"` // 1 管理员 0 普通用户
	Enable    bool        `json:"enable"`
	Type      string      `json:"type"` // 支持 webhook, dingtalk, wecom
	PushCfg   *PushConfig `json:"push_cfg,omitempty"`
	ShortDesc string      `json:"short_desc"`
}

type UpdateRegistryRequest

type UpdateRegistryRequest struct {
	Id              int64  `json:"id"`
	ResourceVersion int64  `json:"resource_version"`
	Name            string `json:"name"`
	UserId          string `json:"user_id"`
	Repository      string `json:"repository"`
	Namespace       string `json:"namespace"`
	Username        string `json:"username"`
	Password        string `json:"password"`
}

type UpdateSubscribeRequest

type UpdateSubscribeRequest struct {
	Id              int64 `json:"id"`
	ResourceVersion int64 `json:"resource_version"`

	UserMetaRequest `json:",inline"`
	Enable          bool          `json:"enable"`     // 启动或者关闭
	Size            int           `json:"size"`       // 同步最新多少个版本
	Interval        time.Duration `json:"interval"`   // 间隔多久同步一次
	ImageFrom       string        `json:"image_from"` // 镜像来源,支持 dockerhub, gcr, quay.io
	Policy          string        `json:"policy"`     // 默认定义所有版本镜像,支持正则表达式,比如 v1.*
	Arch            string        `json:"arch"`       // 支持的架构,默认不限制  linux/amd64
	Rewrite         bool          `json:"rewrite"`    // 是否覆盖推送
	Namespace       string        `json:"namespace"`
}

type UpdateTaskRequest

type UpdateTaskRequest struct {
	Id                int64    `json:"id"`
	ResourceVersion   int64    `json:"resource_version"`
	Name              string   `json:"name"`
	UserId            string   `json:"user_id"`
	RegisterId        int64    `json:"register_id"`
	Type              int      `json:"type"` // 0:直接指定镜像列表 1: 指定 kubernetes 版本
	KubernetesVersion string   `json:"kubernetes_version"`
	AgentName         string   `json:"agent_name"`
	Status            string   `json:"status"`
	Images            []string `json:"images"`
	Mode              int64    `json:"mode"`
	PublicImage       bool     `json:"public_image"`
	OnlyPushError     bool     `json:"only_push_error"` // 仅同步推送异常
}

type UpdateTaskStatusRequest

type UpdateTaskStatusRequest struct {
	TaskId  int64  `json:"task_id"`
	Status  string `json:"status"`
	Message string `json:"message"`
	Process int    `json:"process"`
}

type UpdateUserRequest

type UpdateUserRequest struct {
	ResourceVersion int64 `json:"resource_version"`

	CreateUserRequest `json:",inline"`
}

type UserMeta

type UserMeta struct {
	UserId string `form:"user_id"`
}

type UserMetaRequest

type UserMetaRequest struct {
	UserId   string `json:"user_id"`
	UserName string `json:"user_name"`
}

type WebhookConfig

type WebhookConfig struct {
	Method string `json:"method"`
	URL    string `json:"url"`
	Header string `json:"header"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL