bitswap

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const BitSwap_TypeID = 0x845db065edc3ea8a

BitSwap_TypeID is the unique identifier for the type BitSwap.

View Source
const BitSwap_getBlock_Params_TypeID = 0xf9e9def5d682adfa

BitSwap_getBlock_Params_TypeID is the unique identifier for the type BitSwap_getBlock_Params.

View Source
const BitSwap_getBlock_Results_TypeID = 0xb5d24de3300e4367

BitSwap_getBlock_Results_TypeID is the unique identifier for the type BitSwap_getBlock_Results.

Variables

This section is empty.

Functions

func BitSwap_Methods

func BitSwap_Methods(methods []server.Method, s BitSwap_Server) []server.Method

BitSwap_Methods appends Methods to a slice that invoke the methods on s. This can be used to create a more complicated Server.

func BitSwap_NewServer

func BitSwap_NewServer(s BitSwap_Server) *server.Server

BitSwap_NewServer creates a new Server from an implementation of BitSwap_Server.

func RegisterSchema

func RegisterSchema(reg *schemas.Registry)

Types

type BitSwap

type BitSwap capnp.Client

func BitSwap_ServerToClient

func BitSwap_ServerToClient(s BitSwap_Server) BitSwap

BitSwap_ServerToClient creates a new Client from an implementation of BitSwap_Server. The caller is responsible for calling Release on the returned Client.

func (BitSwap) AddRef

func (c BitSwap) AddRef() BitSwap

AddRef creates a new Client that refers to the same capability as c. If c is nil or has resolved to null, then AddRef returns nil.

func (BitSwap) DecodeFromPtr

func (BitSwap) DecodeFromPtr(p capnp.Ptr) BitSwap

func (BitSwap) EncodeAsPtr

func (c BitSwap) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr

func (BitSwap) GetFlowLimiter

func (c BitSwap) GetFlowLimiter() fc.FlowLimiter

Get the current flowcontrol.FlowLimiter used to manage flow control for this client.

func (BitSwap) IsSame

func (c BitSwap) IsSame(other BitSwap) bool

IsSame reports whether c and other refer to a capability created by the same call to NewClient. This can return false negatives if c or other are not fully resolved: use Resolve if this is an issue. If either c or other are released, then IsSame panics.

func (BitSwap) IsValid

func (c BitSwap) IsValid() bool

IsValid reports whether c is a valid reference to a capability. A reference is invalid if it is nil, has resolved to null, or has been released.

func (BitSwap) Release

func (c BitSwap) Release()

Release releases a capability reference. If this is the last reference to the capability, then the underlying resources associated with the capability will be released.

Release will panic if c has already been released, but not if c is nil or resolved to null.

func (BitSwap) Resolve

func (c BitSwap) Resolve(ctx context.Context) error

Resolve blocks until the capability is fully resolved or the Context expires.

func (BitSwap) SetFlowLimiter

func (c BitSwap) SetFlowLimiter(lim fc.FlowLimiter)

Update the flowcontrol.FlowLimiter used to manage flow control for this client. This affects all future calls, but not calls already waiting to send. Passing nil sets the value to flowcontrol.NopLimiter, which is also the default.

func (BitSwap) String

func (c BitSwap) String() string

String returns a string that identifies this capability for debugging purposes. Its format should not be depended on: in particular, it should not be used to compare clients. Use IsSame to compare clients for equality.

func (BitSwap) WaitStreaming

func (c BitSwap) WaitStreaming() error

type BitSwap_List

type BitSwap_List = capnp.CapList[BitSwap]

BitSwap_List is a list of BitSwap.

func NewBitSwap_List

func NewBitSwap_List(s *capnp.Segment, sz int32) (BitSwap_List, error)

NewBitSwap creates a new list of BitSwap.

type BitSwap_Server

type BitSwap_Server interface {
	GetBlock(context.Context, BitSwap_getBlock) error
}

A BitSwap_Server is a BitSwap with a local implementation.

type BitSwap_getBlock

type BitSwap_getBlock struct {
	*server.Call
}

BitSwap_getBlock holds the state for a server call to BitSwap.getBlock. See server.Call for documentation.

func (BitSwap_getBlock) AllocResults

func (c BitSwap_getBlock) AllocResults() (BitSwap_getBlock_Results, error)

AllocResults allocates the results struct.

func (BitSwap_getBlock) Args

Args returns the call's arguments.

type BitSwap_getBlock_Params

type BitSwap_getBlock_Params capnp.Struct

func NewBitSwap_getBlock_Params

func NewBitSwap_getBlock_Params(s *capnp.Segment) (BitSwap_getBlock_Params, error)

func NewRootBitSwap_getBlock_Params

func NewRootBitSwap_getBlock_Params(s *capnp.Segment) (BitSwap_getBlock_Params, error)

func ReadRootBitSwap_getBlock_Params

func ReadRootBitSwap_getBlock_Params(msg *capnp.Message) (BitSwap_getBlock_Params, error)

func (BitSwap_getBlock_Params) DecodeFromPtr

func (BitSwap_getBlock_Params) EncodeAsPtr

func (s BitSwap_getBlock_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr

func (BitSwap_getBlock_Params) HasKey

func (s BitSwap_getBlock_Params) HasKey() bool

func (BitSwap_getBlock_Params) IsValid

func (s BitSwap_getBlock_Params) IsValid() bool

func (BitSwap_getBlock_Params) Key

func (s BitSwap_getBlock_Params) Key() ([]byte, error)

func (BitSwap_getBlock_Params) Message

func (s BitSwap_getBlock_Params) Message() *capnp.Message

func (BitSwap_getBlock_Params) Segment

func (s BitSwap_getBlock_Params) Segment() *capnp.Segment

func (BitSwap_getBlock_Params) SetKey

func (s BitSwap_getBlock_Params) SetKey(v []byte) error

func (BitSwap_getBlock_Params) String

func (s BitSwap_getBlock_Params) String() string

func (BitSwap_getBlock_Params) ToPtr

func (s BitSwap_getBlock_Params) ToPtr() capnp.Ptr

type BitSwap_getBlock_Params_Future

type BitSwap_getBlock_Params_Future struct{ *capnp.Future }

BitSwap_getBlock_Params_Future is a wrapper for a BitSwap_getBlock_Params promised by a client call.

func (BitSwap_getBlock_Params_Future) Struct

type BitSwap_getBlock_Params_List

type BitSwap_getBlock_Params_List = capnp.StructList[BitSwap_getBlock_Params]

BitSwap_getBlock_Params_List is a list of BitSwap_getBlock_Params.

func NewBitSwap_getBlock_Params_List

func NewBitSwap_getBlock_Params_List(s *capnp.Segment, sz int32) (BitSwap_getBlock_Params_List, error)

NewBitSwap_getBlock_Params creates a new list of BitSwap_getBlock_Params.

type BitSwap_getBlock_Results

type BitSwap_getBlock_Results capnp.Struct

func NewBitSwap_getBlock_Results

func NewBitSwap_getBlock_Results(s *capnp.Segment) (BitSwap_getBlock_Results, error)

func NewRootBitSwap_getBlock_Results

func NewRootBitSwap_getBlock_Results(s *capnp.Segment) (BitSwap_getBlock_Results, error)

func ReadRootBitSwap_getBlock_Results

func ReadRootBitSwap_getBlock_Results(msg *capnp.Message) (BitSwap_getBlock_Results, error)

func (BitSwap_getBlock_Results) Block

func (s BitSwap_getBlock_Results) Block() ([]byte, error)

func (BitSwap_getBlock_Results) DecodeFromPtr

func (BitSwap_getBlock_Results) EncodeAsPtr

func (s BitSwap_getBlock_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr

func (BitSwap_getBlock_Results) HasBlock

func (s BitSwap_getBlock_Results) HasBlock() bool

func (BitSwap_getBlock_Results) IsValid

func (s BitSwap_getBlock_Results) IsValid() bool

func (BitSwap_getBlock_Results) Message

func (s BitSwap_getBlock_Results) Message() *capnp.Message

func (BitSwap_getBlock_Results) Segment

func (s BitSwap_getBlock_Results) Segment() *capnp.Segment

func (BitSwap_getBlock_Results) SetBlock

func (s BitSwap_getBlock_Results) SetBlock(v []byte) error

func (BitSwap_getBlock_Results) String

func (s BitSwap_getBlock_Results) String() string

func (BitSwap_getBlock_Results) ToPtr

type BitSwap_getBlock_Results_Future

type BitSwap_getBlock_Results_Future struct{ *capnp.Future }

BitSwap_getBlock_Results_Future is a wrapper for a BitSwap_getBlock_Results promised by a client call.

func (BitSwap_getBlock_Results_Future) Struct

type BitSwap_getBlock_Results_List

type BitSwap_getBlock_Results_List = capnp.StructList[BitSwap_getBlock_Results]

BitSwap_getBlock_Results_List is a list of BitSwap_getBlock_Results.

func NewBitSwap_getBlock_Results_List

func NewBitSwap_getBlock_Results_List(s *capnp.Segment, sz int32) (BitSwap_getBlock_Results_List, error)

NewBitSwap_getBlock_Results creates a new list of BitSwap_getBlock_Results.

Jump to

Keyboard shortcuts

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