framework

package
v0.0.0-...-2a65185 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func New

func New() *Cache

func (*Cache) Delete

func (c *Cache) Delete(key []byte) error

func (*Cache) Get

func (c *Cache) Get(key []byte) ([]byte, error)

func (*Cache) Has

func (c *Cache) Has(key []byte) bool

func (*Cache) Set

func (c *Cache) Set(key, value []byte, ttl time.Duration) error

type Cacher

type Cacher interface {
	Set([]byte, []byte, time.Duration) error
	Has([]byte) bool
	Get([]byte) ([]byte, error)
	Delete([]byte) error
}

type Server

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

func NewServer

func NewServer(opts ServerOpts, c Cacher) *Server

func (*Server) Start

func (s *Server) Start() error

type ServerOpts

type ServerOpts struct {
	ListenAddr string
	IsLeader   bool
	LeaderAddr string
}

Jump to

Keyboard shortcuts

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