Documentation
¶
Index ¶
- Constants
- Variables
- func RoutingMetadata(agentId int64) metadata.MD
- type API
- type ApplyDefaults
- type Config
- type Factory
- type GitalyAddress
- func (*GitalyAddress) Descriptor() ([]byte, []int)deprecated
- func (x *GitalyAddress) GetAddress() string
- func (x *GitalyAddress) GetToken() string
- func (*GitalyAddress) ProtoMessage()
- func (x *GitalyAddress) ProtoReflect() protoreflect.Message
- func (x *GitalyAddress) Reset()
- func (x *GitalyAddress) String() string
- type Module
- type Repository
- func (*Repository) Descriptor() ([]byte, []int)deprecated
- func (x *Repository) GetGitAlternateObjectDirectories() []string
- func (x *Repository) GetGitObjectDirectory() string
- func (x *Repository) GetGlProjectPath() string
- func (x *Repository) GetGlRepository() string
- func (x *Repository) GetRelativePath() string
- func (x *Repository) GetStorageName() string
- func (*Repository) ProtoMessage()
- func (x *Repository) ProtoReflect() protoreflect.Message
- func (x *Repository) Reset()
- func (x *Repository) String() string
Constants ¶
View Source
const ( // RoutingHopPrefix is a metadata key prefix that is used for metadata keys that should be consumed by // the gateway kas instances and not passed along to agentk. RoutingHopPrefix = "kas-hop-" // RoutingAgentIdMetadataKey is used to pass destination agent id in request metadata // from the routing kas instance, that is handling the incoming request, to the gateway kas instance, // that is forwarding the request to an agentk. RoutingAgentIdMetadataKey = RoutingHopPrefix + "routing-agent-id" )
Variables ¶
View Source
var File_internal_module_modserver_modserver_proto protoreflect.FileDescriptor
Functions ¶
func RoutingMetadata ¶
Types ¶
type API ¶
type API interface {
modshared.API
// GetAgentInfo encapsulates error checking logic.
GetAgentInfo(ctx context.Context, log *zap.Logger, agentToken api.AgentToken) (*api.AgentInfo, error)
// PollWithBackoff runs f every duration given by BackoffManager.
//
// PollWithBackoff should be used by the top-level polling, so that it can be gracefully interrupted
// by the server when necessary.
// If sliding is true, the period is computed after f runs. If it is false then
// period includes the runtime for f.
// It returns when:
// - context signals done. nil is returned in this case.
// - f returns Done. error from f is returned in this case.
PollWithBackoff(ctx context.Context, backoff retry.BackoffManager, sliding bool, maxConnectionAge, interval time.Duration, f retry.PollWithBackoffFunc) error
}
API provides the API for the module to use.
type ApplyDefaults ¶
type ApplyDefaults func(*kascfg.ConfigurationFile)
ApplyDefaults is a signature of a public function, exposed by modules to perform defaulting. The function should be called ApplyDefaults.
type Config ¶
type Config struct {
// Log can be used for logging from the module.
// It should not be used for logging from gRPC API methods. Use grpctool.LoggerFromContext(ctx) instead.
Log *zap.Logger
Api API
Config *kascfg.ConfigurationFile
GitLabClient gitlab.ClientInterface
// Registerer allows to register metrics.
// Metrics should be registered in Run and unregistered before Run returns.
Registerer prometheus.Registerer
UsageTracker usage_metrics.UsageTrackerRegisterer
// AgentServer is the gRPC server agentk is talking to.
// This can be used to add endpoints in Factory.New.
// Request handlers can obtain the per-request logger using grpctool.LoggerFromContext(requestContext).
AgentServer *grpc.Server
// ApiServer is the gRPC server GitLab is talking to.
// This can be used to add endpoints in Factory.New.
// Request handlers can obtain the per-request logger using grpctool.LoggerFromContext(requestContext).
ApiServer *grpc.Server
// RegisterAgentApi allows to register a gRPC API endpoint that kas proxies to agentk.
RegisterAgentApi func(*grpc.ServiceDesc)
// AgentConn is a gRPC connection that can be used to send requests to an agentk instance.
// Agent Id must be specified in the request metadata in RoutingAgentIdMetadataKey field.
AgentConn grpc.ClientConnInterface
Gitaly gitaly.PoolInterface
// KasName is a string "gitlab-kas". Can be used as a user agent, server name, service name, etc.
KasName string
// Version is gitlab-kas version.
Version string
// CommitId is gitlab-kas commit sha.
CommitId string
}
Config holds configuration for a Module.
type GitalyAddress ¶
type GitalyAddress struct {
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
// contains filtered or unexported fields
}
func (*GitalyAddress) Descriptor
deprecated
func (*GitalyAddress) Descriptor() ([]byte, []int)
Deprecated: Use GitalyAddress.ProtoReflect.Descriptor instead.
func (*GitalyAddress) GetAddress ¶
func (x *GitalyAddress) GetAddress() string
func (*GitalyAddress) GetToken ¶
func (x *GitalyAddress) GetToken() string
func (*GitalyAddress) ProtoMessage ¶
func (*GitalyAddress) ProtoMessage()
func (*GitalyAddress) ProtoReflect ¶
func (x *GitalyAddress) ProtoReflect() protoreflect.Message
func (*GitalyAddress) Reset ¶
func (x *GitalyAddress) Reset()
func (*GitalyAddress) String ¶
func (x *GitalyAddress) String() string
type Repository ¶
type Repository struct {
StorageName string `protobuf:"bytes,2,opt,name=storage_name,json=storageName,proto3" json:"storage_name,omitempty"`
RelativePath string `protobuf:"bytes,3,opt,name=relative_path,json=relativePath,proto3" json:"relative_path,omitempty"`
GitObjectDirectory string `protobuf:"bytes,4,opt,name=git_object_directory,json=gitObjectDirectory,proto3" json:"git_object_directory,omitempty"`
GitAlternateObjectDirectories []string `` /* 152-byte string literal not displayed */
GlRepository string `protobuf:"bytes,6,opt,name=gl_repository,json=glRepository,proto3" json:"gl_repository,omitempty"`
GlProjectPath string `protobuf:"bytes,8,opt,name=gl_project_path,json=glProjectPath,proto3" json:"gl_project_path,omitempty"`
// contains filtered or unexported fields
}
func (*Repository) Descriptor
deprecated
func (*Repository) Descriptor() ([]byte, []int)
Deprecated: Use Repository.ProtoReflect.Descriptor instead.
func (*Repository) GetGitAlternateObjectDirectories ¶
func (x *Repository) GetGitAlternateObjectDirectories() []string
func (*Repository) GetGitObjectDirectory ¶
func (x *Repository) GetGitObjectDirectory() string
func (*Repository) GetGlProjectPath ¶
func (x *Repository) GetGlProjectPath() string
func (*Repository) GetGlRepository ¶
func (x *Repository) GetGlRepository() string
func (*Repository) GetRelativePath ¶
func (x *Repository) GetRelativePath() string
func (*Repository) GetStorageName ¶
func (x *Repository) GetStorageName() string
func (*Repository) ProtoMessage ¶
func (*Repository) ProtoMessage()
func (*Repository) ProtoReflect ¶
func (x *Repository) ProtoReflect() protoreflect.Message
func (*Repository) Reset ¶
func (x *Repository) Reset()
func (*Repository) String ¶
func (x *Repository) String() string
Click to show internal directories.
Click to hide internal directories.