blobserver

package
v0.0.0-...-01875d1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PushMessage = uint8(iota)
	PullMessage
	AdvertiseMessage
	AskMessage
)
View Source
const MaxMessageSize = 1 << 22

Variables

This section is empty.

Functions

This section is empty.

Types

type Advertise struct {
	ID blobs.ID
}

Advertise notifies about the existence of certain blobs.

type Ask

type Ask struct {
	ID blobs.ID
}

type BTP

type BTP struct {
	OnAdvertise func(blobs.ID) error
	OnAsk       func(blobs.ID) error
	OnPull      func(blobs.ID) error
	OnPush      func(blobs.Blob) error
	OnDoNotHave func(blobs.ID) error
	// contains filtered or unexported fields
}

func (*BTP) Advertise

func (btp *BTP) Advertise(id blobs.ID) error

func (*BTP) Ask

func (btp *BTP) Ask(id blobs.ID) error

func (*BTP) Pull

func (btp *BTP) Pull(id blobs.ID) error

func (*BTP) Push

func (btp *BTP) Push(b blobs.Blob) error

func (*BTP) Serve

func (btp *BTP) Serve(conn f2f.Conn) error

type DoNotHave

type DoNotHave struct {
	ID blobs.ID
}

type Finder

type Finder struct {
	Kvs kvstore.KVStore
}

func (*Finder) FoundAt

func (f *Finder) FoundAt(what blobs.ID, addr f2f.Addr)

func (*Finder) Invalidate

func (f *Finder) Invalidate(id blobs.ID, addr f2f.Addr)

func (*Finder) WhereIs

func (f *Finder) WhereIs(id blobs.ID) (res []f2f.Addr)

type MessageUnion

type MessageUnion struct {
	Push      *Push
	Pull      *Pull
	Advertise *Advertise
	Ask       *Ask
	DoNotHave *DoNotHave
}

type Pull

type Pull struct {
	ID blobs.ID
}

Pull messages ask for a blob

type Push

type Push struct {
	Blob blobs.Blob
}

Push messages carry data that may or may not be solicited.

type Server

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

func New

func New(bs blobs.Blobsource, kvstore kvstore.KVStore) *Server

func (*Server) Get

func (s *Server) Get(id blobs.ID) (b blobs.Blob, err error)

func (*Server) Prelocate

func (s *Server) Prelocate(id blobs.ID) error

func (*Server) Serve

func (s *Server) Serve(l f2f.Listener) error

func (*Server) Shutdown

func (s *Server) Shutdown()

Jump to

Keyboard shortcuts

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