storage

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentReader

type ContentReader interface {
	Read(ctx context.Context, cid cid.Cid) ([]byte, error)
}

type ContentStorage

type ContentStorage interface {
	ContentReader
	ContentWriter
}

type ContentWriter

type ContentWriter interface {
	Write(ctx context.Context, content []byte, cid cid.Cid) error
}

type MessageReader

type MessageReader interface {
	Read(ctx context.Context, cid cid.Cid) (ProtoUnmarshallable, error)
}

type MessageStorage

type MessageStorage interface {
	MessageReader
	MessageWriter
}

type MessageWriter

type MessageWriter interface {
	Write(ctx context.Context, message proto.Message) (cid.Cid, error)
}

type ProtoMessageStorage

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

func NewProtoMessageStorage

func NewProtoMessageStorage(contentStorage ContentStorage) *ProtoMessageStorage

func (*ProtoMessageStorage) Read

func (*ProtoMessageStorage) Write

func (p *ProtoMessageStorage) Write(ctx context.Context, message proto.Message) (cid.Cid, error)

type ProtoUnmarshallable

type ProtoUnmarshallable interface {
	Unmarshall(message proto.Message) error
}

ProtoUnmarshallable can be used to deserialize message data to proto structure

Directories

Path Synopsis
Package ipfs provides storage using InterPlanetary file system.
Package ipfs provides storage using InterPlanetary file system.

Jump to

Keyboard shortcuts

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