Documentation
¶
Overview ¶
Package bcremote implements a blobcache.Service over Blobcache Network Protocol (BCNP). This is useful for applications written in Go, or that have a QUIC implementation.
Index ¶
- type Service
- func (s *Service) Abort(ctx context.Context, tx blobcache.Handle) error
- func (s *Service) AllowLink(ctx context.Context, tx blobcache.Handle, subvol blobcache.Handle) error
- func (s *Service) Await(ctx context.Context, cond blobcache.Conditions) error
- func (s *Service) BeginTx(ctx context.Context, volh blobcache.Handle, txp blobcache.TxParams) (*blobcache.Handle, error)
- func (s *Service) CloneVolume(ctx context.Context, caller *blobcache.PeerID, volh blobcache.Handle) (*blobcache.Handle, error)
- func (s *Service) Close() error
- func (s *Service) Commit(ctx context.Context, tx blobcache.Handle) error
- func (s *Service) Copy(ctx context.Context, tx blobcache.Handle, cids []blobcache.CID, ...) error
- func (s *Service) CreateVolume(ctx context.Context, host *blobcache.Endpoint, vspec blobcache.VolumeSpec) (*blobcache.Handle, error)
- func (s *Service) Delete(ctx context.Context, tx blobcache.Handle, cids []blobcache.CID) error
- func (s *Service) Drop(ctx context.Context, h blobcache.Handle) error
- func (s *Service) Endpoint(ctx context.Context) (blobcache.Endpoint, error)
- func (s *Service) Exists(ctx context.Context, tx blobcache.Handle, cids []blobcache.CID, dst []bool) error
- func (s *Service) Get(ctx context.Context, tx blobcache.Handle, cid blobcache.CID, buf []byte, ...) (int, error)
- func (s *Service) InspectHandle(ctx context.Context, h blobcache.Handle) (*blobcache.HandleInfo, error)
- func (s *Service) InspectTx(ctx context.Context, tx blobcache.Handle) (*blobcache.TxInfo, error)
- func (s *Service) InspectVolume(ctx context.Context, h blobcache.Handle) (*blobcache.VolumeInfo, error)
- func (s *Service) IsVisited(ctx context.Context, tx blobcache.Handle, cids []blobcache.CID, dst []bool) error
- func (s *Service) KeepAlive(ctx context.Context, hs []blobcache.Handle) error
- func (s *Service) Load(ctx context.Context, tx blobcache.Handle, dst *[]byte) error
- func (s *Service) OpenFiat(ctx context.Context, target blobcache.OID, mask blobcache.ActionSet) (*blobcache.Handle, error)
- func (s *Service) OpenFrom(ctx context.Context, base blobcache.Handle, target blobcache.OID, ...) (*blobcache.Handle, error)
- func (s *Service) Post(ctx context.Context, tx blobcache.Handle, data []byte, opts blobcache.PostOpts) (blobcache.CID, error)
- func (s *Service) Save(ctx context.Context, tx blobcache.Handle, src []byte) error
- func (s *Service) Share(ctx context.Context, h blobcache.Handle, to blobcache.PeerID, ...) (*blobcache.Handle, error)
- func (s *Service) Visit(ctx context.Context, tx blobcache.Handle, cids []blobcache.CID) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func Dial ¶
Dial starts listening via UDP on any available port, then calls New to create a Service.
func New ¶
func New(privateKey ed25519.PrivateKey, pc net.PacketConn, ep blobcache.Endpoint) *Service
New creates a Service, which is implemented remotely. Endpoint describes the service to connect to. Connections will be established out of pc. privateKey is used to authenticate to the service.
func (*Service) AllowLink ¶
func (s *Service) AllowLink(ctx context.Context, tx blobcache.Handle, subvol blobcache.Handle) error
AllowLink allows the Volume to reference another volume.
func (*Service) CloneVolume ¶
func (*Service) CreateVolume ¶
func (s *Service) CreateVolume(ctx context.Context, host *blobcache.Endpoint, vspec blobcache.VolumeSpec) (*blobcache.Handle, error)
CreateVolume creates a new volume.
func (*Service) Exists ¶
func (s *Service) Exists(ctx context.Context, tx blobcache.Handle, cids []blobcache.CID, dst []bool) error
Exists checks if a CID exists in the volume
func (*Service) Get ¶
func (s *Service) Get(ctx context.Context, tx blobcache.Handle, cid blobcache.CID, buf []byte, opts blobcache.GetOpts) (int, error)
Get returns the data for a CID.
func (*Service) InspectHandle ¶
func (*Service) InspectVolume ¶
func (s *Service) InspectVolume(ctx context.Context, h blobcache.Handle) (*blobcache.VolumeInfo, error)
InspectVolume returns info about a Volume.
func (*Service) Post ¶
func (s *Service) Post(ctx context.Context, tx blobcache.Handle, data []byte, opts blobcache.PostOpts) (blobcache.CID, error)
Post posts data to the volume