rainbow

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: 55 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskWaitStatus  = "调度中"
	HuaweiNamespace = "pixiu-public" // pixiuHub 内置默认外部命名空间

	DemandPaymentType  = 0 // 按需付费
	PackagePaymentType = 1 // 包年包月
)
View Source
const (
	BuildWaitStatus = "调度中"
)
View Source
const GitConfig = `` /* 173-byte string literal not displayed */
View Source
const JWTKey = "pixiuHub"

Variables

View Source
var (
	SwrClient  *swr.SwrClient
	RegistryId *int64
)
View Source
var (
	RpcClients map[string]pb.Tunnel_ConnectServer
)

Functions

func ByteSizeSimple

func ByteSizeSimple(bytes int64) string

func DoHttpRequest

func DoHttpRequest(url string) ([]byte, error)

func DoHttpRequestWithHeader

func DoHttpRequestWithHeader(url string, header map[string]string) ([]byte, error)

func KeyFunc

func KeyFunc(key interface{}) (int64, int64, error)

func PaginateCommonTagSlice

func PaginateCommonTagSlice(s []types.CommonTag, page int, pageSize int) []types.CommonTag

func PaginateTagSlice

func PaginateTagSlice(s []string, page int, pageSize int) []string

func ParseImageItem

func ParseImageItem(image string) (string, string, error)

func ValidateArch

func ValidateArch(arch string) error

func WrapNamespace

func WrapNamespace(ns string, user string) string

Types

type AgentController

type AgentController struct {
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent(f db.ShareDaoFactory, cfg rainbowconfig.Config, redisClient *redis.Client) *AgentController

func (*AgentController) CreateAgentReposIfNot

func (s *AgentController) CreateAgentReposIfNot(ctx context.Context, req *types.CallGithubRequest) ([]byte, error)

func (*AgentController) CreateGithubRepo

func (s *AgentController) CreateGithubRepo(ctx context.Context, req *types.CallGithubRequest) ([]byte, error)

func (*AgentController) FilterTagsByArch

func (s *AgentController) FilterTagsByArch(arch string, tags []types.TagResult) []types.TagResult

func (*AgentController) GarbageCollect

func (s *AgentController) GarbageCollect(ctx context.Context) error

func (*AgentController) GetAgentToken

func (s *AgentController) GetAgentToken(ctx context.Context) (string, error)

func (*AgentController) GetDockerRepository

func (s *AgentController) GetDockerRepository(ctx context.Context, req *types.CallSearchRequest) ([]byte, error)

func (*AgentController) GetDockerhubTagInfo

func (s *AgentController) GetDockerhubTagInfo(ctx context.Context, req *types.CallSearchRequest) ([]byte, error)

func (*AgentController) GetGithubRepo

func (s *AgentController) GetGithubRepo(ctx context.Context, req *types.CallGithubRequest) ([]byte, error)

func (*AgentController) GetImageManifest

func (s *AgentController) GetImageManifest(repo string) (types.ImageManifest, error)

func (*AgentController) GetOneAdminRegistry

func (s *AgentController) GetOneAdminRegistry(ctx context.Context) (*model.Registry, error)

func (*AgentController) GetRepository

func (s *AgentController) GetRepository(ctx context.Context, req *types.CallSearchRequest) ([]byte, error)

func (*AgentController) GetRepositoryTagInfo

func (s *AgentController) GetRepositoryTagInfo(ctx context.Context, req *types.CallSearchRequest) ([]byte, error)

func (*AgentController) ProcessGithub

func (s *AgentController) ProcessGithub(ctx context.Context, req *types.CallGithubRequest) ([]byte, error)

func (*AgentController) ProcessKubernetesTags

func (s *AgentController) ProcessKubernetesTags(ctx context.Context, req *types.CallKubernetesTagRequest) ([]byte, error)

func (*AgentController) ProcessSearch

func (s *AgentController) ProcessSearch(ctx context.Context, req *types.CallSearchRequest) ([]byte, error)

func (*AgentController) RegisterAgentIfNotExist

func (s *AgentController) RegisterAgentIfNotExist(ctx context.Context) error

func (*AgentController) Run

func (s *AgentController) Run(ctx context.Context, workers int) error

func (*AgentController) SearchAllRepositories

func (*AgentController) SearchDockerHubRepositories

func (s *AgentController) SearchDockerHubRepositories(ctx context.Context, req *types.CallSearchRequest) ([]types.CommonSearchRepositoryResult, error)

func (*AgentController) SearchDockerhubTags

func (s *AgentController) SearchDockerhubTags(ctx context.Context, req *types.CallSearchRequest) ([]byte, error)

func (*AgentController) SearchGCRTags

func (s *AgentController) SearchGCRTags(ctx context.Context, req types.RemoteTagSearchRequest) ([]byte, error)

func (*AgentController) SearchGCRagInfo

func (s *AgentController) SearchGCRagInfo(ctx context.Context, req types.RemoteTagInfoSearchRequest) ([]byte, error)

func (*AgentController) SearchGcrRepositories

func (*AgentController) SearchQuayRepositories

func (*AgentController) SearchQuayTags

func (s *AgentController) SearchQuayTags(ctx context.Context, req types.RemoteTagSearchRequest) ([]byte, error)

func (*AgentController) SearchRepositories

func (s *AgentController) SearchRepositories(ctx context.Context, req *types.CallSearchRequest) ([]byte, error)

func (*AgentController) SearchRepositoryTags

func (s *AgentController) SearchRepositoryTags(ctx context.Context, req *types.CallSearchRequest) ([]byte, error)

func (*AgentController) Subscribe

type AgentGetter

type AgentGetter interface {
	Agent() Interface
}

type ContainerInfo

type ContainerInfo struct {
	ID           string `json:"ID"`
	Names        string `json:"Names"`
	Image        string `json:"Image"`
	Command      string `json:"Command"`
	CreatedAt    string `json:"CreatedAt"`
	Status       string `json:"Status"`
	Ports        string `json:"Ports"`
	Size         string `json:"Size"`
	Labels       string `json:"Labels"`
	LocalVolumes string `json:"LocalVolumes"`
	Mounts       string `json:"Mounts"`
	Networks     string `json:"Networks"`
}

type DockerHubTag

type DockerHubTag struct {
	sync.RWMutex

	Namespace string
	Repo      string

	Tags   []string
	Result map[string]types.SearchDockerhubTagInfoResult
}

func (*DockerHubTag) GetDigest

func (g *DockerHubTag) GetDigest()

func (*DockerHubTag) GetResults

type GCRTag

type GCRTag struct {
	sync.RWMutex

	Namespace string
	Repo      string

	Tags   []string
	Result map[string]string
	// contains filtered or unexported fields
}

func (*GCRTag) GetResults

func (g *GCRTag) GetResults() map[string]string

type Interface

type Interface interface {
	Run(ctx context.Context, workers int) error

	Subscribe(ctx context.Context, msgs ...*primitive.MessageExt) (consumer.ConsumeResult, error)
}

type NotifyType

type NotifyType struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type PushMessage

type PushMessage struct {
	Text    map[string]string `json:"text"`
	Msgtype string            `json:"msgtype"`
}

type ServerController

type ServerController struct {
	Producer rocketmq.Producer
	// contains filtered or unexported fields
}

func (*ServerController) AddDailyReview

func (s *ServerController) AddDailyReview(ctx context.Context, page string) error

AddDailyReview 单纯做记录,偶尔的报错可忽略

func (*ServerController) AddImageLabel

func (s *ServerController) AddImageLabel(ctx context.Context, imageId int64, labelId int64) error

func (*ServerController) AfterGetImage

func (s *ServerController) AfterGetImage(ctx context.Context, object *model.Image)

AfterGetImage 获取镜像后,尝试更新属性

func (*ServerController) AfterListImages

func (s *ServerController) AfterListImages(ctx context.Context, objects []model.Image, interval time.Duration)

func (*ServerController) AfterUpdateTaskStatus

func (s *ServerController) AfterUpdateTaskStatus(ctx context.Context, req *types.UpdateTaskStatusRequest) error

func (*ServerController) BindImageLabels

func (s *ServerController) BindImageLabels(ctx context.Context, imageId int64, req types.BindImageLabels) error

func (*ServerController) BootstrapAgentContainer

func (s *ServerController) BootstrapAgentContainer(sshConfig *sshutil.SSHConfig, agent *model.Agent) error

func (*ServerController) CalculateImageSize

func (s *ServerController) CalculateImageSize(ctx context.Context, imageId int64) error

func (*ServerController) CalculateUserQuota

func (s *ServerController) CalculateUserQuota(ctx context.Context, imageId int64) error

func (*ServerController) Call

func (s *ServerController) Call(ctx context.Context, clientId string, key string, data []byte) ([]byte, error)

func (*ServerController) Connect

func (s *ServerController) Connect(stream pb.Tunnel_ConnectServer) error

Connect 提供 rpc 注册接口

func (*ServerController) CreateAccess

func (s *ServerController) CreateAccess(ctx context.Context, req *types.CreateAccessRequest) error

func (*ServerController) CreateAgent

func (s *ServerController) CreateAgent(ctx context.Context, req *types.CreateAgentRequest) error

func (*ServerController) CreateAgentRepo

func (s *ServerController) CreateAgentRepo(ctx context.Context, req *types.CallGithubRequest) (interface{}, error)

func (*ServerController) CreateAgentReposIfNot

func (s *ServerController) CreateAgentReposIfNot(ctx context.Context, req *types.CallGithubRequest) error

func (*ServerController) CreateBuild

func (s *ServerController) CreateBuild(ctx context.Context, req *types.CreateBuildRequest) error

func (*ServerController) CreateBuildMessage

func (s *ServerController) CreateBuildMessage(ctx context.Context, req types.CreateBuildMessageRequest) error

func (*ServerController) CreateImage

func (s *ServerController) CreateImage(ctx context.Context, req *types.CreateImageRequest) error

func (*ServerController) CreateImageWithTag

func (s *ServerController) CreateImageWithTag(ctx context.Context, taskId int64, req *types.CreateTaskRequest) error

func (*ServerController) CreateImages

func (s *ServerController) CreateImages(ctx context.Context, req *types.CreateImagesRequest) ([]model.Image, error)

func (*ServerController) CreateLabel

func (s *ServerController) CreateLabel(ctx context.Context, req *types.CreateLabelRequest) error
func (s *ServerController) CreateLogo(ctx context.Context, req *types.CreateLogoRequest) error

func (*ServerController) CreateNamespace

func (s *ServerController) CreateNamespace(ctx context.Context, req *types.CreateNamespaceRequest) error

func (*ServerController) CreateNotify

func (*ServerController) CreateOrUpdateUser

func (s *ServerController) CreateOrUpdateUser(ctx context.Context, user *types.CreateUserRequest) error

func (*ServerController) CreateOrUpdateUsers

func (s *ServerController) CreateOrUpdateUsers(ctx context.Context, req *types.CreateUsersRequest) error

func (*ServerController) CreateProjectMember

func (s *ServerController) CreateProjectMember(ctx context.Context, req *types.EnableChartRepoRequest) error

func (*ServerController) CreateRegistry

func (s *ServerController) CreateRegistry(ctx context.Context, req *types.CreateRegistryRequest) error

func (*ServerController) CreateRepoProject

func (s *ServerController) CreateRepoProject(ctx context.Context, projectName string, public bool) error

func (*ServerController) CreateRepoUser

func (s *ServerController) CreateRepoUser(ctx context.Context, req *types.EnableChartRepoRequest) error

func (*ServerController) CreateSubscribe

func (s *ServerController) CreateSubscribe(ctx context.Context, req *types.CreateSubscribeRequest) error

func (*ServerController) CreateSubscribeMessageAndFailTimesAdd

func (s *ServerController) CreateSubscribeMessageAndFailTimesAdd(ctx context.Context, sub model.Subscribe, msg string)

func (*ServerController) CreateSubscribeMessageWithLog

func (s *ServerController) CreateSubscribeMessageWithLog(ctx context.Context, sub model.Subscribe, msg string)

func (*ServerController) CreateTask

func (s *ServerController) CreateTask(ctx context.Context, req *types.CreateTaskRequest) error

func (*ServerController) CreateTaskMessage

func (s *ServerController) CreateTaskMessage(ctx context.Context, req types.CreateTaskMessageRequest) error

func (*ServerController) CreateTaskMessages

func (s *ServerController) CreateTaskMessages(ctx context.Context, taskId int64, messages ...string)

CreateTaskMessages 批量创建同步消息

func (*ServerController) CreateTaskV2

func (s *ServerController) CreateTaskV2(ctx *gin.Context, req *types.CreateTaskRequest) error

func (*ServerController) CreateUser

func (s *ServerController) CreateUser(ctx context.Context, req *types.CreateUserRequest) error

func (*ServerController) DeleteAccess

func (s *ServerController) DeleteAccess(ctx context.Context, ak string) error

func (*ServerController) DeleteAgent

func (s *ServerController) DeleteAgent(ctx context.Context, agentId int64) error

DeleteAgent 删除已注册的agent信息

func (*ServerController) DeleteBuild

func (s *ServerController) DeleteBuild(ctx context.Context, buildId int64) error

func (*ServerController) DeleteChart

func (s *ServerController) DeleteChart(ctx context.Context, chartReq types.ChartMetaRequest) error

func (*ServerController) DeleteChartTag

func (s *ServerController) DeleteChartTag(ctx context.Context, chartReq types.ChartMetaRequest) error

func (*ServerController) DeleteImage

func (s *ServerController) DeleteImage(ctx context.Context, imageId int64) error

DeleteImage 删除镜像和对应的tags

func (*ServerController) DeleteImageLabel

func (s *ServerController) DeleteImageLabel(ctx context.Context, imageId int64, labelId int64) error

func (*ServerController) DeleteImageTag

func (s *ServerController) DeleteImageTag(ctx context.Context, imageId int64, tagId int64) error

func (*ServerController) DeleteImagesByIds

func (s *ServerController) DeleteImagesByIds(ctx context.Context, ids []int64) error

func (*ServerController) DeleteLabel

func (s *ServerController) DeleteLabel(ctx context.Context, labelId int64) error
func (s *ServerController) DeleteLogo(ctx context.Context, logoId int64) error

func (*ServerController) DeleteNamespace

func (s *ServerController) DeleteNamespace(ctx context.Context, objectId int64) error

func (*ServerController) DeleteNotify

func (s *ServerController) DeleteNotify(ctx context.Context, notifyId int64) error

func (*ServerController) DeleteRegistry

func (s *ServerController) DeleteRegistry(ctx context.Context, registryId int64) error

func (*ServerController) DeleteSubscribe

func (s *ServerController) DeleteSubscribe(ctx context.Context, subId int64) error

DeleteSubscribe 删除订阅 1. 删除订阅 2. 删除订阅记录 3. 删除订阅关联的同步任务

func (*ServerController) DeleteTask

func (s *ServerController) DeleteTask(ctx context.Context, taskId int64) error

func (*ServerController) DeleteTaskWithImages

func (s *ServerController) DeleteTaskWithImages(ctx context.Context, taskId int64) error

func (*ServerController) DeleteTasksByIds

func (s *ServerController) DeleteTasksByIds(ctx context.Context, ids []int64) error

func (*ServerController) DeleteUser

func (s *ServerController) DeleteUser(ctx context.Context, userId string) error

func (*ServerController) DisableAndDeleteChartRepo

func (s *ServerController) DisableAndDeleteChartRepo(ctx context.Context, req *types.EnableChartRepoRequest) error

func (*ServerController) DisableSubscribeWithMessage

func (s *ServerController) DisableSubscribeWithMessage(ctx context.Context, sub model.Subscribe, msg string)

func (*ServerController) Downflow

func (s *ServerController) Downflow(ctx context.Context) (interface{}, error)

func (*ServerController) DownloadChart

func (s *ServerController) DownloadChart(ctx *gin.Context, chartReq types.ChartMetaRequest) (string, string, error)

func (*ServerController) EnableChartRepo

func (s *ServerController) EnableChartRepo(ctx context.Context, req *types.EnableChartRepoRequest) error

EnableChartRepo 1. 初始化项目 2. 创建用户 3. 关联用户到项目

func (*ServerController) EnableChartRepo2

func (s *ServerController) EnableChartRepo2(ctx context.Context, req *types.EnableChartRepoRequest) error

DEPRECATED

func (*ServerController) EnableNotify

func (*ServerController) Fix

func (s *ServerController) Fix(ctx context.Context, req *types.FixRequest) (interface{}, error)

func (*ServerController) GetAgent

func (s *ServerController) GetAgent(ctx context.Context, agentId int64) (interface{}, error)

func (*ServerController) GetAgentContainer

func (s *ServerController) GetAgentContainer(sshConfig *sshutil.SSHConfig, containerName string) (*ContainerInfo, error)

func (*ServerController) GetBuild

func (s *ServerController) GetBuild(ctx context.Context, buildId int64) (interface{}, error)

func (*ServerController) GetChartStatus

func (s *ServerController) GetChartStatus(ctx context.Context, req *types.ChartMetaRequest) (interface{}, error)

func (*ServerController) GetChartTag

func (s *ServerController) GetChartTag(ctx context.Context, chartReq types.ChartMetaRequest) (interface{}, error)

func (*ServerController) GetCollection

func (s *ServerController) GetCollection(ctx context.Context, listOption types.ListOptions) (interface{}, error)
func (s *ServerController) GetDefaultLogo(ctx context.Context) (string, error)

func (*ServerController) GetImage

func (s *ServerController) GetImage(ctx context.Context, imageId int64) (interface{}, error)

func (*ServerController) GetImageTag

func (s *ServerController) GetImageTag(ctx context.Context, imageId int64, tagId int64) (interface{}, error)

func (*ServerController) GetNotify

func (s *ServerController) GetNotify(ctx context.Context, notifyId int64) (interface{}, error)

func (*ServerController) GetNotifyTypes

func (s *ServerController) GetNotifyTypes(ctx context.Context) (interface{}, error)

func (*ServerController) GetRegistry

func (s *ServerController) GetRegistry(ctx context.Context, registryId int64) (interface{}, error)

func (*ServerController) GetRepository

func (*ServerController) GetRepositoryTagInfo

func (s *ServerController) GetRepositoryTagInfo(ctx context.Context, req types.CallSearchRequest) (interface{}, error)

func (*ServerController) GetResult

func (s *ServerController) GetResult(ctx context.Context, key string) (string, error)

func (*ServerController) GetSubscribe

func (s *ServerController) GetSubscribe(ctx context.Context, subId int64) (interface{}, error)

func (*ServerController) GetTask

func (s *ServerController) GetTask(ctx context.Context, taskId int64) (interface{}, error)

func (*ServerController) GetToken

func (s *ServerController) GetToken(ctx context.Context, req *types.ChartMetaRequest) (interface{}, error)

func (*ServerController) GetUser

func (s *ServerController) GetUser(ctx context.Context, userId string) (*model.User, error)

func (*ServerController) GetUserInfoByAccessKey

func (s *ServerController) GetUserInfoByAccessKey(ctx *gin.Context, listOption types.ListOptions) (*model.User, error)

func (*ServerController) HandlerSearchRepositoryTags

func (s *ServerController) HandlerSearchRepositoryTags(ctx context.Context, sub *model.Subscribe, err error) error

func (*ServerController) ImageDownflow

func (s *ServerController) ImageDownflow(ctx context.Context, downflowMeta types.DownflowMeta) (interface{}, error)

func (*ServerController) InstallAgentContainer

func (s *ServerController) InstallAgentContainer(sshConfig *sshutil.SSHConfig, agent *model.Agent) error

func (*ServerController) IsAgentRunningStatus

func (s *ServerController) IsAgentRunningStatus(status string) bool

func (*ServerController) IsRainbowReachable

func (s *ServerController) IsRainbowReachable(sshConfig *sshutil.SSHConfig, nodeName string) bool

func (*ServerController) ListAccesses

func (s *ServerController) ListAccesses(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListAgents

func (s *ServerController) ListAgents(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListArchitectures

func (s *ServerController) ListArchitectures(ctx context.Context, listOption types.ListOptions) ([]string, error)

func (*ServerController) ListBuildMessages

func (s *ServerController) ListBuildMessages(ctx context.Context, buildId int64) (interface{}, error)

func (*ServerController) ListBuilds

func (s *ServerController) ListBuilds(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListChartTags

func (s *ServerController) ListChartTags(ctx context.Context, chartReq types.ChartMetaRequest, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListCharts

func (s *ServerController) ListCharts(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListImageLabels

func (s *ServerController) ListImageLabels(ctx context.Context, imageId int64, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListImageTags

func (s *ServerController) ListImageTags(ctx context.Context, imageId int64, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListImages

func (s *ServerController) ListImages(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListImagesByIds

func (s *ServerController) ListImagesByIds(ctx context.Context, ids []int64) (interface{}, error)

func (*ServerController) ListImagesForClient

func (s *ServerController) ListImagesForClient(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListKubernetesVersions

func (s *ServerController) ListKubernetesVersions(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListLabelImages

func (s *ServerController) ListLabelImages(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListLabels

func (s *ServerController) ListLabels(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListLogos

func (s *ServerController) ListLogos(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListMetrics

func (s *ServerController) ListMetrics(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListNamespaces

func (s *ServerController) ListNamespaces(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListNotifies

func (s *ServerController) ListNotifies(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListRainbowds

func (s *ServerController) ListRainbowds(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListRegistries

func (s *ServerController) ListRegistries(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListSubscribeMessages

func (s *ServerController) ListSubscribeMessages(ctx context.Context, subId int64) (interface{}, error)

func (*ServerController) ListSubscribes

func (s *ServerController) ListSubscribes(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListTaskImages

func (s *ServerController) ListTaskImages(ctx context.Context, taskId int64, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListTaskMessages

func (s *ServerController) ListTaskMessages(ctx context.Context, taskId int64) (interface{}, error)

func (*ServerController) ListTasks

func (s *ServerController) ListTasks(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) ListTasksByIds

func (s *ServerController) ListTasksByIds(ctx context.Context, ids []int64) (interface{}, error)

func (*ServerController) ListUsers

func (s *ServerController) ListUsers(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) LoginRegistry

func (s *ServerController) LoginRegistry(ctx context.Context, req *types.CreateRegistryRequest) error

func (*ServerController) Overview

func (s *ServerController) Overview(ctx context.Context) (interface{}, error)

func (*ServerController) ReRunTask

func (s *ServerController) ReRunTask(ctx context.Context, req *types.UpdateTaskRequest) error

func (*ServerController) ReconcileAgent

func (s *ServerController) ReconcileAgent(ctx context.Context, sshConfig *sshutil.SSHConfig, agent *model.Agent) error

func (*ServerController) RegisterRainbowd

func (s *ServerController) RegisterRainbowd(ctx context.Context) error

func (*ServerController) RemoveAgentContainer

func (s *ServerController) RemoveAgentContainer(sshConfig *sshutil.SSHConfig, agent *model.Agent) error

func (*ServerController) ResetAgentMetadata

func (s *ServerController) ResetAgentMetadata(sshConfig *sshutil.SSHConfig, agent *model.Agent) error

func (*ServerController) RestartAgentContainer

func (s *ServerController) RestartAgentContainer(sshConfig *sshutil.SSHConfig, agent *model.Agent) error

func (*ServerController) Run

func (s *ServerController) Run(ctx context.Context, workers int) error

func (*ServerController) RunAgentContainer

func (s *ServerController) RunAgentContainer(sshConfig *sshutil.SSHConfig, agent *model.Agent) error

func (*ServerController) RunSubscribe

func (s *ServerController) RunSubscribe(ctx context.Context, req *types.RunSubscribeRequest) error

func (*ServerController) SearchImages

func (s *ServerController) SearchImages(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) SearchPublicImages

func (s *ServerController) SearchPublicImages(ctx context.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) SearchPublicImagesWithLabel

func (s *ServerController) SearchPublicImagesWithLabel(ctx context.Context, labelIds []int64, listOption types.ListOptions) (interface{}, error)

func (*ServerController) SearchRepo

func (s *ServerController) SearchRepo(ctx *gin.Context, listOption types.ListOptions) (interface{}, error)

func (*ServerController) SearchRepositories

func (s *ServerController) SearchRepositories(ctx context.Context, req types.CallSearchRequest) (interface{}, error)

func (*ServerController) SearchRepositoryTags

func (s *ServerController) SearchRepositoryTags(ctx context.Context, req types.CallSearchRequest) (interface{}, error)

func (*ServerController) SendNotify

func (*ServerController) SendNotifyByType

func (s *ServerController) SendNotifyByType(ctx context.Context, req *types.SendNotificationRequest) error

func (*ServerController) StartAgentContainer

func (s *ServerController) StartAgentContainer(sshConfig *sshutil.SSHConfig, agent *model.Agent) error

func (*ServerController) Stop

func (s *ServerController) Stop(ctx context.Context)

func (*ServerController) StopAgentContainer

func (s *ServerController) StopAgentContainer(sshConfig *sshutil.SSHConfig, agent *model.Agent) error

func (*ServerController) Store

func (s *ServerController) Store(ctx context.Context) (interface{}, error)

func (*ServerController) SyncAgentRepos

func (s *ServerController) SyncAgentRepos(ctx context.Context, req *types.CallGithubRequest) error

func (*ServerController) SyncInfoByRemoteImage

func (s *ServerController) SyncInfoByRemoteImage(ctx context.Context, object *model.Image) error

SyncInfoByRemoteImage 获取远端镜像属性且保存

func (*ServerController) SyncKubernetesTags

func (s *ServerController) SyncKubernetesTags(ctx context.Context, req *types.CallKubernetesTagRequest) (interface{}, error)

func (*ServerController) SyncNamespace

func (s *ServerController) SyncNamespace(ctx context.Context, req *types.SyncNamespaceRequest) error

func (*ServerController) TryUpdateRemotePublic

func (s *ServerController) TryUpdateRemotePublic(ctx context.Context, req *types.UpdateImageStatusRequest, old *model.Image) error

TryUpdateRemotePublic 更新内置标准镜像仓库为 public

func (*ServerController) UninstallAgentContainer

func (s *ServerController) UninstallAgentContainer(sshConfig *sshutil.SSHConfig, agent *model.Agent) error

func (*ServerController) UpdateAgent

func (s *ServerController) UpdateAgent(ctx context.Context, req *types.UpdateAgentRequest) error

func (*ServerController) UpdateAgentStatus

func (s *ServerController) UpdateAgentStatus(ctx context.Context, req *types.UpdateAgentStatusRequest) error

func (*ServerController) UpdateBuild

func (s *ServerController) UpdateBuild(ctx context.Context, req *types.UpdateBuildRequest) error

func (*ServerController) UpdateBuildStatus

func (s *ServerController) UpdateBuildStatus(ctx context.Context, req *types.UpdateBuildStatusRequest) error

func (*ServerController) UpdateImage

func (s *ServerController) UpdateImage(ctx context.Context, req *types.UpdateImageRequest) error

func (*ServerController) UpdateImageInfoFromRemote

func (s *ServerController) UpdateImageInfoFromRemote(ctx context.Context, newImage *swrmodel.ShowRepositoryResponse, old *model.Image) error

func (*ServerController) UpdateImageStatus

func (s *ServerController) UpdateImageStatus(ctx context.Context, req *types.UpdateImageStatusRequest) error

func (*ServerController) UpdateLabel

func (s *ServerController) UpdateLabel(ctx context.Context, req *types.UpdateLabelRequest) error
func (s *ServerController) UpdateLogo(ctx context.Context, req *types.UpdateLogoRequest) error

func (*ServerController) UpdateNamespace

func (s *ServerController) UpdateNamespace(ctx context.Context, req *types.UpdateNamespaceRequest) error

func (*ServerController) UpdateNotify

func (*ServerController) UpdateRegistry

func (s *ServerController) UpdateRegistry(ctx context.Context, req *types.UpdateRegistryRequest) error

func (*ServerController) UpdateSubscribe

func (s *ServerController) UpdateSubscribe(ctx context.Context, req *types.UpdateSubscribeRequest) error

func (*ServerController) UpdateTagFromRemote

func (s *ServerController) UpdateTagFromRemote(ctx context.Context, newTag swrmodel.ShowReposTagResp, oldTag model.Tag) error

func (*ServerController) UpdateTask

func (s *ServerController) UpdateTask(ctx context.Context, req *types.UpdateTaskRequest) error

func (*ServerController) UpdateTaskStatus

func (s *ServerController) UpdateTaskStatus(ctx context.Context, req *types.UpdateTaskStatusRequest) error

func (*ServerController) UpdateUser

func (s *ServerController) UpdateUser(ctx context.Context, req *types.UpdateUserRequest) error

func (*ServerController) UpgradeAgentBinaryContainer

func (s *ServerController) UpgradeAgentBinaryContainer(sshConfig *sshutil.SSHConfig, agent *model.Agent) error

UpgradeAgentBinaryContainer 先停止 agent 容器,然后替换 agent 二进制文件 然后启动 agent 容器

func (*ServerController) UploadChart

func (s *ServerController) UploadChart(ctx *gin.Context, chartReq types.ChartMetaRequest) error

func (*ServerController) ValidateSubscribeSize

func (s *ServerController) ValidateSubscribeSize(ctx context.Context, size int, userId string) error

func (*ServerController) ValidateToken

func (s *ServerController) ValidateToken(ctx *gin.Context) error

type ServerGetter

type ServerGetter interface {
	Server() ServerInterface
}

type ServerInterface

type ServerInterface interface {
	CreateRegistry(ctx context.Context, req *types.CreateRegistryRequest) error
	UpdateRegistry(ctx context.Context, req *types.UpdateRegistryRequest) error
	DeleteRegistry(ctx context.Context, registryId int64) error
	GetRegistry(ctx context.Context, registryId int64) (interface{}, error)
	ListRegistries(ctx context.Context, listOption types.ListOptions) (interface{}, error)

	LoginRegistry(ctx context.Context, req *types.CreateRegistryRequest) error

	CreateTask(ctx context.Context, req *types.CreateTaskRequest) error
	UpdateTask(ctx context.Context, req *types.UpdateTaskRequest) error
	ListTasks(ctx context.Context, listOption types.ListOptions) (interface{}, error)
	DeleteTask(ctx context.Context, taskId int64) error
	GetTask(ctx context.Context, taskId int64) (interface{}, error)
	UpdateTaskStatus(ctx context.Context, req *types.UpdateTaskStatusRequest) error

	CreateTaskV2(ctx *gin.Context, req *types.CreateTaskRequest) error

	CreateSubscribe(ctx context.Context, req *types.CreateSubscribeRequest) error
	ListSubscribes(ctx context.Context, listOption types.ListOptions) (interface{}, error)
	UpdateSubscribe(ctx context.Context, req *types.UpdateSubscribeRequest) error
	DeleteSubscribe(ctx context.Context, subId int64) error
	GetSubscribe(ctx context.Context, subId int64) (interface{}, error)

	ListSubscribeMessages(ctx context.Context, subId int64) (interface{}, error)

	RunSubscribe(ctx context.Context, req *types.RunSubscribeRequest) error

	ListTaskImages(ctx context.Context, taskId int64, listOption types.ListOptions) (interface{}, error)
	ReRunTask(ctx context.Context, req *types.UpdateTaskRequest) error

	ListTasksByIds(ctx context.Context, ids []int64) (interface{}, error)
	DeleteTasksByIds(ctx context.Context, ids []int64) error

	CreateAgent(ctx context.Context, req *types.CreateAgentRequest) error
	UpdateAgent(ctx context.Context, req *types.UpdateAgentRequest) error
	DeleteAgent(ctx context.Context, agentId int64) error
	GetAgent(ctx context.Context, agentId int64) (interface{}, error)
	ListAgents(ctx context.Context, listOption types.ListOptions) (interface{}, error)
	UpdateAgentStatus(ctx context.Context, req *types.UpdateAgentStatusRequest) error

	CreateAgentRepo(ctx context.Context, req *types.CallGithubRequest) (interface{}, error)
	SyncAgentRepos(ctx context.Context, req *types.CallGithubRequest) error

	CreateImage(ctx context.Context, req *types.CreateImageRequest) error
	UpdateImage(ctx context.Context, req *types.UpdateImageRequest) error
	DeleteImage(ctx context.Context, imageId int64) error
	GetImage(ctx context.Context, imageId int64) (interface{}, error)
	ListImages(ctx context.Context, listOption types.ListOptions) (interface{}, error)

	ListImagesForClient(ctx context.Context, listOption types.ListOptions) (interface{}, error)

	ListImageTags(ctx context.Context, imageId int64, listOption types.ListOptions) (interface{}, error)

	ListImagesByIds(ctx context.Context, ids []int64) (interface{}, error)
	DeleteImagesByIds(ctx context.Context, ids []int64) error

	SearchImages(ctx context.Context, listOption types.ListOptions) (interface{}, error)

	UpdateImageStatus(ctx context.Context, req *types.UpdateImageStatusRequest) error
	CreateImages(ctx context.Context, req *types.CreateImagesRequest) ([]model.Image, error)
	DeleteImageTag(ctx context.Context, imageId int64, TagId int64) error
	GetImageTag(ctx context.Context, imageId int64, tagId int64) (interface{}, error)

	BindImageLabels(ctx context.Context, imageId int64, req types.BindImageLabels) error
	ListImageLabels(ctx context.Context, imageId int64, listOption types.ListOptions) (interface{}, error)

	GetCollection(ctx context.Context, listOption types.ListOptions) (interface{}, error)
	AddDailyReview(ctx context.Context, page string) error

	CreateLabel(ctx context.Context, req *types.CreateLabelRequest) error
	DeleteLabel(ctx context.Context, labelId int64) error
	UpdateLabel(ctx context.Context, req *types.UpdateLabelRequest) error
	ListLabels(ctx context.Context, listOption types.ListOptions) (interface{}, error)

	ListLabelImages(ctx context.Context, listOption types.ListOptions) (interface{}, error)

	ListLogos(ctx context.Context, listOption types.ListOptions) (interface{}, error)

	CreateNamespace(ctx context.Context, req *types.CreateNamespaceRequest) error
	UpdateNamespace(ctx context.Context, req *types.UpdateNamespaceRequest) error
	DeleteNamespace(ctx context.Context, objectId int64) error
	ListNamespaces(ctx context.Context, listOption types.ListOptions) (interface{}, error)

	SyncNamespace(ctx context.Context, req *types.SyncNamespaceRequest) error

	Overview(ctx context.Context) (interface{}, error)
	Downflow(ctx context.Context) (interface{}, error)
	Store(ctx context.Context) (interface{}, error)
	ImageDownflow(ctx context.Context, downflowMeta types.DownflowMeta) (interface{}, error)

	SearchRepositories(ctx context.Context, req types.CallSearchRequest) (interface{}, error)
	SearchRepositoryTags(ctx context.Context, req types.CallSearchRequest) (interface{}, error)
	GetRepositoryTagInfo(ctx context.Context, req types.CallSearchRequest) (interface{}, error)

	CreateTaskMessage(ctx context.Context, req types.CreateTaskMessageRequest) error
	ListTaskMessages(ctx context.Context, taskId int64) (interface{}, error)

	ListArchitectures(ctx context.Context, listOption types.ListOptions) ([]string, error)

	CreateUser(ctx context.Context, req *types.CreateUserRequest) error
	UpdateUser(ctx context.Context, req *types.UpdateUserRequest) error
	ListUsers(ctx context.Context, listOption types.ListOptions) (interface{}, error)
	GetUser(ctx context.Context, userId string) (*model.User, error)
	DeleteUser(ctx context.Context, userId string) error

	CreateOrUpdateUsers(ctx context.Context, req *types.CreateUsersRequest) error
	GetUserInfoByAccessKey(ctx *gin.Context, listOption types.ListOptions) (*model.User, error)

	CreateNotify(ctx context.Context, req *types.CreateNotificationRequest) error
	UpdateNotify(ctx context.Context, req *types.UpdateNotificationRequest) error
	GetNotify(ctx context.Context, notifyId int64) (interface{}, error)
	DeleteNotify(ctx context.Context, notifyId int64) error
	ListNotifies(ctx context.Context, listOption types.ListOptions) (interface{}, error)
	SendNotify(ctx context.Context, req *types.SendNotificationRequest) error

	EnableNotify(ctx context.Context, req *types.UpdateNotificationRequest) error
	GetNotifyTypes(ctx context.Context) (interface{}, error)

	ListKubernetesVersions(ctx context.Context, listOption types.ListOptions) (interface{}, error)
	SyncKubernetesTags(ctx context.Context, req *types.CallKubernetesTagRequest) (interface{}, error)

	ListRainbowds(ctx context.Context, listOption types.ListOptions) (interface{}, error)

	Fix(ctx context.Context, req *types.FixRequest) (interface{}, error)

	// EnableChartRepo Chart Repo API
	EnableChartRepo(ctx context.Context, req *types.EnableChartRepoRequest) error
	ListCharts(ctx context.Context, listOption types.ListOptions) (interface{}, error)
	DeleteChart(ctx context.Context, req types.ChartMetaRequest) error
	ListChartTags(ctx context.Context, req types.ChartMetaRequest, listOption types.ListOptions) (interface{}, error)
	GetChartTag(ctx context.Context, req types.ChartMetaRequest) (interface{}, error)
	DeleteChartTag(ctx context.Context, req types.ChartMetaRequest) error
	UploadChart(ctx *gin.Context, chartReq types.ChartMetaRequest) error
	DownloadChart(ctx *gin.Context, chartReq types.ChartMetaRequest) (string, string, error)

	GetChartStatus(ctx context.Context, req *types.ChartMetaRequest) (interface{}, error)

	GetToken(ctx context.Context, req *types.ChartMetaRequest) (interface{}, error)

	// CreateBuild 镜像构建 API
	CreateBuild(ctx context.Context, req *types.CreateBuildRequest) error
	DeleteBuild(ctx context.Context, buildId int64) error
	UpdateBuild(ctx context.Context, req *types.UpdateBuildRequest) error
	ListBuilds(ctx context.Context, listOption types.ListOptions) (interface{}, error)
	GetBuild(ctx context.Context, buildId int64) (interface{}, error)
	CreateBuildMessage(ctx context.Context, req types.CreateBuildMessageRequest) error
	ListBuildMessages(ctx context.Context, buildId int64) (interface{}, error)
	UpdateBuildStatus(ctx context.Context, req *types.UpdateBuildStatusRequest) error

	ListMetrics(ctx context.Context, listOption types.ListOptions) (interface{}, error)

	CreateAccess(ctx context.Context, req *types.CreateAccessRequest) error
	DeleteAccess(ctx context.Context, ak string) error
	ListAccesses(ctx context.Context, listOption types.ListOptions) (interface{}, error)

	SearchRepo(ctx *gin.Context, listOption types.ListOptions) (interface{}, error)

	Run(ctx context.Context, workers int) error
	Stop(ctx context.Context)
}

type Tag

type Tag struct {
	Name string `json:"name"`
}

type UsageData

type UsageData struct {
	UsageItems []UsageItem `json:"usageItems"`
}

type UsageItem

type UsageItem struct {
	Date           time.Time `json:"date"`
	Product        string    `json:"product"`
	SKU            string    `json:"sku"`
	Quantity       float64   `json:"quantity"`
	UnitType       string    `json:"unitType"`
	PricePerUnit   float64   `json:"pricePerUnit"`
	GrossAmount    float64   `json:"grossAmount"`
	DiscountAmount float64   `json:"discountAmount"`
	NetAmount      float64   `json:"netAmount"`
	RepositoryName string    `json:"repositoryName"`
}

Jump to

Keyboard shortcuts

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