dots_common

package
v0.0.0-...-dd13c3c Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_CLIENT_SOCKET_FILE  = "/tmp/dots_client.sock"
	DEFAULT_SIGNAL_CHANNEL_PORT = 4646
	DEFAULT_DATA_CHANNEL_PORT   = 4647

	DEFAULT_SIGNAL_MITIGATE_LIFETIME = 3600
)
View Source
const (
	IPV4_HOST_PREFIX_LEN = "/32"
	IPV6_HOST_PREFIX_LEN = "/128"
)
View Source
const SCHEMA_DIR string = "schemas"
View Source
const (
	SERVICE_WORKER_QUEUE_SIZE = 10
)

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func NewCborHandle

func NewCborHandle() *codec.CborHandle

func RandStringBytes

func RandStringBytes(n int) []byte

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func SetUpLogger

func SetUpLogger()

func ValidateJson

func ValidateJson(schemaName string, request string) error

* validate the Json strings.

Types

type Code

type Code uint8

*CoAP message codes.

const (
	Created               Code = 65
	Deleted               Code = 66
	Valid                 Code = 67
	Changed               Code = 68
	Content               Code = 69
	Limit2xxCode          Code = 100
	BadRequest            Code = 128
	Unauthorized          Code = 129
	BadOption             Code = 130
	Forbidden             Code = 131
	NotFound              Code = 132
	MethodNotAllowed      Code = 133
	NotAcceptable         Code = 134
	Conflict              Code = 137
	PreconditionFailed    Code = 140
	RequestEntityTooLarge Code = 141
	UnsupportedMediaType  Code = 143
	UnprocessableEntity   Code = 150
	InternalServerError   Code = 160
	NotImplemented        Code = 161
	BadGateway            Code = 162
	ServiceUnavailable    Code = 163
	GatewayTimeout        Code = 164
	ProxyingNotSupported  Code = 165
)

func (Code) CoAPCode

func (c Code) CoAPCode() libcoap.Code

* CoAPCode is a function to obtain given CoAP codes.

func (Code) String

func (c Code) String() string

convert CoAP types to strings.

type LogLevel

type LogLevel int

type Type

type Type uint8

* CoAP message types

const (
	Confirmable     Type = 0
	NonConfirmable  Type = 1
	Acknowledgement Type = 2
	Reset           Type = 3
)

func (Type) CoAPType

func (t Type) CoAPType() libcoap.Type

* CoAPType is a function to obtain given CoAP types.

Directories

Path Synopsis
types

Jump to

Keyboard shortcuts

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