Documentation
¶
Index ¶
- Variables
- type ApplicationSetOpts
- type GracefulRestartSignal
- type HTTPMetricsRegistry
- type Listeners
- type Server
- func (server *Server) Authenticate(ctx context.Context) (context.Context, error)
- func (server *Server) Init(ctx context.Context)
- func (server *Server) Initialized() bool
- func (server *Server) Listen() (*Listeners, error)
- func (server *Server) Run(ctx context.Context, listeners *Listeners)
- func (server *Server) TerminateRequested() bool
- type ServerOpts
- type ServiceSet
Constants ¶
This section is empty.
Variables ¶
var ErrNoSession = status.Errorf(codes.Unauthenticated, "no session information")
ErrNoSession indicates no auth token was supplied as part of a request
Functions ¶
This section is empty.
Types ¶
type ApplicationSetOpts ¶ added in v1.8.8
type GracefulRestartSignal ¶ added in v1.8.8
type GracefulRestartSignal struct{}
GracefulRestartSignal implements a signal to be used for a graceful restart trigger.
func (GracefulRestartSignal) Signal ¶ added in v1.8.8
func (g GracefulRestartSignal) Signal()
Signal is a part of os.Signal interface doing nothing.
func (GracefulRestartSignal) String ¶ added in v1.8.8
func (g GracefulRestartSignal) String() string
String is a part of os.Signal interface to represent a signal as a string.
type HTTPMetricsRegistry ¶ added in v1.8.8
type HTTPMetricsRegistry interface {
// IncExtensionRequestCounter will increase the request counter for the given
// extension with the given status.
IncExtensionRequestCounter(extension string, status int)
// ObserveExtensionRequestDuration will register the request roundtrip duration
// between Hanzo CD API Server and the extension backend service for the given
// extension.
ObserveExtensionRequestDuration(extension string, duration time.Duration)
}
HTTPMetricsRegistry exposes operations to update http metrics in the Hanzo CD API server.
type Server ¶ added in v1.8.8
type Server struct {
ServerOpts
ApplicationSetOpts
Shutdown func()
// contains filtered or unexported fields
}
Server is the API server for Hanzo CD
func NewServer ¶
func NewServer(ctx context.Context, opts ServerOpts, appsetOpts ApplicationSetOpts) *Server
NewServer returns a new instance of the Hanzo CD API server
func (*Server) Authenticate ¶ added in v1.8.8
Authenticate checks for the presence of a valid token when accessing server-side resources.
func (*Server) Initialized ¶ added in v1.8.8
func (*Server) Run ¶ added in v1.8.8
Run runs the API Server We use k8s.io/code-generator/cmd/go-to-protobuf to generate the .proto files from the API types. k8s.io/ go-to-protobuf uses protoc-gen-gogo, which comes from gogo/protobuf (a fork of golang/protobuf).
func (*Server) TerminateRequested ¶ added in v1.8.8
TerminateRequested returns whether a shutdown was initiated by a signal or context cancel as opposed to a watch.
type ServerOpts ¶ added in v1.8.8
type ServerOpts struct {
DisableAuth bool
ContentTypes []string
EnableGZip bool
Insecure bool
StaticAssetsDir string
ListenPort int
ListenHost string
MetricsPort int
MetricsHost string
Namespace string
DexServerAddr string
DexTLSConfig *dexutil.DexTLSConfig
BaseHRef string
RootPath string
DynamicClientset dynamic.Interface
KubeControllerClientset client.Client
KubeClientset kubernetes.Interface
AppClientset appclientset.Interface
RepoClientset repoapiclient.Clientset
Cache *servercache.Cache
RepoServerCache *repocache.Cache
RedisClient *kv.Client
TLSConfigCustomizer tlsutil.ConfigCustomizer
XFrameOptions string
ContentSecurityPolicy string
ApplicationNamespaces []string
EnableProxyExtension bool
WebhookParallelism int
WebhookRefreshWorkers int
EnableK8sEvent []string
HydratorEnabled bool
SyncWithReplaceAllowed bool
}
type ServiceSet ¶ added in v1.8.8
type ServiceSet struct {
ClusterService *cluster.Server
RepoService *repository.Server
RepoCredsService *repocreds.Server
SessionService *session.Server
ApplicationService applicationpkg.ApplicationServiceServer
AppResourceTreeFn application.AppResourceTreeFn
ApplicationSetService applicationsetpkg.ApplicationSetServiceServer
ProjectService *project.Server
SettingsService *settings.Server
AccountService *account.Server
CertificateService *certificate.Server
GpgkeyService *gpgkey.Server
VersionService *version.Server
}