Documentation ¶
Index ¶
- Constants
- func BitSwap_Methods(methods []server.Method, s BitSwap_Server) []server.Method
- func BitSwap_NewServer(s BitSwap_Server) *server.Server
- func RegisterSchema(reg *schemas.Registry)
- type BitSwap
- func (c BitSwap) AddRef() BitSwap
- func (BitSwap) DecodeFromPtr(p capnp.Ptr) BitSwap
- func (c BitSwap) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr
- func (c BitSwap) GetBlock(ctx context.Context, params func(BitSwap_getBlock_Params) error) (BitSwap_getBlock_Results_Future, capnp.ReleaseFunc)
- func (c BitSwap) GetFlowLimiter() fc.FlowLimiter
- func (c BitSwap) IsSame(other BitSwap) bool
- func (c BitSwap) IsValid() bool
- func (c BitSwap) Release()
- func (c BitSwap) Resolve(ctx context.Context) error
- func (c BitSwap) SetFlowLimiter(lim fc.FlowLimiter)
- func (c BitSwap) String() string
- func (c BitSwap) WaitStreaming() error
- type BitSwap_List
- type BitSwap_Server
- type BitSwap_getBlock
- type BitSwap_getBlock_Params
- func (BitSwap_getBlock_Params) DecodeFromPtr(p capnp.Ptr) BitSwap_getBlock_Params
- func (s BitSwap_getBlock_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr
- func (s BitSwap_getBlock_Params) HasKey() bool
- func (s BitSwap_getBlock_Params) IsValid() bool
- func (s BitSwap_getBlock_Params) Key() ([]byte, error)
- func (s BitSwap_getBlock_Params) Message() *capnp.Message
- func (s BitSwap_getBlock_Params) Segment() *capnp.Segment
- func (s BitSwap_getBlock_Params) SetKey(v []byte) error
- func (s BitSwap_getBlock_Params) String() string
- func (s BitSwap_getBlock_Params) ToPtr() capnp.Ptr
- type BitSwap_getBlock_Params_Future
- type BitSwap_getBlock_Params_List
- type BitSwap_getBlock_Results
- func (s BitSwap_getBlock_Results) Block() ([]byte, error)
- func (BitSwap_getBlock_Results) DecodeFromPtr(p capnp.Ptr) BitSwap_getBlock_Results
- func (s BitSwap_getBlock_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr
- func (s BitSwap_getBlock_Results) HasBlock() bool
- func (s BitSwap_getBlock_Results) IsValid() bool
- func (s BitSwap_getBlock_Results) Message() *capnp.Message
- func (s BitSwap_getBlock_Results) Segment() *capnp.Segment
- func (s BitSwap_getBlock_Results) SetBlock(v []byte) error
- func (s BitSwap_getBlock_Results) String() string
- func (s BitSwap_getBlock_Results) ToPtr() capnp.Ptr
- type BitSwap_getBlock_Results_Future
- type BitSwap_getBlock_Results_List
Constants ¶
const BitSwap_TypeID = 0x845db065edc3ea8a
BitSwap_TypeID is the unique identifier for the type BitSwap.
const BitSwap_getBlock_Params_TypeID = 0xf9e9def5d682adfa
BitSwap_getBlock_Params_TypeID is the unique identifier for the type BitSwap_getBlock_Params.
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 ¶
Types ¶
type BitSwap ¶
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 ¶
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) GetBlock ¶
func (c BitSwap) GetBlock(ctx context.Context, params func(BitSwap_getBlock_Params) error) (BitSwap_getBlock_Results_Future, capnp.ReleaseFunc)
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
type BitSwap_List ¶
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 ¶
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 ¶
func (c BitSwap_getBlock) Args() BitSwap_getBlock_Params
Args returns the call's arguments.
type BitSwap_getBlock_Params ¶
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) DecodeFromPtr(p capnp.Ptr) BitSwap_getBlock_Params
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 ¶
BitSwap_getBlock_Params_Future is a wrapper for a BitSwap_getBlock_Params promised by a client call.
func (BitSwap_getBlock_Params_Future) Struct ¶
func (f BitSwap_getBlock_Params_Future) Struct() (BitSwap_getBlock_Params, error)
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 ¶
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) DecodeFromPtr(p capnp.Ptr) BitSwap_getBlock_Results
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 ¶
func (s BitSwap_getBlock_Results) ToPtr() capnp.Ptr
type BitSwap_getBlock_Results_Future ¶
BitSwap_getBlock_Results_Future is a wrapper for a BitSwap_getBlock_Results promised by a client call.
func (BitSwap_getBlock_Results_Future) Struct ¶
func (f BitSwap_getBlock_Results_Future) Struct() (BitSwap_getBlock_Results, error)
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.