endpoint

package
v0.0.0-...-f584327 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 19 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 {
	// Port is the listened port for client server
	Port int

	// PeerPort is the listened port for peer server
	PeerPort int

	// InfoPort is the listened port for info server
	InfoPort int

	// ClientSecurityConfig is the security config for client server
	ClientSecurityConfig *SecurityConfig

	// PeerSecurityConfig is the security config for peer server
	PeerSecurityConfig *SecurityConfig

	// EnableEtcdCompatibility is the flag if KubeWharf should try to be compatible with etcd3
	EnableEtcdCompatibility bool
}

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if config is valid

type Endpoint

type Endpoint struct {
	// contains filtered or unexported fields
}

Endpoint is the endpoint for serving

func NewEndpoint

func NewEndpoint(b backend.Backend, m metrics.Metrics, config *Config) *Endpoint

NewEndpoint returns an Endpoint for serving

func (*Endpoint) Run

func (e *Endpoint) Run(ctx context.Context) (err error)

Run start grpc and http server, and block until there is any error

each port may start secure server and insecure server
ClientPort─┬─ Secure(TLS) ─┬─ GRPC
           │               └─ HTTP
           │
           └─  Insecure   ─┬─ GRPC
                           └─ HTTP

PeerPort  ─┬─ Secure(TLS) ─┬─ GRPC
           │               └─ HTTP
           │
           └─  Insecure   ─┬─ GRPC
                           └─ HTTP
InfoPort  ───  Insecure   ─── HTTP

type SecurityConfig

type SecurityConfig struct {

	// CertFile is the file path of server's cert
	CertFile string

	// KeyFile is the file path of server's private key
	KeyFile string

	// CA is the file path of ca's cert
	CA string

	// ClientAuth indicate if client certs should be verified
	ClientAuth bool

	// AllowInsecure indicates if server can be access in insecure mode without tls
	AllowInsecure bool
	// contains filtered or unexported fields
}

SecurityConfig is the configuration of server tls

func (*SecurityConfig) ToKvs

func (sc *SecurityConfig) ToKvs() []interface{}

ToKvs make config to kvs for klog

Jump to

Keyboard shortcuts

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