services

package
v4.19.3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: AGPL-3.0 Imports: 64 Imported by: 0

Documentation

Index

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 FindDefaultContainer(pod *v1.Pod) string

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

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

func (*Container) ContainerLog

func (c *Container) ContainerLog(ctx context.Context, request *container.LogRequest) (*container.LogResponse, error)

func (*Container) CopyToPod

func (*Container) Exec

func (*Container) IsPodExists

func (*Container) IsPodRunning

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
}

func (*DefaultAuthProvider) Exchange

func (d *DefaultAuthProvider) Exchange(ctx context.Context, code string) (string, error)

func (*DefaultAuthProvider) Verify

func (d *DefaultAuthProvider) Verify(ctx context.Context, token string) (IDToken, error)

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 (*EndpointSvc) InProject

type EventDiff

type EventDiff struct {
	models.Event
	HasDiff bool `json:"has_diff"`
}

func (EventDiff) TableName

func (EventDiff) TableName() string

type EventSvc

type EventSvc struct {
	event.UnsafeEventServer
}

func (*EventSvc) Authorize

func (e *EventSvc) Authorize(ctx context.Context, fullMethodName string) (context.Context, error)

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) Authorize

func (m *File) Authorize(ctx context.Context, fullMethodName string) (context.Context, error)

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) Authorize

func (m *GitConfigSvc) Authorize(ctx context.Context, fullMethodName string) (context.Context, error)

func (*GitConfigSvc) GetDefaultChartValues

func (*GitConfigSvc) GlobalConfig

func (*GitConfigSvc) Show

func (*GitConfigSvc) ToggleGlobalStatus

func (*GitConfigSvc) Update

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 Guest

type Guest struct{}

func (Guest) AuthFuncOverride

func (c Guest) AuthFuncOverride(ctx context.Context, fullMethodName string) (context.Context, error)

type IDToken

type IDToken interface {
	Claims(any) error
}

type MetricsSvc

type MetricsSvc struct {
	metrics.UnsafeMetricsServer
}

func (*MetricsSvc) CpuMemoryInNamespace

func (*MetricsSvc) CpuMemoryInProject

func (*MetricsSvc) StreamTopPod

func (m *MetricsSvc) StreamTopPod(request *metrics.TopPodRequest, server metrics.Metrics_StreamTopPodServer) error

func (*MetricsSvc) TopPod

type NamespaceSvc

type NamespaceSvc struct {
	namespace.UnimplementedNamespaceServer
	// contains filtered or unexported fields
}

func (*NamespaceSvc) All

func (*NamespaceSvc) Create

func (*NamespaceSvc) Delete

func (*NamespaceSvc) IsExists

func (*NamespaceSvc) Show

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

type ProjectSvc

type ProjectSvc struct {
	NewJobFunc socket.NewJobFunc
	project.UnimplementedProjectServer
	// contains filtered or unexported fields
}

func (*ProjectSvc) AllContainers

func (*ProjectSvc) Apply

func (*ProjectSvc) ApplyDryRun

func (*ProjectSvc) Delete

func (*ProjectSvc) HostVariables

func (*ProjectSvc) List

func (*ProjectSvc) Show

func (*ProjectSvc) Version

type Steamer

type Steamer interface {
	Stream(ctx context.Context, namespace, pod, container string) (io.ReadCloser, error)
}

type VersionSvc

type VersionSvc struct {
	Guest

	version.UnsafeVersionServer
}

func (*VersionSvc) Version

func (*VersionSvc) Version(ctx context.Context, request *version.Request) (*version.Response, error)

Jump to

Keyboard shortcuts

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