Documentation ¶
Index ¶
- Constants
- Variables
- func FindDefaultContainer(pod *v1.Pod) string
- func RegisterEndpoint(fn endpointFunc)
- func RegisterServer(fn registryFunc)
- func RegisteredEndpoints() []endpointFunc
- func RegisteredServers() []registryFunc
- type AccessToken
- func (a *AccessToken) Grant(ctx context.Context, request *token.GrantRequest) (*token.GrantResponse, error)
- func (a *AccessToken) Lease(ctx context.Context, request *token.LeaseRequest) (*token.LeaseResponse, error)
- func (a *AccessToken) List(ctx context.Context, request *token.ListRequest) (*token.ListResponse, error)
- func (a *AccessToken) Revoke(ctx context.Context, request *token.RevokeRequest) (*token.RevokeResponse, error)
- type AuthSvc
- func (a *AuthSvc) Exchange(ctx context.Context, request *auth.ExchangeRequest) (*auth.ExchangeResponse, error)
- func (a *AuthSvc) Info(ctx context.Context, req *auth.InfoRequest) (*auth.InfoResponse, error)
- func (a *AuthSvc) Login(ctx context.Context, request *auth.LoginRequest) (*auth.LoginResponse, error)
- func (a *AuthSvc) Settings(ctx context.Context, request *auth.SettingsRequest) (*auth.SettingsResponse, error)
- type ChangelogSvc
- type ClusterSvc
- type Container
- func (c *Container) ContainerLog(ctx context.Context, request *container.LogRequest) (*container.LogResponse, error)
- func (c *Container) CopyToPod(ctx context.Context, request *container.CopyToPodRequest) (*container.CopyToPodResponse, error)
- func (c *Container) Exec(request *container.ExecRequest, server container.Container_ExecServer) error
- func (c *Container) IsPodExists(_ context.Context, request *container.IsPodExistsRequest) (*container.IsPodExistsResponse, error)
- func (c *Container) IsPodRunning(_ context.Context, request *container.IsPodRunningRequest) (*container.IsPodRunningResponse, error)
- func (c *Container) StreamContainerLog(request *container.LogRequest, ...) error
- func (c *Container) StreamCopyToPod(server container.Container_StreamCopyToPodServer) error
- type DefaultAuthProvider
- type DefaultStreamer
- type EndpointSvc
- type EventDiff
- type EventSvc
- func (e *EventSvc) Authorize(ctx context.Context, fullMethodName string) (context.Context, error)
- func (e *EventSvc) List(ctx context.Context, request *event.ListRequest) (*event.ListResponse, error)
- func (e *EventSvc) Show(ctx context.Context, request *event.ShowRequest) (*event.ShowResponse, error)
- type File
- func (m *File) Authorize(ctx context.Context, fullMethodName string) (context.Context, error)
- func (*File) Delete(ctx context.Context, request *file.DeleteRequest) (*file.DeleteResponse, error)
- func (m *File) DiskInfo(ctx context.Context, request *file.DiskInfoRequest) (*file.DiskInfoResponse, error)
- func (m *File) List(ctx context.Context, request *file.ListRequest) (*file.ListResponse, error)
- func (*File) MaxUploadSize(ctx context.Context, request *file.MaxUploadSizeRequest) (*file.MaxUploadSizeResponse, error)
- func (m *File) ShowRecords(ctx context.Context, request *file.ShowRecordsRequest) (*file.ShowRecordsResponse, error)
- type GitConfigSvc
- func (m *GitConfigSvc) Authorize(ctx context.Context, fullMethodName string) (context.Context, error)
- func (m *GitConfigSvc) GetDefaultChartValues(ctx context.Context, request *gitconfig.DefaultChartValuesRequest) (*gitconfig.DefaultChartValuesResponse, error)
- func (m *GitConfigSvc) GlobalConfig(ctx context.Context, request *gitconfig.GlobalConfigRequest) (*gitconfig.GlobalConfigResponse, error)
- func (m *GitConfigSvc) Show(ctx context.Context, request *gitconfig.ShowRequest) (*gitconfig.ShowResponse, error)
- func (m *GitConfigSvc) ToggleGlobalStatus(ctx context.Context, request *gitconfig.ToggleGlobalStatusRequest) (*gitconfig.ToggleGlobalStatusResponse, error)
- func (m *GitConfigSvc) Update(ctx context.Context, request *gitconfig.UpdateRequest) (*gitconfig.UpdateResponse, error)
- type GitSvc
- func (g *GitSvc) All(ctx context.Context, req *git.AllRequest) (*git.AllResponse, error)
- func (g *GitSvc) BranchOptions(ctx context.Context, request *git.BranchOptionsRequest) (*git.BranchOptionsResponse, error)
- func (g *GitSvc) Commit(ctx context.Context, request *git.CommitRequest) (*git.CommitResponse, error)
- func (g *GitSvc) CommitOptions(ctx context.Context, request *git.CommitOptionsRequest) (*git.CommitOptionsResponse, error)
- func (g *GitSvc) DisableProject(ctx context.Context, request *git.DisableProjectRequest) (*git.DisableProjectResponse, error)
- func (g *GitSvc) EnableProject(ctx context.Context, request *git.EnableProjectRequest) (*git.EnableProjectResponse, error)
- func (g *GitSvc) MarsConfigFile(ctx context.Context, request *git.MarsConfigFileRequest) (*git.MarsConfigFileResponse, error)
- func (g *GitSvc) PipelineInfo(ctx context.Context, request *git.PipelineInfoRequest) (*git.PipelineInfoResponse, error)
- func (g *GitSvc) ProjectOptions(ctx context.Context, request *git.ProjectOptionsRequest) (*git.ProjectOptionsResponse, error)
- type Guest
- type IDToken
- type MetricsSvc
- func (m *MetricsSvc) CpuMemoryInNamespace(ctx context.Context, request *metrics.CpuMemoryInNamespaceRequest) (*metrics.CpuMemoryInNamespaceResponse, error)
- func (m *MetricsSvc) CpuMemoryInProject(ctx context.Context, request *metrics.CpuMemoryInProjectRequest) (*metrics.CpuMemoryInProjectResponse, error)
- func (m *MetricsSvc) StreamTopPod(request *metrics.TopPodRequest, server metrics.Metrics_StreamTopPodServer) error
- func (m *MetricsSvc) TopPod(ctx context.Context, request *metrics.TopPodRequest) (*metrics.TopPodResponse, error)
- type NamespaceSvc
- func (n *NamespaceSvc) All(ctx context.Context, request *namespace.AllRequest) (*namespace.AllResponse, error)
- func (n *NamespaceSvc) Create(ctx context.Context, request *namespace.CreateRequest) (*namespace.CreateResponse, error)
- func (n *NamespaceSvc) Delete(ctx context.Context, id *namespace.DeleteRequest) (*namespace.DeleteResponse, error)
- func (n *NamespaceSvc) IsExists(ctx context.Context, input *namespace.IsExistsRequest) (*namespace.IsExistsResponse, error)
- func (n *NamespaceSvc) Show(ctx context.Context, id *namespace.ShowRequest) (*namespace.ShowResponse, error)
- type OidcAuthProvider
- type PictureSvc
- type ProjectSvc
- func (p *ProjectSvc) AllContainers(ctx context.Context, request *project.AllContainersRequest) (*project.AllContainersResponse, error)
- func (p *ProjectSvc) Apply(input *project.ApplyRequest, server project.Project_ApplyServer) error
- func (p *ProjectSvc) ApplyDryRun(ctx context.Context, input *project.ApplyRequest) (*project.DryRunApplyResponse, error)
- func (p *ProjectSvc) Delete(ctx context.Context, request *project.DeleteRequest) (*project.DeleteResponse, error)
- func (p *ProjectSvc) HostVariables(ctx context.Context, req *project.HostVariablesRequest) (*project.HostVariablesResponse, error)
- func (p *ProjectSvc) List(ctx context.Context, request *project.ListRequest) (*project.ListResponse, error)
- func (p *ProjectSvc) Show(ctx context.Context, request *project.ShowRequest) (*project.ShowResponse, error)
- func (p *ProjectSvc) Version(ctx context.Context, req *project.VersionRequest) (*project.VersionResponse, error)
- type Steamer
- type VersionSvc
Constants ¶
View Source
const ( OptionTypeProject string = "project" OptionTypeBranch string = "branch" OptionTypeCommit string = "commit" )
View Source
const DefaultContainerAnnotationName = "kubectl.kubernetes.io/default-container"
View Source
const ProjectOptionsCacheKey = "ProjectOptions"
Variables ¶
View Source
var AuditLog = func(username string, action types.EventActionType, msg string) { events.AuditLog(username, action, msg, nil, nil) }
View Source
var AuditLogWithChange = events.AuditLog
View Source
var ErrorPermissionDenied = errors.New("没有权限执行该操作")
View Source
var FileAuditLog = func(username string, msg string, fileID int) { events.FileAuditLog(username, msg, fileID) }
View Source
var GetProjectMarsConfig = utils.GetProjectMarsConfig
View Source
var MustGetUser = auth.MustGetUser
Functions ¶
func FindDefaultContainer ¶
func RegisterEndpoint ¶
func RegisterEndpoint(fn endpointFunc)
func RegisterServer ¶
func RegisterServer(fn registryFunc)
func RegisteredEndpoints ¶
func RegisteredEndpoints() []endpointFunc
func RegisteredServers ¶
func RegisteredServers() []registryFunc
Types ¶
type AccessToken ¶
type AccessToken struct { token.UnimplementedAccessTokenServer // contains filtered or unexported fields }
func (*AccessToken) Grant ¶
func (a *AccessToken) Grant(ctx context.Context, request *token.GrantRequest) (*token.GrantResponse, error)
func (*AccessToken) Lease ¶
func (a *AccessToken) Lease(ctx context.Context, request *token.LeaseRequest) (*token.LeaseResponse, error)
func (*AccessToken) List ¶
func (a *AccessToken) List(ctx context.Context, request *token.ListRequest) (*token.ListResponse, error)
func (*AccessToken) Revoke ¶
func (a *AccessToken) Revoke(ctx context.Context, request *token.RevokeRequest) (*token.RevokeResponse, error)
type AuthSvc ¶
type AuthSvc struct { Guest NewProviderFunc func(cfg oauth2.Config, provider *oidc.Provider) OidcAuthProvider auth.UnimplementedAuthServer // contains filtered or unexported fields }
func NewAuthSvc ¶
func NewAuthSvc(authsvc contracts.AuthInterface, cfg contracts.OidcConfig, adminPwd string, NewProviderFunc func(cfg oauth2.Config, provider *oidc.Provider) OidcAuthProvider) *AuthSvc
func (*AuthSvc) Exchange ¶
func (a *AuthSvc) Exchange(ctx context.Context, request *auth.ExchangeRequest) (*auth.ExchangeResponse, error)
func (*AuthSvc) Info ¶
func (a *AuthSvc) Info(ctx context.Context, req *auth.InfoRequest) (*auth.InfoResponse, error)
func (*AuthSvc) Login ¶
func (a *AuthSvc) Login(ctx context.Context, request *auth.LoginRequest) (*auth.LoginResponse, error)
func (*AuthSvc) Settings ¶
func (a *AuthSvc) Settings(ctx context.Context, request *auth.SettingsRequest) (*auth.SettingsResponse, error)
type ChangelogSvc ¶
type ChangelogSvc struct {
changelog.UnimplementedChangelogServer
}
func (*ChangelogSvc) Show ¶
func (c *ChangelogSvc) Show(ctx context.Context, request *changelog.ShowRequest) (*changelog.ShowResponse, error)
type ClusterSvc ¶
type ClusterSvc struct { Guest cluster.UnimplementedClusterServer }
func (*ClusterSvc) ClusterInfo ¶
func (c *ClusterSvc) ClusterInfo(ctx context.Context, req *cluster.InfoRequest) (*cluster.InfoResponse, error)
type Container ¶
type Container struct { Steamer Steamer Executor contracts.RemoteExecutor PodFileCopier contracts.PodFileCopier NewRecorderFunc func(types.EventActionType, contracts.UserInfo, timer.Timer, contracts.Container) contracts.RecorderInterface container.UnsafeContainerServer }
func (*Container) ContainerLog ¶
func (c *Container) ContainerLog(ctx context.Context, request *container.LogRequest) (*container.LogResponse, error)
func (*Container) CopyToPod ¶
func (c *Container) CopyToPod(ctx context.Context, request *container.CopyToPodRequest) (*container.CopyToPodResponse, error)
func (*Container) Exec ¶
func (c *Container) Exec(request *container.ExecRequest, server container.Container_ExecServer) error
func (*Container) IsPodExists ¶
func (c *Container) IsPodExists(_ context.Context, request *container.IsPodExistsRequest) (*container.IsPodExistsResponse, error)
func (*Container) IsPodRunning ¶
func (c *Container) IsPodRunning(_ context.Context, request *container.IsPodRunningRequest) (*container.IsPodRunningResponse, error)
func (*Container) StreamContainerLog ¶
func (c *Container) StreamContainerLog(request *container.LogRequest, server container.Container_StreamContainerLogServer) error
func (*Container) StreamCopyToPod ¶
func (c *Container) StreamCopyToPod(server container.Container_StreamCopyToPodServer) error
type DefaultAuthProvider ¶
type DefaultAuthProvider struct {
// contains filtered or unexported fields
}
type DefaultStreamer ¶
type DefaultStreamer struct{}
func (*DefaultStreamer) Stream ¶
func (d *DefaultStreamer) Stream(ctx context.Context, namespace, pod, container string) (io.ReadCloser, error)
type EndpointSvc ¶
type EndpointSvc struct {
endpoint.UnimplementedEndpointServer
}
func (*EndpointSvc) InNamespace ¶
func (e *EndpointSvc) InNamespace(ctx context.Context, request *endpoint.InNamespaceRequest) (*endpoint.InNamespaceResponse, error)
func (*EndpointSvc) InProject ¶
func (e *EndpointSvc) InProject(ctx context.Context, request *endpoint.InProjectRequest) (*endpoint.InProjectResponse, error)
type EventSvc ¶
type EventSvc struct {
event.UnsafeEventServer
}
func (*EventSvc) List ¶
func (e *EventSvc) List(ctx context.Context, request *event.ListRequest) (*event.ListResponse, error)
func (*EventSvc) Show ¶
func (e *EventSvc) Show(ctx context.Context, request *event.ShowRequest) (*event.ShowResponse, error)
type File ¶
type File struct {
file.UnimplementedFileServer
}
func (*File) Delete ¶
func (*File) Delete(ctx context.Context, request *file.DeleteRequest) (*file.DeleteResponse, error)
func (*File) DiskInfo ¶
func (m *File) DiskInfo(ctx context.Context, request *file.DiskInfoRequest) (*file.DiskInfoResponse, error)
func (*File) List ¶
func (m *File) List(ctx context.Context, request *file.ListRequest) (*file.ListResponse, error)
func (*File) MaxUploadSize ¶
func (*File) MaxUploadSize(ctx context.Context, request *file.MaxUploadSizeRequest) (*file.MaxUploadSizeResponse, error)
func (*File) ShowRecords ¶
func (m *File) ShowRecords(ctx context.Context, request *file.ShowRecordsRequest) (*file.ShowRecordsResponse, error)
type GitConfigSvc ¶
type GitConfigSvc struct {
gitconfig.UnimplementedGitConfigServer
}
func (*GitConfigSvc) GetDefaultChartValues ¶
func (m *GitConfigSvc) GetDefaultChartValues(ctx context.Context, request *gitconfig.DefaultChartValuesRequest) (*gitconfig.DefaultChartValuesResponse, error)
func (*GitConfigSvc) GlobalConfig ¶
func (m *GitConfigSvc) GlobalConfig(ctx context.Context, request *gitconfig.GlobalConfigRequest) (*gitconfig.GlobalConfigResponse, error)
func (*GitConfigSvc) Show ¶
func (m *GitConfigSvc) Show(ctx context.Context, request *gitconfig.ShowRequest) (*gitconfig.ShowResponse, error)
func (*GitConfigSvc) ToggleGlobalStatus ¶
func (m *GitConfigSvc) ToggleGlobalStatus(ctx context.Context, request *gitconfig.ToggleGlobalStatusRequest) (*gitconfig.ToggleGlobalStatusResponse, error)
func (*GitConfigSvc) Update ¶
func (m *GitConfigSvc) Update(ctx context.Context, request *gitconfig.UpdateRequest) (*gitconfig.UpdateResponse, error)
type GitSvc ¶
type GitSvc struct {
git.UnimplementedGitServer
}
func (*GitSvc) All ¶
func (g *GitSvc) All(ctx context.Context, req *git.AllRequest) (*git.AllResponse, error)
func (*GitSvc) BranchOptions ¶
func (g *GitSvc) BranchOptions(ctx context.Context, request *git.BranchOptionsRequest) (*git.BranchOptionsResponse, error)
func (*GitSvc) Commit ¶
func (g *GitSvc) Commit(ctx context.Context, request *git.CommitRequest) (*git.CommitResponse, error)
func (*GitSvc) CommitOptions ¶
func (g *GitSvc) CommitOptions(ctx context.Context, request *git.CommitOptionsRequest) (*git.CommitOptionsResponse, error)
func (*GitSvc) DisableProject ¶
func (g *GitSvc) DisableProject(ctx context.Context, request *git.DisableProjectRequest) (*git.DisableProjectResponse, error)
func (*GitSvc) EnableProject ¶
func (g *GitSvc) EnableProject(ctx context.Context, request *git.EnableProjectRequest) (*git.EnableProjectResponse, error)
func (*GitSvc) MarsConfigFile ¶
func (g *GitSvc) MarsConfigFile(ctx context.Context, request *git.MarsConfigFileRequest) (*git.MarsConfigFileResponse, error)
func (*GitSvc) PipelineInfo ¶
func (g *GitSvc) PipelineInfo(ctx context.Context, request *git.PipelineInfoRequest) (*git.PipelineInfoResponse, error)
func (*GitSvc) ProjectOptions ¶
func (g *GitSvc) ProjectOptions(ctx context.Context, request *git.ProjectOptionsRequest) (*git.ProjectOptionsResponse, error)
type MetricsSvc ¶
type MetricsSvc struct {
metrics.UnsafeMetricsServer
}
func (*MetricsSvc) CpuMemoryInNamespace ¶
func (m *MetricsSvc) CpuMemoryInNamespace(ctx context.Context, request *metrics.CpuMemoryInNamespaceRequest) (*metrics.CpuMemoryInNamespaceResponse, error)
func (*MetricsSvc) CpuMemoryInProject ¶
func (m *MetricsSvc) CpuMemoryInProject(ctx context.Context, request *metrics.CpuMemoryInProjectRequest) (*metrics.CpuMemoryInProjectResponse, error)
func (*MetricsSvc) StreamTopPod ¶
func (m *MetricsSvc) StreamTopPod(request *metrics.TopPodRequest, server metrics.Metrics_StreamTopPodServer) error
func (*MetricsSvc) TopPod ¶
func (m *MetricsSvc) TopPod(ctx context.Context, request *metrics.TopPodRequest) (*metrics.TopPodResponse, error)
type NamespaceSvc ¶
type NamespaceSvc struct { namespace.UnimplementedNamespaceServer // contains filtered or unexported fields }
func (*NamespaceSvc) All ¶
func (n *NamespaceSvc) All(ctx context.Context, request *namespace.AllRequest) (*namespace.AllResponse, error)
func (*NamespaceSvc) Create ¶
func (n *NamespaceSvc) Create(ctx context.Context, request *namespace.CreateRequest) (*namespace.CreateResponse, error)
func (*NamespaceSvc) Delete ¶
func (n *NamespaceSvc) Delete(ctx context.Context, id *namespace.DeleteRequest) (*namespace.DeleteResponse, error)
func (*NamespaceSvc) IsExists ¶
func (n *NamespaceSvc) IsExists(ctx context.Context, input *namespace.IsExistsRequest) (*namespace.IsExistsResponse, error)
func (*NamespaceSvc) Show ¶
func (n *NamespaceSvc) Show(ctx context.Context, id *namespace.ShowRequest) (*namespace.ShowResponse, error)
type OidcAuthProvider ¶
type OidcAuthProvider interface { Exchange(ctx context.Context, code string) (string, error) Verify(ctx context.Context, token string) (IDToken, error) }
func NewDefaultAuthProvider ¶
func NewDefaultAuthProvider(cfg oauth2.Config, provider *oidc.Provider) OidcAuthProvider
type PictureSvc ¶
type PictureSvc struct { Guest picture.UnimplementedPictureServer }
func (*PictureSvc) Background ¶
func (p *PictureSvc) Background(ctx context.Context, req *picture.BackgroundRequest) (*picture.BackgroundResponse, error)
type ProjectSvc ¶
type ProjectSvc struct { NewJobFunc socket.NewJobFunc project.UnimplementedProjectServer // contains filtered or unexported fields }
func (*ProjectSvc) AllContainers ¶
func (p *ProjectSvc) AllContainers(ctx context.Context, request *project.AllContainersRequest) (*project.AllContainersResponse, error)
func (*ProjectSvc) Apply ¶
func (p *ProjectSvc) Apply(input *project.ApplyRequest, server project.Project_ApplyServer) error
func (*ProjectSvc) ApplyDryRun ¶
func (p *ProjectSvc) ApplyDryRun(ctx context.Context, input *project.ApplyRequest) (*project.DryRunApplyResponse, error)
func (*ProjectSvc) Delete ¶
func (p *ProjectSvc) Delete(ctx context.Context, request *project.DeleteRequest) (*project.DeleteResponse, error)
func (*ProjectSvc) HostVariables ¶
func (p *ProjectSvc) HostVariables(ctx context.Context, req *project.HostVariablesRequest) (*project.HostVariablesResponse, error)
func (*ProjectSvc) List ¶
func (p *ProjectSvc) List(ctx context.Context, request *project.ListRequest) (*project.ListResponse, error)
func (*ProjectSvc) Show ¶
func (p *ProjectSvc) Show(ctx context.Context, request *project.ShowRequest) (*project.ShowResponse, error)
func (*ProjectSvc) Version ¶
func (p *ProjectSvc) Version(ctx context.Context, req *project.VersionRequest) (*project.VersionResponse, error)
type VersionSvc ¶
type VersionSvc struct { Guest version.UnsafeVersionServer }
Click to show internal directories.
Click to hide internal directories.