server

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Unique ID of server
	ID string
	// Local address to bind to
	Address string
	// Members in the cluster
	Members []string
}

type Server

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

func New

func New(opts *Options) (*Server, error)

func (*Server) Address

func (s *Server) Address() string

func (*Server) Delete

func (s *Server) Delete(key string) error

func (*Server) Get

func (s *Server) Get(key string) (interface{}, error)

func (*Server) GetBroadcasts

func (s *Server) GetBroadcasts(overhead, limit int) [][]byte

func (*Server) LocalState

func (s *Server) LocalState(join bool) []byte

func (*Server) MergeRemoteState

func (s *Server) MergeRemoteState(buf []byte, join bool)

func (*Server) NodeMeta

func (s *Server) NodeMeta(limit int) []byte

func (*Server) NotifyMsg

func (s *Server) NotifyMsg(b []byte)

func (*Server) Set

func (s *Server) Set(key string, val interface{}) error

type Update

type Update struct {
	Action string // set, del
	Data   map[string]interface{}
}

Jump to

Keyboard shortcuts

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