package server
import "github.com/ditsuke/go-amizone/server"
Index ¶
- func NewAmizoneServiceServer() v1.AmizoneServiceServer
- type ApiServer
- func New(config *Config) *ApiServer
- func (s *ApiServer) Init()
- func (s *ApiServer) ListenAndServe() error
- func (s *ApiServer) ServeHTTP(writer http.ResponseWriter, request *http.Request)
- func (s *ApiServer) Stop(ctx context.Context) error
- type Config
- type ContextKey
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 (*ApiServer) Init ¶
func (s *ApiServer) Init()
Init initialises the server. It is usually called internally by ListenAndServe or ServeHTTP.
func (*ApiServer) ListenAndServe ¶
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 ¶
Stop stops the server.
type Config ¶
Config is the configuration entity for ApiServer.
func NewConfig ¶
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 ¶
Path | Synopsis |
---|---|
server/gen | |
server/gen/go | |
server/gen/go/v1 | Package 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.