coap

package
v0.0.0-...-bc42473 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCoapHandler

func NewCoapHandler(store eris.Store) (r *mux.Router)

func ServeCoap

func ServeCoap(network, address string, store eris.Store) error

Serve an ERIS store over CoAP. The network parameter may specify "udp" or "tcp" with an optional "4" or "6" suffix.

Types

type CoapStore

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

func NewClient

func NewClient(u *url.URL) (store *CoapStore, err error)

func NewTcpClient

func NewTcpClient(host, erisPath string, share eris.Store) (store *CoapStore, err error)

func (*CoapStore) Allowed

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

func (*CoapStore) Close

func (store *CoapStore) Close() (err error)

func (*CoapStore) Drop

func (server *CoapStore) Drop(ref eris.Ref) error

func (*CoapStore) Get

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

func (*CoapStore) Has

func (store *CoapStore) Has(ctx context.Context, ref eris.Ref, chunkSize int) (present bool)

func (*CoapStore) Put

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

type CoapTcpServer

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

func NewTcpServer

func NewTcpServer(store eris.Store) (s *CoapTcpServer)

func (*CoapTcpServer) Allowed

func (server *CoapTcpServer) Allowed() eris.AllowOps

func (*CoapTcpServer) Close

func (server *CoapTcpServer) Close() (err error)

This Close method is a no-op.

func (*CoapTcpServer) Drop

func (server *CoapTcpServer) Drop(ref eris.Ref) error

func (*CoapTcpServer) Get

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

Get a chunk from a CoapTcpServer. The chunk is requested from the backend storage and if this fails then the chunk is requested from the other clients of the server.

func (*CoapTcpServer) Has

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

func (*CoapTcpServer) Put

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

func (*CoapTcpServer) Serve

func (s *CoapTcpServer) Serve(network, address string) error

func (*CoapTcpServer) Stop

func (s *CoapTcpServer) Stop()

type CoapUdpServer

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

func NewUdpServer

func NewUdpServer(store eris.Store) *CoapUdpServer

func (*CoapUdpServer) Serve

func (s *CoapUdpServer) Serve(network, address string) error

func (*CoapUdpServer) Stop

func (s *CoapUdpServer) Stop()

Jump to

Keyboard shortcuts

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