server

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAmizoneServiceServer

func NewAmizoneServiceServer() v1.AmizoneServiceServer

Types

type ApiServer

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

ApiServer implements an HTTP + gRPC API interface for the go-amizone SDK.

func New

func New(config *Config) *ApiServer

func (*ApiServer) Init

func (s *ApiServer) Init()

Init initialises the server. It is usually called internally by ListenAndServe or ServeHTTP.

func (*ApiServer) ListenAndServe

func (s *ApiServer) ListenAndServe() error

ListenAndServe starts the server on Config.BindAddr and blocks until it is stopped. The error returned is consistent with the error returned by http.Server.ListenAndServe.

func (*ApiServer) ServeHTTP

func (s *ApiServer) ServeHTTP(writer http.ResponseWriter, request *http.Request)

ServeHTTP implements the http.Handler interface for ApiServer.

func (*ApiServer) Stop

func (s *ApiServer) Stop(ctx context.Context) error

Stop stops the server.

type Config

type Config struct {
	Logger       logr.Logger
	BindAddr     string
	WellKnownDir string
}

Config is the configuration entity for ApiServer.

func NewConfig

func NewConfig(bindAddress string) *Config

NewConfig returns a Config with sensible defaults and a logr.Discard logger.

type ContextKey

type ContextKey string
const ContextAmizoneClientKey ContextKey = "amizone_client"

Directories

Path Synopsis
gen
go/v1
Package api_v1 is a reverse proxy.
Package api_v1 is a reverse proxy.
transformers

Jump to

Keyboard shortcuts

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