server

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithSignal

func ContextWithSignal(ctx context.Context) context.Context

ContextWithSignal creates a context canceled when SIGINT or SIGTERM are notified.

Types

type DynamicFunc

type DynamicFunc func(*dynamic.Config, chan<- interface{})

type Message

type Message struct {
	Name    string
	Content *dynamic.Config
}

type Server

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

func NewServer

func NewServer(ctx context.Context, cf *config.Config, handler http.Handler,
	watcher *Watcher) *Server

NewServer returns an initialized Server.

func (*Server) Close

func (s *Server) Close()

Close destroys the server.

func (*Server) Start

func (s *Server) Start()

Start Starts the server.

func (*Server) Stop

func (s *Server) Stop()

Stop stops the server.

func (*Server) Wait

func (s *Server) Wait()

Wait blocks until the server shutdown.

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}
var GlobalWatcher *Watcher

func NewWatcher

func NewWatcher(ctx context.Context, pool *safe.Pool) *Watcher

func (*Watcher) AddListener

func (w *Watcher) AddListener(name string, function DynamicFunc)

func (*Watcher) Entry

func (w *Watcher) Entry() chan<- *Message

func (*Watcher) Out

func (w *Watcher) Out() <-chan interface{}

func (*Watcher) Start

func (w *Watcher) Start()

func (*Watcher) Stop

func (w *Watcher) Stop()

Jump to

Keyboard shortcuts

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