server

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Package server is responsible for starting the grpc and http server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	discoveryv1.UnsafeNamespaceAPIServer // requires you to implement all gRPC services
	discoveryv1.UnsafeServerAPIServer    // requires you to implement all gRPC services
	discoveryv1.UnsafeServiceAPIServer   // requires you to implement all gRPC services
	discoveryv1.UnsafeTokenAPIServer     // requires you to implement all gRPC services
	// contains filtered or unexported fields
}

API implements the GRPC API.

func (*API) Create

Create creates an access token.

func (*API) Info

Info gives token information.

func (*API) ListNamespace

ListNamespace lists all namespaces.

func (*API) ListServer

ListServer lists all servers.

func (*API) ListService

ListService lists all services.

func (*API) ListTargetGroup added in v0.8.0

ListTargetGroup converts services to prometheus target groups.

func (*API) RegisterNamespace

RegisterNamespace registers a server.

func (*API) RegisterServer

RegisterServer registers a server.

func (*API) RegisterService

RegisterService registers a service.

func (*API) UnRegisterService

UnRegisterService unregisters a service.

func (*API) UnregisterNamespace

UnregisterNamespace unregisters a namespace.

func (*API) UnregisterServer

UnregisterServer unregisters a server.

type Config

type Config struct {
	PrometheusRegistry prometheus.Registerer
	NumReplicas        int
	GRPCListenAddr     string
	HTTPListenAddr     string
	TokenIssuer        string
	TokenSecretKey     string
	OIDCClient         string
	OIDCRoles          []string
	OIDCURL            string
	Transport          http.RoundTripper
	ClaimConfig        auth.ClaimConfig
}

Config configures the discovery server.

type Server

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

Server represents the discovery server.

func New

func New(backend store.Backend, l *zap.SugaredLogger, cfg Config) (*Server, error)

New initializes a new Server.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts the server and runs until context is canceled.

Directories

Path Synopsis
Package convert converts proto types to domain types and vice versa.
Package convert converts proto types to domain types and vice versa.

Jump to

Keyboard shortcuts

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