Documentation ¶
Index ¶
- func InterceptorLogger(l logrus.FieldLogger) logging.Logger
- type Listener
- type Server
- func (s *Server) AppManager() *application.ApplicationManager
- func (s *Server) AuthMethods() *auth.Methods
- func (s *Server) Listen(ctx context.Context, backoff wait.Backoff) error
- func (s *Server) Listener() *Listener
- func (s *Server) Queues() *queue.SendRecvQueues
- func (s *Server) Shutdown() error
- func (s *Server) Start(ctx context.Context, errch chan error) error
- func (s *Server) StartEventProcessor(ctx context.Context) error
- func (s *Server) TokenIssuer() issuer.Issuer
- type ServerOption
- func WithAuthMethods(am *auth.Methods) ServerOption
- func WithClientCertSubjectMatch(match bool) ServerOption
- func WithEventProcessors(numProcessors int64) ServerOption
- func WithGRPC(serveGRPC bool) ServerOption
- func WithGeneratedTLS(serverName string) ServerOption
- func WithGeneratedTokenSigningKey() ServerOption
- func WithListenerAddress(host string) ServerOption
- func WithListenerPort(port int) ServerOption
- func WithMetricsPort(port int) ServerOption
- func WithMinimumTLSVersion(version string) ServerOption
- func WithNamespaces(namespaces ...string) ServerOption
- func WithREST(serveREST bool) ServerOption
- func WithRequireClientCerts(require bool) ServerOption
- func WithServerName(serverName string) ServerOption
- func WithShutDownGracePeriod(d time.Duration) ServerOption
- func WithTLSCipherSuite(cipherSuite string) ServerOption
- func WithTLSKeyPair(cert *x509.Certificate, key *rsa.PrivateKey) ServerOption
- func WithTLSKeyPairFromPath(certPath, keyPath string) ServerOption
- func WithTLSRootCaFromFile(caPath string) ServerOption
- func WithTokenSigningKey(key crypto.PrivateKey) ServerOption
- func WithTokenSigningKeyFromFile(path string) ServerOption
- type ServerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InterceptorLogger ¶
func InterceptorLogger(l logrus.FieldLogger) logging.Logger
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(ctx context.Context, appClient appclientset.Interface, namespace string, opts ...ServerOption) (*Server, error)
func (*Server) AppManager ¶
func (s *Server) AppManager() *application.ApplicationManager
func (*Server) AuthMethods ¶
func (*Server) Queues ¶
func (s *Server) Queues() *queue.SendRecvQueues
func (*Server) Shutdown ¶
Shutdown shuts down the server s. If no server is running, or shutting down results in an error, an error is returned.
func (*Server) Start ¶
Start starts the Server s and its listeners in their own go routines. Any error during startup, before the go routines are running, will be returned immediately. Errors during the runtime will be propagated via errch.
func (*Server) StartEventProcessor ¶
StartEventProcessor will start the event processor, which processes items from all queues as the items appear in the queues. Processing will be performed in parallel, and in the background, until the context ctx is done.
If an error occurs before the processor could be started, it will be returned.
func (*Server) TokenIssuer ¶
TokenIssuer returns the token issuer of Server s
type ServerOption ¶
func WithAuthMethods ¶
func WithAuthMethods(am *auth.Methods) ServerOption
func WithClientCertSubjectMatch ¶
func WithClientCertSubjectMatch(match bool) ServerOption
WithClientCertSubjectMatch sets whether the subject of a client certificate presented by the agent must match the agent's name. Has no effect if client certificates are not required.
func WithEventProcessors ¶
func WithEventProcessors(numProcessors int64) ServerOption
WithEventProcessors sets the maximum number of event processors to run concurrently.
func WithGRPC ¶
func WithGRPC(serveGRPC bool) ServerOption
func WithGeneratedTLS ¶
func WithGeneratedTLS(serverName string) ServerOption
WithGeneratedTLS configures the server to generate and use a new TLS keypair upon startup.
INSECURE: Do not use in production.
func WithGeneratedTokenSigningKey ¶
func WithGeneratedTokenSigningKey() ServerOption
WithGeneratedTokenSigningKey generates a temporary JWT signing key. Note that this option should only be used for testing.
INSECURE: Do not use this in production.
func WithListenerAddress ¶
func WithListenerAddress(host string) ServerOption
WithListenerAddress sets the address the server should listen on.
func WithListenerPort ¶
func WithListenerPort(port int) ServerOption
WithListenerPort sets the listening port for the server. If the port is not valid, an error is returned.
func WithMetricsPort ¶
func WithMetricsPort(port int) ServerOption
func WithMinimumTLSVersion ¶
func WithMinimumTLSVersion(version string) ServerOption
WithMinimumTLSVersion configures the minimum TLS version to be accepted by the server.
func WithREST ¶
func WithREST(serveREST bool) ServerOption
func WithRequireClientCerts ¶
func WithRequireClientCerts(require bool) ServerOption
WithRequireClientCerts sets whether all incoming agent connections must present a valid client certificate before being accepted.
func WithServerName ¶
func WithServerName(serverName string) ServerOption
func WithShutDownGracePeriod ¶
func WithShutDownGracePeriod(d time.Duration) ServerOption
WithShutDownGracePeriod configures how long the server should wait for client connections to close during shutdown. If d is 0, the server will not use a grace period for shutdown but instead close immediately.
func WithTLSCipherSuite ¶
func WithTLSCipherSuite(cipherSuite string) ServerOption
WithTLSCipherSuite configures the TLS cipher suite to be used by the server. If an unknown cipher suite is specified, an error is returned.
func WithTLSKeyPair ¶
func WithTLSKeyPair(cert *x509.Certificate, key *rsa.PrivateKey) ServerOption
WithTLSKeyPair configures the TLS certificate and private key to be used by the server. The key must not be passphrase protected.
func WithTLSKeyPairFromPath ¶
func WithTLSKeyPairFromPath(certPath, keyPath string) ServerOption
WithTLSKeyPairFromPath configures the TLS certificate and private key to be used by the server. The function will not check whether the files exists, or if they contain valid data because it is assumed that they may be created at a later point in time.
func WithTLSRootCaFromFile ¶
func WithTLSRootCaFromFile(caPath string) ServerOption
WithTLSRootCaFromFile loads the root CAs to be used to validate client certificates from the file at caPath.
func WithTokenSigningKey ¶
func WithTokenSigningKey(key crypto.PrivateKey) ServerOption
WithTokenSigningKey sets the RSA private key to use for signing the tokens issued by the Server
func WithTokenSigningKeyFromFile ¶
func WithTokenSigningKeyFromFile(path string) ServerOption
WithTokenSigningKey sets the RSA private key to use for signing the tokens issued by the Server
type ServerOptions ¶
type ServerOptions struct {
// contains filtered or unexported fields
}