server

package
v0.0.0-...-8d377ce Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Component component.ComponentConfig
	Database  component.CockroachConfig

	PublicListenAddress string
}

Config is the main configuration of the apigw server. It's usually populated from flags via RegisterFlags, but can also be set manually (eg. in tests).

func (*Config) RegisterFlags

func (c *Config) RegisterFlags()

RegisterFlags registers the component configuration to be provided by flags. This must be called exactly once before then calling flags.Parse().

type Server

type Server struct {
	Config Config

	// ListenGRPC will contain the address at which the internal gRPC server is
	// listening after .Start() has been called. This can differ from the configured
	// value if the configuration requests any port (via :0).
	ListenGRPC string
	// ListenPublic will contain the address at which the public API server is
	// listening after .Start() has been called. This can differ from the configured
	// value if the configuration requests any port (via :0).
	ListenPublic string
}

Server runs the apigw server. It listens on two interfaces:

  • Internal gRPC, which is authenticated using TLS and authorized by CA. This is to be used for internal RPCs, eg. management/debug.
  • Public gRPC-Web, which is currently unauthenticated.

func (*Server) Start

func (s *Server) Start(ctx context.Context)

Start runs the two listeners of the server. The process will fail (via klog.Exit) if any of the listeners/servers fail to start.

func (*Server) WhoAmI

func (s *Server) WhoAmI(ctx context.Context, req *apb.WhoAmIRequest) (*apb.WhoAmIResponse, error)

Jump to

Keyboard shortcuts

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