server

package
v0.0.0-...-c945685 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Overview

Package server is a library for use with starting a Pixur HTTP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RegFunc

type RegFunc func(s *Server) error

RegFunc is a registration callback. It will be invoked as part of Server.Init.

type Server

type Server struct {

	// readable fields
	Client   api.PixurServiceClient
	Now      func() time.Time
	HTTPMux  *http.ServeMux
	Random   io.Reader
	Secure   bool
	HTTPRoot *url.URL
	SiteName string
	// contains filtered or unexported fields
}

Server is an HTTP server for Pixur

func (*Server) Addr

func (s *Server) Addr() net.Addr

func (*Server) GetAndSetInterceptor

func (s *Server) GetAndSetInterceptor(in grpc.UnaryClientInterceptor) grpc.UnaryClientInterceptor

GetAndSetInterceptor gets the current gRPC Unary interceptor, and replaces it.

func (*Server) Init

func (s *Server) Init(ctx context.Context, c *config.Config) (errCap error)

Init prepares a server for serving.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context, lnReady chan<- struct{}) error

func (*Server) Register

func (s *Server) Register(rf RegFunc)

Register adds a callback to be invoked once the server is built, but not yet serving.

func (*Server) Shutdown

func (s *Server) Shutdown() error

Directories

Path Synopsis
Package config describes configuration for a frontend Pixur Server.
Package config describes configuration for a frontend Pixur Server.

Jump to

Keyboard shortcuts

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