package server

import "github.com/ditsuke/go-amizone/server"

Index

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"

Source Files

grpc_service_server.go server.go

Directories

PathSynopsis
server/gen
server/gen/go
server/gen/go/v1Package api_v1 is a reverse proxy.
server/transformers
server/transformers/fromproto
server/transformers/toproto
Version
v0.8.0 (latest)
Published
Jun 9, 2023
Platform
linux/amd64
Imports
21 packages
Last checked
2 hours ago

Tools for package owners.