coap

package
v0.0.0-...-64f8be3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleGet

func HandleGet(store eris.Store, w mux.ResponseWriter, r *mux.Message)

func HandlePut

func HandlePut(store eris.Store, w mux.ResponseWriter, r *mux.Message)

Types

type Endpoint

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

func NewEndpoint

func NewEndpoint(store eris.Store) (ep *Endpoint)

Create a new CoAP endpoint that serves ERIS blocks from the given store.

func NewMulticastClient

func NewMulticastClient(ctx context.Context, store eris.Store) (ep *Endpoint, err error)

Create a new CoAP client that attemps multicast peers discovery on all interfaces. The passed store is used to respond to peer requests and may be nil.

func (*Endpoint) AddPeer

func (ep *Endpoint) AddPeer(host, port string, allow eris.AllowOps) (err error)

func (*Endpoint) Allowed

func (store *Endpoint) Allowed() eris.AllowOps

func (*Endpoint) Close

func (ep *Endpoint) Close() (err error)

Close the CoAP endpoint. The internal store is not closed.

func (*Endpoint) Drop

func (ep *Endpoint) Drop(ref eris.Ref) error

func (*Endpoint) Get

func (ep *Endpoint) Get(ctx context.Context, chunk []byte, ref eris.Ref) (err error)

func (*Endpoint) Has

func (ep *Endpoint) Has(ctx context.Context, ref eris.Ref, chunkSize int) bool

Check if the CoAP endpoint internal store has a chunk.

func (*Endpoint) Put

func (ep *Endpoint) Put(ctx context.Context, chunk []byte, ref eris.Ref) (err error)

Put a block to

func (ep *Endpoint) ServeMulticastLink(face string, allow eris.AllowOps) error

func (*Endpoint) ServeMulticastSite

func (ep *Endpoint) ServeMulticastSite(face string, allow eris.AllowOps) error

func (*Endpoint) ServeUnicast

func (ep *Endpoint) ServeUnicast(host, port string, allow eris.AllowOps) (err error)

Jump to

Keyboard shortcuts

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