bcp

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package bcp implements the Blobcache Protocol (BCP).

Index

Constants

View Source
const (
	MT_OK = MessageCode((255 * sectionSize) + iota)

	MT_ERROR_TIMEOUT
	MT_ERROR_INVALID_HANDLE
	MT_ERROR_NOT_FOUND
	MT_ERROR_NO_PERMISSION
	MT_ERROR_NO_LINK
	MT_ERROR_TOO_LARGE

	MT_ERROR_UNKNOWN = MessageCode(256*sectionSize - 1)
)

Response messages

View Source
const HeaderLen = 8

Variables

This section is empty.

Functions

func Abort

func Commit

func Commit(ctx context.Context, tp Asker, ep blobcache.Endpoint, tx blobcache.Handle) error

func Copy

func Copy(ctx context.Context, tp Asker, ep blobcache.Endpoint, tx blobcache.Handle, cids []blobcache.CID, srcTxns []blobcache.Handle, success *blobcache.BitMap) error

func Delete

func Delete(ctx context.Context, tp Asker, ep blobcache.Endpoint, tx blobcache.Handle, cids []blobcache.CID) error

func Drop

func Endpoint

func Endpoint(ctx context.Context, tp Asker) (blobcache.Endpoint, error)

func Exists

func Exists(ctx context.Context, tp Asker, ep blobcache.Endpoint, tx blobcache.Handle, cids []blobcache.CID, dst *blobcache.BitMap) error

func Get

func Get(ctx context.Context, tp Asker, ep blobcache.Endpoint, txh blobcache.Handle, hf blobcache.HashAlgo, cid blobcache.CID, salt *blobcache.CID, buf []byte) (int, error)

func IsVisited

func IsVisited(ctx context.Context, tp Asker, ep blobcache.Endpoint, tx blobcache.Handle, cids []blobcache.CID, dst *blobcache.BitMap) error

func KeepAlive

func KeepAlive(ctx context.Context, tp Asker, ep blobcache.Endpoint, hs []blobcache.Handle) error

func Load

func Load(ctx context.Context, tp Asker, ep blobcache.Endpoint, tx blobcache.Handle, dst *[]byte) error

func Ping

func Ping(ctx context.Context, tp Asker, ep blobcache.Endpoint) error

func Post

func Post(ctx context.Context, tp Asker, ep blobcache.Endpoint, txh blobcache.Handle, salt *blobcache.CID, data []byte) (blobcache.CID, error)

func Save

func Save(ctx context.Context, tp Asker, ep blobcache.Endpoint, tx blobcache.Handle, src []byte) error

func Serve

func Serve(ctx context.Context, lis net.Listener, srv Handler) error

func ServeStream

func ServeStream(ctx context.Context, ep blobcache.Endpoint, conn io.ReadWriteCloser, srv Handler) error

ServeStream serves BCP over a bidi-stream

func Unlink(ctx context.Context, tp Asker, ep blobcache.Endpoint, tx blobcache.Handle, targets []blobcache.LinkID) error

func Visit

func Visit(ctx context.Context, tp Asker, ep blobcache.Endpoint, tx blobcache.Handle, cids []blobcache.CID) error
func VisitLinks(ctx context.Context, tp Asker, ep blobcache.Endpoint, tx blobcache.Handle, targets []blobcache.LinkID) error

Types

type AbortReq

type AbortReq struct {
	Tx blobcache.Handle
}

func (AbortReq) Marshal

func (ar AbortReq) Marshal(out []byte) []byte

func (*AbortReq) Unmarshal

func (ar *AbortReq) Unmarshal(data []byte) error

type AbortResp

type AbortResp struct{}

func (AbortResp) Marshal

func (ar AbortResp) Marshal(out []byte) []byte

func (*AbortResp) Unmarshal

func (ar *AbortResp) Unmarshal(data []byte) error

type AccessFunc

type AccessFunc func(blobcache.NodeID) blobcache.Service

AccessFunc is called to get a Service to access If the returned Service is nil, then the connection is disconnected as quickly as possible, and no further information should be sent to the initiator.

"Get off the phone" https://i.gifer.com/2Yv2.gif

type Asker

type Asker interface {
	Ask(ctx context.Context, remote blobcache.Endpoint, req Message, resp *Message) error
}

type BeginTxReq

type BeginTxReq struct {
	Volume blobcache.Handle
	Params blobcache.TxParams
}

func (BeginTxReq) Marshal

func (btx BeginTxReq) Marshal(out []byte) []byte

func (*BeginTxReq) Unmarshal

func (btx *BeginTxReq) Unmarshal(data []byte) error

type BeginTxResp

type BeginTxResp struct {
	// Tx is the handle for the transaction.
	Tx blobcache.Handle
	// TxInfo is the info for the transaction.
	Info blobcache.TxInfo
	// PreemptData contains preemptively sent data in the blobstream protocol.
	PreemptData [][]byte
}

func BeginTx

func BeginTx(ctx context.Context, tp Asker, ep blobcache.Endpoint, req BeginTxReq) (BeginTxResp, error)

func (BeginTxResp) Marshal

func (btx BeginTxResp) Marshal(out []byte) []byte

func (*BeginTxResp) Unmarshal

func (btx *BeginTxResp) Unmarshal(data []byte) error

type CloneVolumeReq

type CloneVolumeReq struct {
	Volume blobcache.Handle
}

func (CloneVolumeReq) Marshal

func (cr CloneVolumeReq) Marshal(out []byte) []byte

func (*CloneVolumeReq) Unmarshal

func (cr *CloneVolumeReq) Unmarshal(data []byte) error

type CloneVolumeResp

type CloneVolumeResp struct {
	Handle blobcache.Handle
}

func (CloneVolumeResp) Marshal

func (cr CloneVolumeResp) Marshal(out []byte) []byte

func (*CloneVolumeResp) Unmarshal

func (cr *CloneVolumeResp) Unmarshal(data []byte) error

type CommitReq

type CommitReq struct {
	Tx blobcache.Handle
}

func (CommitReq) Marshal

func (cr CommitReq) Marshal(out []byte) []byte

func (*CommitReq) Unmarshal

func (cr *CommitReq) Unmarshal(data []byte) error

type CommitResp

type CommitResp struct{}

func (CommitResp) Marshal

func (cr CommitResp) Marshal(out []byte) []byte

func (*CommitResp) Unmarshal

func (cr *CommitResp) Unmarshal(data []byte) error

type CopyReq

type CopyReq struct {
	// Tx is the destination Tx to write to
	Tx blobcache.Handle
	// Srcs are the source transactions to pull from.
	// Maximum of 2^16 - 1
	Srcs []blobcache.Handle
	// Maxium of 2^32 - 1
	CIDs []blobcache.CID
}

func (CopyReq) Marshal

func (ar CopyReq) Marshal(out []byte) []byte

func (*CopyReq) Unmarshal

func (ar *CopyReq) Unmarshal(data []byte) error

type CopyResp

type CopyResp struct {
	Added blobcache.BitMap
}

func (CopyResp) Marshal

func (ar CopyResp) Marshal(out []byte) []byte

func (*CopyResp) Unmarshal

func (ar *CopyResp) Unmarshal(data []byte) error

type CreateQueueReq

type CreateQueueReq struct {
	Host blobcache.Endpoint
	Spec blobcache.QueueSpec
}

func (CreateQueueReq) Marshal

func (cq CreateQueueReq) Marshal(out []byte) []byte

func (*CreateQueueReq) Unmarshal

func (cq *CreateQueueReq) Unmarshal(data []byte) error

type CreateQueueResp

type CreateQueueResp struct {
	Handle blobcache.Handle
	Info   blobcache.QueueInfo
}

func (CreateQueueResp) Marshal

func (cq CreateQueueResp) Marshal(out []byte) []byte

func (*CreateQueueResp) Unmarshal

func (cq *CreateQueueResp) Unmarshal(data []byte) error

type CreateVolumeReq

type CreateVolumeReq struct {
	Host blobcache.Endpoint
	Spec blobcache.VolumeSpec
}

func (CreateVolumeReq) Marshal

func (cr CreateVolumeReq) Marshal(out []byte) []byte

func (*CreateVolumeReq) Unmarshal

func (cr *CreateVolumeReq) Unmarshal(data []byte) error

type CreateVolumeResp

type CreateVolumeResp struct {
	Handle blobcache.Handle
	Info   blobcache.VolumeInfo
}

func (CreateVolumeResp) Marshal

func (cr CreateVolumeResp) Marshal(out []byte) []byte

func (*CreateVolumeResp) Unmarshal

func (cr *CreateVolumeResp) Unmarshal(data []byte) error

type DeleteReq

type DeleteReq struct {
	Tx   blobcache.Handle
	CIDs []blobcache.CID
}

func (DeleteReq) Marshal

func (dr DeleteReq) Marshal(out []byte) []byte

func (*DeleteReq) Unmarshal

func (dr *DeleteReq) Unmarshal(data []byte) error

type DeleteResp

type DeleteResp struct{}

func (DeleteResp) Marshal

func (dr DeleteResp) Marshal(out []byte) []byte

func (*DeleteResp) Unmarshal

func (dr *DeleteResp) Unmarshal(data []byte) error

type DequeueReq

type DequeueReq struct {
	Queue blobcache.Handle
	Opts  blobcache.DequeueOpts
	Max   int
}

func (DequeueReq) Marshal

func (dr DequeueReq) Marshal(out []byte) []byte

func (*DequeueReq) Unmarshal

func (dr *DequeueReq) Unmarshal(data []byte) error

type DequeueResp

type DequeueResp struct {
	Messages []blobcache.Message
}

func (DequeueResp) Marshal

func (nr DequeueResp) Marshal(out []byte) []byte

func (*DequeueResp) Unmarshal

func (nr *DequeueResp) Unmarshal(data []byte) error

type DropReq

type DropReq struct {
	Handle blobcache.Handle
}

func (DropReq) Marshal

func (dr DropReq) Marshal(out []byte) []byte

func (*DropReq) Unmarshal

func (dr *DropReq) Unmarshal(data []byte) error

type DropResp

type DropResp struct{}

func (DropResp) Marshal

func (dr DropResp) Marshal(out []byte) []byte

func (*DropResp) Unmarshal

func (dr *DropResp) Unmarshal(data []byte) error

type EndpointReq

type EndpointReq struct{}

func (EndpointReq) Marshal

func (req EndpointReq) Marshal(out []byte) []byte

func (*EndpointReq) Unmarshal

func (req *EndpointReq) Unmarshal(out []byte) error

type EndpointResp

type EndpointResp struct {
	Endpoint blobcache.Endpoint
}

func (EndpointResp) Marshal

func (ep EndpointResp) Marshal(out []byte) []byte

func (*EndpointResp) Unmarshal

func (ep *EndpointResp) Unmarshal(out []byte) error

type EnqueueReq

type EnqueueReq struct {
	Queue    blobcache.Handle
	Messages []blobcache.Message
}

func (EnqueueReq) Marshal

func (er EnqueueReq) Marshal(out []byte) []byte

func (*EnqueueReq) Unmarshal

func (er *EnqueueReq) Unmarshal(data []byte) error

type EnqueueResp

type EnqueueResp struct {
	Success uint32
}

func (EnqueueResp) Marshal

func (ir EnqueueResp) Marshal(out []byte) []byte

func (*EnqueueResp) Unmarshal

func (ir *EnqueueResp) Unmarshal(data []byte) error

type ExistsReq

type ExistsReq struct {
	Tx   blobcache.Handle
	CIDs []blobcache.CID
}

func (ExistsReq) Marshal

func (er ExistsReq) Marshal(out []byte) []byte

func (*ExistsReq) Unmarshal

func (er *ExistsReq) Unmarshal(data []byte) error

type ExistsResp

type ExistsResp struct {
	Exists blobcache.BitMap
}

func (ExistsResp) Marshal

func (er ExistsResp) Marshal(out []byte) []byte

func (*ExistsResp) Unmarshal

func (er *ExistsResp) Unmarshal(data []byte) error

type GetReq

type GetReq struct {
	Tx  blobcache.Handle
	CID blobcache.CID
}

func (GetReq) Marshal

func (gr GetReq) Marshal(out []byte) []byte

func (*GetReq) Unmarshal

func (gr *GetReq) Unmarshal(data []byte) error

type GetResp

type GetResp struct {
	Data []byte
}

func (GetResp) Marshal

func (gr GetResp) Marshal(out []byte) []byte

func (*GetResp) Unmarshal

func (gr *GetResp) Unmarshal(data []byte) error

type GetSaltReq

type GetSaltReq struct {
	Tx   blobcache.Handle
	CID  blobcache.CID
	Salt blobcache.CID
}

func (GetSaltReq) Marshal

func (gsr GetSaltReq) Marshal(out []byte) []byte

func (*GetSaltReq) Unmarshal

func (gsr *GetSaltReq) Unmarshal(data []byte) error

type Handler

type Handler interface {
	ServeBCP(ctx context.Context, from blobcache.Endpoint, req Message, resp *Message) bool
}

type InspectHandleReq

type InspectHandleReq struct {
	Handle blobcache.Handle
}

func (InspectHandleReq) Marshal

func (ir InspectHandleReq) Marshal(out []byte) []byte

func (*InspectHandleReq) Unmarshal

func (ir *InspectHandleReq) Unmarshal(data []byte) error

type InspectHandleResp

type InspectHandleResp struct {
	Info blobcache.HandleInfo
}

func (InspectHandleResp) Marshal

func (ir InspectHandleResp) Marshal(out []byte) []byte

func (*InspectHandleResp) Unmarshal

func (ir *InspectHandleResp) Unmarshal(data []byte) error

type InspectQueueReq

type InspectQueueReq struct {
	Queue blobcache.Handle
}

func (InspectQueueReq) Marshal

func (iq InspectQueueReq) Marshal(out []byte) []byte

func (*InspectQueueReq) Unmarshal

func (iq *InspectQueueReq) Unmarshal(data []byte) error

type InspectQueueResp

type InspectQueueResp struct {
	Info blobcache.QueueInfo
}

func (InspectQueueResp) Marshal

func (iq InspectQueueResp) Marshal(out []byte) []byte

func (*InspectQueueResp) Unmarshal

func (iq *InspectQueueResp) Unmarshal(data []byte) error

type InspectReq

type InspectReq struct {
	Handle blobcache.Handle
}

func (InspectReq) Marshal

func (r InspectReq) Marshal(out []byte) []byte

func (*InspectReq) Unmarshal

func (r *InspectReq) Unmarshal(data []byte) error

type InspectResp

type InspectResp struct {
	Info blobcache.Info
}

func (InspectResp) Marshal

func (r InspectResp) Marshal(out []byte) []byte

func (*InspectResp) Unmarshal

func (r *InspectResp) Unmarshal(data []byte) error

type InspectTxReq

type InspectTxReq struct {
	Tx blobcache.Handle
}

func (InspectTxReq) Marshal

func (r InspectTxReq) Marshal(out []byte) []byte

func (*InspectTxReq) Unmarshal

func (r *InspectTxReq) Unmarshal(data []byte) error

type InspectTxResp

type InspectTxResp struct {
	Info blobcache.TxInfo
}

func (InspectTxResp) Marshal

func (r InspectTxResp) Marshal(out []byte) []byte

func (*InspectTxResp) Unmarshal

func (r *InspectTxResp) Unmarshal(data []byte) error

type InspectVolumeReq

type InspectVolumeReq struct {
	Volume blobcache.Handle
}

func (InspectVolumeReq) Marshal

func (iv InspectVolumeReq) Marshal(out []byte) []byte

func (*InspectVolumeReq) Unmarshal

func (iv *InspectVolumeReq) Unmarshal(data []byte) error

type InspectVolumeResp

type InspectVolumeResp struct {
	Info blobcache.VolumeInfo
}

func (InspectVolumeResp) Marshal

func (iv InspectVolumeResp) Marshal(out []byte) []byte

func (*InspectVolumeResp) Unmarshal

func (iv *InspectVolumeResp) Unmarshal(data []byte) error

type IsVisitedReq

type IsVisitedReq struct {
	Tx   blobcache.Handle
	CIDs []blobcache.CID
}

func (IsVisitedReq) Marshal

func (ir IsVisitedReq) Marshal(out []byte) []byte

func (*IsVisitedReq) Unmarshal

func (ir *IsVisitedReq) Unmarshal(data []byte) error

type IsVisitedResp

type IsVisitedResp struct {
	Visited blobcache.BitMap
}

func (IsVisitedResp) Marshal

func (ir IsVisitedResp) Marshal(out []byte) []byte

func (*IsVisitedResp) Unmarshal

func (ir *IsVisitedResp) Unmarshal(data []byte) error

type KeepAliveReq

type KeepAliveReq struct {
	Handles []blobcache.Handle
}

func (KeepAliveReq) Marshal

func (kr KeepAliveReq) Marshal(out []byte) []byte

func (*KeepAliveReq) Unmarshal

func (kr *KeepAliveReq) Unmarshal(data []byte) error

type KeepAliveResp

type KeepAliveResp struct{}

func (KeepAliveResp) Marshal

func (kr KeepAliveResp) Marshal(out []byte) []byte

func (*KeepAliveResp) Unmarshal

func (kr *KeepAliveResp) Unmarshal(data []byte) error

type LinkReq

type LinkReq struct {
	Tx     blobcache.Handle
	Subvol blobcache.Handle
	Mask   blobcache.ActionSet
}

func (LinkReq) Marshal

func (ar LinkReq) Marshal(out []byte) []byte

func (*LinkReq) Unmarshal

func (ar *LinkReq) Unmarshal(data []byte) error

type LinkResp

type LinkResp struct {
	Token blobcache.LinkToken
}

func (LinkResp) Marshal

func (ar LinkResp) Marshal(out []byte) []byte

func (*LinkResp) Unmarshal

func (ar *LinkResp) Unmarshal(data []byte) error

type LoadReq

type LoadReq struct {
	Tx blobcache.Handle
}

func (LoadReq) Marshal

func (lr LoadReq) Marshal(out []byte) []byte

func (*LoadReq) Unmarshal

func (lr *LoadReq) Unmarshal(data []byte) error

type LoadResp

type LoadResp struct {
	Root []byte
}

func (LoadResp) Marshal

func (lr LoadResp) Marshal(out []byte) []byte

func (*LoadResp) Unmarshal

func (lr *LoadResp) Unmarshal(data []byte) error

type Marshaller

type Marshaller interface {
	Marshal(out []byte) []byte
}

type Message

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

func NewMessage

func NewMessage(x []byte) Message

func (*Message) Body

func (m *Message) Body() []byte

func (*Message) Header

func (m *Message) Header() MessageHeader

func (*Message) ReadDatagramFrom

func (m *Message) ReadDatagramFrom(r io.Reader, alloc int) error

func (*Message) ReadFrom

func (m *Message) ReadFrom(r io.Reader) (int64, error)

func (*Message) SetBody

func (m *Message) SetBody(body []byte)

func (*Message) SetCode

func (m *Message) SetCode(code MessageCode)

func (*Message) SetError

func (m *Message) SetError(err error)

func (*Message) SetSendable

func (m *Message) SetSendable(x Sendable)

SetSendable sets the body of the message to a Sendable

func (*Message) WriteTo

func (m *Message) WriteTo(w io.Writer) (int64, error)

type MessageCode

type MessageCode uint16
const (
	MT_UNKNOWN MessageCode = iota
	// MT_PING is a request to ping the remote peer.
	MT_PING
	// MT_ENDPOINT is a request for the remote to respond with its Endpoint
	MT_ENDPOINT
	// MT_INSPECT can be used to inspect any object
	MT_INSPECT
	// MT_OPEN_FIAT calls the OpenFiat method.
	MT_OPEN_FIAT
)
const (
	MT_HANDLE_INSPECT MessageCode = (1 * sectionSize) + iota
	MT_HANDLE_DROP
	MT_HANDLE_KEEP_ALIVE
	MT_HANDLE_SHARE_OUT
	MT_HANDLE_SHARE_IN
)

Handle messages

const (
	MT_VOLUME_INSPECT MessageCode = (2 * sectionSize) + iota
	MT_VOLUME_BEGIN_TX
	MT_OPEN_FROM

	MT_CREATE_VOLUME MessageCode = (3 * sectionSize) - 1
)

Volume messages

const (
	MT_TX_INSPECT MessageCode = (3 * sectionSize) + iota

	MT_TX_ABORT
	MT_TX_COMMIT

	MT_TX_LOAD
	MT_TX_SAVE

	MT_TX_POST
	MT_TX_POST_SALT
	MT_TX_GET
	MT_TX_GET_SALT
	MT_TX_EXISTS
	MT_TX_DELETE
	MT_TX_COPY
	MT_TX_LINK
	MT_TX_UNLINK

	MT_TX_VISIT
	MT_TX_IS_VISITED
	MT_TX_VISIT_LINKS
)

Tx messages

const (
	MT_QUEUE_INSPECT MessageCode = (4 * sectionSize) + iota
	MT_QUEUE_ENQUEUE
	MT_QUEUE_DEQUEUE
	MT_QUEUE_SUB_TO_VOLUME

	MT_QUEUE_CREATE MessageCode = (5 * sectionSize) - 1
)

func (MessageCode) IsError

func (mt MessageCode) IsError() bool

func (MessageCode) IsOK

func (mt MessageCode) IsOK() bool

func (MessageCode) ObjectType

func (mt MessageCode) ObjectType() uint8

ObjectType is the first 8 bits on the wire

func (MessageCode) OpCode

func (mt MessageCode) OpCode() uint8

OpCode is the second 8 bits on the wire.

func (*MessageCode) SetObjectType

func (mt *MessageCode) SetObjectType(oc uint8)

func (*MessageCode) SetOpCode

func (mt *MessageCode) SetOpCode(oc uint8)

type MessageHeader

type MessageHeader [HeaderLen]byte

func (MessageHeader) BodyLen

func (h MessageHeader) BodyLen() int

func (MessageHeader) Code

func (h MessageHeader) Code() (ret MessageCode)

func (*MessageHeader) SetBodyLen

func (h *MessageHeader) SetBodyLen(bodyLen int)

func (*MessageHeader) SetCode

func (h *MessageHeader) SetCode(code MessageCode)

type OpenFiatReq

type OpenFiatReq struct {
	Target blobcache.OID
	Mask   blobcache.ActionSet
}

func (OpenFiatReq) Marshal

func (oa OpenFiatReq) Marshal(out []byte) []byte

func (*OpenFiatReq) Unmarshal

func (oa *OpenFiatReq) Unmarshal(data []byte) error

type OpenFiatResp

type OpenFiatResp struct {
	Node   blobcache.NodeID
	Handle blobcache.Handle
	Info   blobcache.Info
}

func (OpenFiatResp) Marshal

func (oa OpenFiatResp) Marshal(out []byte) []byte

func (*OpenFiatResp) Unmarshal

func (oa *OpenFiatResp) Unmarshal(data []byte) error

type OpenFromReq

type OpenFromReq struct {
	Base  blobcache.Handle
	Token blobcache.LinkToken
	Mask  blobcache.ActionSet
}

func (OpenFromReq) Marshal

func (of OpenFromReq) Marshal(out []byte) []byte

func (*OpenFromReq) Unmarshal

func (of *OpenFromReq) Unmarshal(data []byte) error

type OpenFromResp

type OpenFromResp struct {
	Node   blobcache.NodeID
	Handle blobcache.Handle
	Info   blobcache.Info
}

func (OpenFromResp) Marshal

func (of OpenFromResp) Marshal(out []byte) []byte

func (*OpenFromResp) Unmarshal

func (of *OpenFromResp) Unmarshal(data []byte) error

type SaveReq

type SaveReq struct {
	Tx   blobcache.Handle
	Root []byte
}

func (SaveReq) Marshal

func (r SaveReq) Marshal(out []byte) []byte

func (*SaveReq) Unmarshal

func (r *SaveReq) Unmarshal(data []byte) error

type SaveResp

type SaveResp struct{}

func (SaveResp) Marshal

func (r SaveResp) Marshal(out []byte) []byte

func (*SaveResp) Unmarshal

func (r *SaveResp) Unmarshal(data []byte) error

type Sendable

type Sendable interface {
	Marshal(out []byte) []byte
}

Sendable is a type that can be sent in a message

type Server

type Server struct {
	Access AccessFunc
}

func (*Server) ServeBCP

func (s *Server) ServeBCP(ctx context.Context, ep blobcache.Endpoint, req Message, resp *Message) bool

type ShareInReq

type ShareInReq struct {
	Host   blobcache.NodeID
	Handle blobcache.Handle
}

func (ShareInReq) Marshal

func (ar ShareInReq) Marshal(out []byte) []byte

func (*ShareInReq) Unmarshal

func (ar *ShareInReq) Unmarshal(data []byte) error

type ShareInResp

type ShareInResp struct {
	Handle blobcache.Handle
}

func (ShareInResp) Marshal

func (ar ShareInResp) Marshal(out []byte) []byte

func (*ShareInResp) Unmarshal

func (ar *ShareInResp) Unmarshal(data []byte) error

type ShareOutReq

type ShareOutReq struct {
	Handle blobcache.Handle
	Peer   blobcache.NodeID
	Mask   blobcache.ActionSet
}

func (ShareOutReq) Marshal

func (sr ShareOutReq) Marshal(out []byte) []byte

func (*ShareOutReq) Unmarshal

func (sr *ShareOutReq) Unmarshal(data []byte) error

type ShareOutResp

type ShareOutResp struct {
	Handle blobcache.Handle
}

func (ShareOutResp) Marshal

func (sr ShareOutResp) Marshal(out []byte) []byte

func (*ShareOutResp) Unmarshal

func (sr *ShareOutResp) Unmarshal(data []byte) error

type SubToVolumeReq

type SubToVolumeReq struct {
	Queue  blobcache.Handle
	Volume blobcache.Handle
	Spec   blobcache.VolSubSpec
}

func (SubToVolumeReq) Marshal

func (sr SubToVolumeReq) Marshal(out []byte) []byte

func (*SubToVolumeReq) Unmarshal

func (sr *SubToVolumeReq) Unmarshal(data []byte) error

type SubToVolumeResp

type SubToVolumeResp struct{}

func (SubToVolumeResp) Marshal

func (sr SubToVolumeResp) Marshal(out []byte) []byte

func (*SubToVolumeResp) Unmarshal

func (sr *SubToVolumeResp) Unmarshal(data []byte) error

type Teller

type Teller interface {
	Tell(ctx context.Context, remote blobcache.Endpoint, req Message) error
}

type TopicMessage

type TopicMessage = blobcache.Message

type UnlinkReq

type UnlinkReq struct {
	Tx      blobcache.Handle
	Targets []blobcache.LinkID
}

func (UnlinkReq) Marshal

func (ur UnlinkReq) Marshal(out []byte) []byte

func (*UnlinkReq) Unmarshal

func (ur *UnlinkReq) Unmarshal(data []byte) error

type UnlinkResp

type UnlinkResp struct{}

func (UnlinkResp) Marshal

func (ur UnlinkResp) Marshal(out []byte) []byte

func (*UnlinkResp) Unmarshal

func (ur *UnlinkResp) Unmarshal(data []byte) error

type Unmarshaller

type Unmarshaller interface {
	Unmarshal(data []byte) error
}

type VisitLinksReq

type VisitLinksReq struct {
	Tx      blobcache.Handle
	Targets []blobcache.LinkID
}

func (VisitLinksReq) Marshal

func (vr VisitLinksReq) Marshal(out []byte) []byte

func (*VisitLinksReq) Unmarshal

func (vr *VisitLinksReq) Unmarshal(data []byte) error

type VisitLinksResp

type VisitLinksResp struct{}

func (VisitLinksResp) Marshal

func (vr VisitLinksResp) Marshal(out []byte) []byte

func (*VisitLinksResp) Unmarshal

func (vr *VisitLinksResp) Unmarshal(data []byte) error

type VisitReq

type VisitReq struct {
	Tx   blobcache.Handle
	CIDs []blobcache.CID
}

func (VisitReq) Marshal

func (vr VisitReq) Marshal(out []byte) []byte

func (*VisitReq) Unmarshal

func (vr *VisitReq) Unmarshal(data []byte) error

type VisitResp

type VisitResp struct{}

func (VisitResp) Marshal

func (vr VisitResp) Marshal(out []byte) []byte

func (*VisitResp) Unmarshal

func (vr *VisitResp) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

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