llcache

package module
v0.0.0-...-6ac3484 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

README

llcache

llcache component written for fun

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteView

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

func (ByteView) ByteSlice

func (v ByteView) ByteSlice() []byte

func (ByteView) Len

func (v ByteView) Len() int

func (ByteView) String

func (v ByteView) String() string

type Group

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

func GetGroup

func GetGroup(name string) *Group

func NewGroup

func NewGroup(name string, cacheBytes int64, ll LL) *Group

func (*Group) Get

func (g *Group) Get(key string) (ByteView, error)

func (*Group) RegisterPeers

func (g *Group) RegisterPeers(peers PeerPicker)

type HTTPPool

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

func NewHTTPPool

func NewHTTPPool(self string) *HTTPPool

func (*HTTPPool) Log

func (p *HTTPPool) Log(format string, v ...interface{})

func (*HTTPPool) PickPeer

func (p *HTTPPool) PickPeer(key string) (PeerLL, bool)

func (*HTTPPool) ServeHTTP

func (p *HTTPPool) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*HTTPPool) Set

func (p *HTTPPool) Set(peers ...string)

type LL

type LL interface {
	Get(key string) ([]byte, error)
}

type LLFunc

type LLFunc func(key string) ([]byte, error)

func (LLFunc) Get

func (f LLFunc) Get(key string) ([]byte, error)

type PeerLL

type PeerLL interface {
	Get(in *pb.Request, out *pb.Response) error
}

type PeerPicker

type PeerPicker interface {
	PickPeer(key string) (peer PeerLL, ok bool)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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