servers

package
v0.0.0-...-003091f Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default, _ = New("http://0.0.0.0:8080")

Functions

func ListenAndServe

func ListenAndServe() error

Types

type Endpoint

type Endpoint struct {
	endpoints.Endpoint
	Handler http.HandlerFunc
}

type Option

type Option func(s *Server)

func WithRegistry

func WithRegistry(
	cfg *etcd.Config,
	opts ...RegistryOption,
) Option

type RegistryOption

type RegistryOption func(r *registries.Registry)

func WithContext

func WithContext(ctx context.Context) RegistryOption

func WithPrefix

func WithPrefix(p string) RegistryOption

type Server

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

func New

func New(rawURL string, opts ...Option) (*Server, error)

func Use

func Use(opts ...Option) *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) Register

func (s *Server) Register(srv *Endpoint)

Jump to

Keyboard shortcuts

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