Documentation ¶
Index ¶
- Constants
- Variables
- func CacheKeyAllBranches[T ~string | ~int | ~int64](pid T) contracts.CacheKeyInterface
- func CacheKeyAllProjects() contracts.CacheKeyInterface
- func GetPlugins() map[string]contracts.PluginInterface
- func RegisterPlugin(name string, pluginInterface contracts.PluginInterface)
- type DomainManager
- type EmptyPubSub
- func (e *EmptyPubSub) Close() error
- func (e *EmptyPubSub) ID() string
- func (e *EmptyPubSub) Info() any
- func (e *EmptyPubSub) Join(projectID int64) error
- func (e *EmptyPubSub) Leave(nsID int64, projectID int64) error
- func (e *EmptyPubSub) Publish(nsID int64, pod *v1.Pod) error
- func (e *EmptyPubSub) Run(ctx context.Context) error
- func (e *EmptyPubSub) Subscribe() <-chan []byte
- func (e *EmptyPubSub) ToAll(message contracts.WebsocketMessage) error
- func (e *EmptyPubSub) ToOthers(message contracts.WebsocketMessage) error
- func (e *EmptyPubSub) ToSelf(message contracts.WebsocketMessage) error
- func (e *EmptyPubSub) Uid() string
- type GitCacheServer
- type GitServer
- type PictureInterface
- type WsSender
Constants ¶
View Source
const ( ToSelf = websocket_pb.To_ToSelf ToAll = websocket_pb.To_ToAll ToOthers = websocket_pb.To_ToOthers )
Variables ¶
Functions ¶
func CacheKeyAllBranches ¶
func CacheKeyAllBranches[T ~string | ~int | ~int64](pid T) contracts.CacheKeyInterface
func CacheKeyAllProjects ¶
func CacheKeyAllProjects() contracts.CacheKeyInterface
func GetPlugins ¶
func GetPlugins() map[string]contracts.PluginInterface
GetPlugins get all registered plugins.
func RegisterPlugin ¶
func RegisterPlugin(name string, pluginInterface contracts.PluginInterface)
RegisterPlugin register plugin.
Types ¶
type DomainManager ¶
type DomainManager interface { contracts.PluginInterface // GetDomainByIndex domainSuffix: test.com, project: mars, namespace: default index: 0,1,2..., preOccupiedLen: 预占用的长度 GetDomainByIndex(projectName, namespace string, index, preOccupiedLen int) string // GetDomain domainSuffix: test.com, project: mars, namespace: production, preOccupiedLen: 预占用的长度 GetDomain(projectName, namespace string, preOccupiedLen int) string // GetCertSecretName 获取 HTTPS 证书对应的 secret GetCertSecretName(projectName string, index int) string // GetClusterIssuer CertManager 要用 GetClusterIssuer() string // GetCerts 在 namespace 创建的时候注入证书信息 GetCerts() (name, key, crt string) }
func GetDomainManager ¶
func GetDomainManager() DomainManager
type EmptyPubSub ¶
type EmptyPubSub struct{}
func (*EmptyPubSub) Close ¶
func (e *EmptyPubSub) Close() error
func (*EmptyPubSub) ID ¶
func (e *EmptyPubSub) ID() string
func (*EmptyPubSub) Info ¶
func (e *EmptyPubSub) Info() any
func (*EmptyPubSub) Join ¶
func (e *EmptyPubSub) Join(projectID int64) error
func (*EmptyPubSub) Subscribe ¶
func (e *EmptyPubSub) Subscribe() <-chan []byte
func (*EmptyPubSub) ToAll ¶
func (e *EmptyPubSub) ToAll(message contracts.WebsocketMessage) error
func (*EmptyPubSub) ToOthers ¶
func (e *EmptyPubSub) ToOthers(message contracts.WebsocketMessage) error
func (*EmptyPubSub) ToSelf ¶
func (e *EmptyPubSub) ToSelf(message contracts.WebsocketMessage) error
func (*EmptyPubSub) Uid ¶
func (e *EmptyPubSub) Uid() string
type GitCacheServer ¶
type GitServer ¶
type GitServer interface { contracts.PluginInterface GetProject(pid string) (contracts.ProjectInterface, error) ListProjects(page, pageSize int) (contracts.ListProjectResponseInterface, error) AllProjects() ([]contracts.ProjectInterface, error) ListBranches(pid string, page, pageSize int) (contracts.ListBranchResponseInterface, error) AllBranches(pid string) ([]contracts.BranchInterface, error) GetCommit(pid string, sha string) (contracts.CommitInterface, error) GetCommitPipeline(pid string, sha string) (contracts.PipelineInterface, error) ListCommits(pid string, branch string) ([]contracts.CommitInterface, error) GetFileContentWithBranch(pid string, branch string, filename string) (string, error) GetFileContentWithSha(pid string, sha string, filename string) (string, error) GetDirectoryFilesWithBranch(pid string, branch string, path string, recursive bool) ([]string, error) GetDirectoryFilesWithSha(pid string, sha string, path string, recursive bool) ([]string, error) }
func GetGitServer ¶
func GetGitServer() GitServer
type PictureInterface ¶
type PictureInterface interface { contracts.PluginInterface // Get picture. Get(ctx context.Context, random bool) (*contracts.Picture, error) }
func GetPicture ¶
func GetPicture() PictureInterface
type WsSender ¶
type WsSender interface { contracts.PluginInterface // New contracts.PubSub New(uid, id string) contracts.PubSub }
func GetWsSender ¶
func GetWsSender() WsSender
Click to show internal directories.
Click to hide internal directories.