refs

package
v0.0.0-...-e36a8a6 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HashLen = 20
)

Variables

Functions

func EncodeSnapshot

func EncodeSnapshot(snapshotData *SnapshotData) ([]byte, error)

func Register

func Register(f FormatFunc)

func ReportUploadPackError

func ReportUploadPackError(w io.Writer, errMessage string)

Types

type FormatFunc

type FormatFunc = func(PeerID) string

type Hash

type Hash [HashLen]byte

func (Hash) String

func (h Hash) String() string

type Listener

type Listener interface {
	Check(refs map[string]Hash) error
	Apply(cmds []*packp.Command, packfile []byte, handle ReqHandle) error
	FetchObjects(refs map[string]Hash, addrs []string) error
	OnLeaderStart(term uint64)
	OnLeaderStop()
}

type Member

type Member = *member

func NewMember

func NewMember(id PeerID, peerURLs []string) Member

type Oplog

type Oplog struct {
	Ops []*Oplog_Op `protobuf:"bytes,1,rep,name=ops" json:"ops,omitempty"`
	// [oneof
	ObjPack []byte   `protobuf:"bytes,16,opt,name=obj_pack,json=objPack" json:"obj_pack,omitempty"`
	Objs    [][]byte `protobuf:"bytes,17,rep,name=objs" json:"objs,omitempty"`
	Params  []string `protobuf:"bytes,18,rep,name=params" json:"params,omitempty"` // oneof]
	// contains filtered or unexported fields
}

func (*Oplog) Descriptor deprecated

func (*Oplog) Descriptor() ([]byte, []int)

Deprecated: Use Oplog.ProtoReflect.Descriptor instead.

func (*Oplog) GetObjPack

func (x *Oplog) GetObjPack() []byte

func (*Oplog) GetObjs

func (x *Oplog) GetObjs() [][]byte

func (*Oplog) GetOps

func (x *Oplog) GetOps() []*Oplog_Op

func (*Oplog) GetParams

func (x *Oplog) GetParams() []string

func (*Oplog) ProtoMessage

func (*Oplog) ProtoMessage()

func (*Oplog) ProtoReflect

func (x *Oplog) ProtoReflect() protoreflect.Message

func (*Oplog) Reset

func (x *Oplog) Reset()

func (*Oplog) String

func (x *Oplog) String() string

type Oplog_Op

type Oplog_Op struct {
	Name      *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
	Target    []byte  `protobuf:"bytes,2,opt,name=target" json:"target,omitempty"`
	OldTarget []byte  `protobuf:"bytes,3,opt,name=old_target,json=oldTarget" json:"old_target,omitempty"`
	// contains filtered or unexported fields
}

func (*Oplog_Op) Descriptor deprecated

func (*Oplog_Op) Descriptor() ([]byte, []int)

Deprecated: Use Oplog_Op.ProtoReflect.Descriptor instead.

func (*Oplog_Op) GetName

func (x *Oplog_Op) GetName() string

func (*Oplog_Op) GetOldTarget

func (x *Oplog_Op) GetOldTarget() []byte

func (*Oplog_Op) GetTarget

func (x *Oplog_Op) GetTarget() []byte

func (*Oplog_Op) ProtoMessage

func (*Oplog_Op) ProtoMessage()

func (*Oplog_Op) ProtoReflect

func (x *Oplog_Op) ProtoReflect() protoreflect.Message

func (*Oplog_Op) Reset

func (x *Oplog_Op) Reset()

func (*Oplog_Op) String

func (x *Oplog_Op) String() string

type PeerID

type PeerID uint64

func DefaultNewMemberID

func DefaultNewMemberID(peerURLs []string) PeerID

func NewMemberID

func NewMemberID(peerURLs []string, now *time.Time) PeerID

func (PeerID) Format

func (id PeerID) Format() string

func (PeerID) String

func (id PeerID) String() string

type ReqHandle

type ReqHandle interface{}

type SnapshotData

type SnapshotData struct {
	Refs    map[string]Hash `json:"refs"`
	Members []Member        `json:"members"`
}

func DecodeSnapshot

func DecodeSnapshot(data []byte) (*SnapshotData, error)

Jump to

Keyboard shortcuts

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