v0

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FinderProtocolID is the libp2p protocol that finder API uses
	FinderProtocolID protocol.ID = "/indexer/finder/0.0.1"
	// IngestProtocolID is the libp2p protocol that ingest API uses
	IngestProtocolID protocol.ID = "/indexer/ingest/0.0.1"
)

Variables

This section is empty.

Functions

func DecodeError

func DecodeError(data []byte) error

func EncodeError

func EncodeError(err error) []byte

Types

type ErrInvalidMetadata

type ErrInvalidMetadata struct {
	Message string
}

func (ErrInvalidMetadata) Error

func (e ErrInvalidMetadata) Error() string

type Error

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

Error is the type of error used when it is necessary to convey a specific status code so that it can be handled correctly higher in the call stack.

For example, differentiating between a bad request and an internal server error allows a server to determine whether the error should be returned to a client or not.

func NewError added in v0.2.0

func NewError(err error, status int) *Error

func (*Error) Error added in v0.2.0

func (e *Error) Error() string

func (*Error) Status

func (e *Error) Status() int

func (*Error) Text added in v0.2.0

func (e *Error) Text() string

func (*Error) Unwrap added in v0.2.0

func (e *Error) Unwrap() error

type ErrorMessage added in v0.2.0

type ErrorMessage struct {
	Message string `json:",omitempty"`
	Status  int    `json:",omitempty"`
}

type Metadata

type Metadata struct {
	// ProtocolID defines the protocol used for data retrieval.
	ProtocolID multicodec.Code
	// Data is specific to the identified protocol, and provides data, or a
	// link to data, necessary for retrieval.
	Data []byte
}

Metadata is data that provides information about retrieving data for an index, from a particular provider.

func (Metadata) Equal

func (m Metadata) Equal(other Metadata) bool

Equal determines if two Metadata values are equal.

func (Metadata) MarshalBinary

func (m Metadata) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*Metadata) UnmarshalBinary

func (m *Metadata) UnmarshalBinary(data []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

Directories

Path Synopsis
admin
finder
pb
ingest
pb
schema
Package schema defines the makeup of an advertisement.
Package schema defines the makeup of an advertisement.
Package libp2pclient provides general libp2p client functionality This package supplies functionality to communicate raw data with libp2p peers, and is useful when building higher-level client that are responsible for processing the data send and and received using this package.
Package libp2pclient provides general libp2p client functionality This package supplies functionality to communicate raw data with libp2p peers, and is useful when building higher-level client that are responsible for processing the data send and and received using this package.

Jump to

Keyboard shortcuts

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