api

package
v0.0.0-...-2f095fc Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2016 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package api is a generated protocol buffer package.

It is generated from these files:

github.com/TheThingsNetwork/ttn/api/api.proto

It has these top-level messages:

Percentiles
Rates
SystemStats
ComponentStats

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowApi   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrContext = errors.NewErrInternal("Could not get metadata from context")
	ErrNoToken = errors.NewErrInvalidArgument("Metadata", "token missing")
	ErrNoKey   = errors.NewErrInvalidArgument("Metadata", "key missing")
	ErrNoID    = errors.NewErrInvalidArgument("Metadata", "id missing")
)

Errors that are returned when an item could not be retrieved

View Source
var Backoff = 1 * time.Second

Backoff indicates how long a client should wait between failed requests

View Source
var DialOptions = []grpc.DialOption{
	WithKeepAliveDialer(),
}

DialOptions to use in TTN gRPC

View Source
var KeepAlive = 10 * time.Second

KeepAlive indicates the keep-alive time for the Dialer

Functions

func DialWithCert

func DialWithCert(address string, cert string) (*grpc.ClientConn, error)

DialWithCert dials the address using the given TLS root cert

func IDFromContext

func IDFromContext(ctx context.Context) (token string, err error)

func IDFromMetadata

func IDFromMetadata(md metadata.MD) (string, error)

func KeyFromContext

func KeyFromContext(ctx context.Context) (key string, err error)

func KeyFromMetadata

func KeyFromMetadata(md metadata.MD) (string, error)

func MetadataFromContext

func MetadataFromContext(ctx context.Context) (metadata.MD, error)

func NotEmptyAndValidId

func NotEmptyAndValidId(id string, argument string) error

func NotNilAndValid

func NotNilAndValid(in interface{}, argument string) error

func SetLogger

func SetLogger(log Logger)

SetLogger returns the API Logger

func TokenFromContext

func TokenFromContext(ctx context.Context) (token string, err error)

func TokenFromMetadata

func TokenFromMetadata(md metadata.MD) (string, error)

func ValidID

func ValidID(id string) bool

ValidID returns true if the given ID is a valid application or device ID

func Validate

func Validate(in interface{}) error

Validate the given object if it implements the Validator interface Must not be called with nil values!

func WithKeepAliveDialer

func WithKeepAliveDialer() grpc.DialOption

WithKeepAliveDialer creates a dialer with the configured KeepAlive time

Types

type ComponentStats

type ComponentStats struct {
	Cpu           *ComponentStats_CPUStats    `protobuf:"bytes,1,opt,name=cpu" json:"cpu,omitempty"`
	Memory        *ComponentStats_MemoryStats `protobuf:"bytes,3,opt,name=memory" json:"memory,omitempty"`
	Goroutines    uint64                      `protobuf:"varint,4,opt,name=goroutines,proto3" json:"goroutines,omitempty"`
	GcCpuFraction float32                     `protobuf:"fixed32,5,opt,name=gc_cpu_fraction,json=gcCpuFraction,proto3" json:"gc_cpu_fraction,omitempty"`
}

func GetComponentStats

func GetComponentStats() *ComponentStats

GetComponentStats gets statistics about this component

func (*ComponentStats) Descriptor

func (*ComponentStats) Descriptor() ([]byte, []int)

func (*ComponentStats) GetCpu

func (*ComponentStats) GetMemory

func (*ComponentStats) Marshal

func (m *ComponentStats) Marshal() (dAtA []byte, err error)

func (*ComponentStats) MarshalTo

func (m *ComponentStats) MarshalTo(dAtA []byte) (int, error)

func (*ComponentStats) ProtoMessage

func (*ComponentStats) ProtoMessage()

func (*ComponentStats) Reset

func (m *ComponentStats) Reset()

func (*ComponentStats) Size

func (m *ComponentStats) Size() (n int)

func (*ComponentStats) String

func (m *ComponentStats) String() string

func (*ComponentStats) Unmarshal

func (m *ComponentStats) Unmarshal(dAtA []byte) error

type ComponentStats_CPUStats

type ComponentStats_CPUStats struct {
	User   float32 `protobuf:"fixed32,1,opt,name=user,proto3" json:"user,omitempty"`
	System float32 `protobuf:"fixed32,2,opt,name=system,proto3" json:"system,omitempty"`
	Idle   float32 `protobuf:"fixed32,3,opt,name=idle,proto3" json:"idle,omitempty"`
}

func (*ComponentStats_CPUStats) Descriptor

func (*ComponentStats_CPUStats) Descriptor() ([]byte, []int)

func (*ComponentStats_CPUStats) Marshal

func (m *ComponentStats_CPUStats) Marshal() (dAtA []byte, err error)

func (*ComponentStats_CPUStats) MarshalTo

func (m *ComponentStats_CPUStats) MarshalTo(dAtA []byte) (int, error)

func (*ComponentStats_CPUStats) ProtoMessage

func (*ComponentStats_CPUStats) ProtoMessage()

func (*ComponentStats_CPUStats) Reset

func (m *ComponentStats_CPUStats) Reset()

func (*ComponentStats_CPUStats) Size

func (m *ComponentStats_CPUStats) Size() (n int)

func (*ComponentStats_CPUStats) String

func (m *ComponentStats_CPUStats) String() string

func (*ComponentStats_CPUStats) Unmarshal

func (m *ComponentStats_CPUStats) Unmarshal(dAtA []byte) error

type ComponentStats_MemoryStats

type ComponentStats_MemoryStats struct {
	Memory uint64 `protobuf:"varint,1,opt,name=memory,proto3" json:"memory,omitempty"`
	Swap   uint64 `protobuf:"varint,2,opt,name=swap,proto3" json:"swap,omitempty"`
}

func (*ComponentStats_MemoryStats) Descriptor

func (*ComponentStats_MemoryStats) Descriptor() ([]byte, []int)

func (*ComponentStats_MemoryStats) Marshal

func (m *ComponentStats_MemoryStats) Marshal() (dAtA []byte, err error)

func (*ComponentStats_MemoryStats) MarshalTo

func (m *ComponentStats_MemoryStats) MarshalTo(dAtA []byte) (int, error)

func (*ComponentStats_MemoryStats) ProtoMessage

func (*ComponentStats_MemoryStats) ProtoMessage()

func (*ComponentStats_MemoryStats) Reset

func (m *ComponentStats_MemoryStats) Reset()

func (*ComponentStats_MemoryStats) Size

func (m *ComponentStats_MemoryStats) Size() (n int)

func (*ComponentStats_MemoryStats) String

func (m *ComponentStats_MemoryStats) String() string

func (*ComponentStats_MemoryStats) Unmarshal

func (m *ComponentStats_MemoryStats) Unmarshal(dAtA []byte) error

type Logger

type Logger interface {
	Debug(msg string)
	Info(msg string)
	Warn(msg string)
	Error(msg string)
	Fatal(msg string)
	Debugf(msg string, v ...interface{})
	Infof(msg string, v ...interface{})
	Warnf(msg string, v ...interface{})
	Errorf(msg string, v ...interface{})
	Fatalf(msg string, v ...interface{})
}

Logger used in mqtt package

func GetLogger

func GetLogger() Logger

GetLogger returns the API Logger

type Percentiles

type Percentiles struct {
	Percentile1  float32 `protobuf:"fixed32,1,opt,name=percentile1,proto3" json:"percentile1,omitempty"`
	Percentile5  float32 `protobuf:"fixed32,2,opt,name=percentile5,proto3" json:"percentile5,omitempty"`
	Percentile10 float32 `protobuf:"fixed32,3,opt,name=percentile10,proto3" json:"percentile10,omitempty"`
	Percentile25 float32 `protobuf:"fixed32,4,opt,name=percentile25,proto3" json:"percentile25,omitempty"`
	Percentile50 float32 `protobuf:"fixed32,5,opt,name=percentile50,proto3" json:"percentile50,omitempty"`
	Percentile75 float32 `protobuf:"fixed32,6,opt,name=percentile75,proto3" json:"percentile75,omitempty"`
	Percentile90 float32 `protobuf:"fixed32,7,opt,name=percentile90,proto3" json:"percentile90,omitempty"`
	Percentile95 float32 `protobuf:"fixed32,8,opt,name=percentile95,proto3" json:"percentile95,omitempty"`
	Percentile99 float32 `protobuf:"fixed32,9,opt,name=percentile99,proto3" json:"percentile99,omitempty"`
}

func (*Percentiles) Descriptor

func (*Percentiles) Descriptor() ([]byte, []int)

func (*Percentiles) Marshal

func (m *Percentiles) Marshal() (dAtA []byte, err error)

func (*Percentiles) MarshalTo

func (m *Percentiles) MarshalTo(dAtA []byte) (int, error)

func (*Percentiles) ProtoMessage

func (*Percentiles) ProtoMessage()

func (*Percentiles) Reset

func (m *Percentiles) Reset()

func (*Percentiles) Size

func (m *Percentiles) Size() (n int)

func (*Percentiles) String

func (m *Percentiles) String() string

func (*Percentiles) Unmarshal

func (m *Percentiles) Unmarshal(dAtA []byte) error

type Rates

type Rates struct {
	Rate1  float32 `protobuf:"fixed32,1,opt,name=rate1,proto3" json:"rate1,omitempty"`
	Rate5  float32 `protobuf:"fixed32,2,opt,name=rate5,proto3" json:"rate5,omitempty"`
	Rate15 float32 `protobuf:"fixed32,3,opt,name=rate15,proto3" json:"rate15,omitempty"`
}

func (*Rates) Descriptor

func (*Rates) Descriptor() ([]byte, []int)

func (*Rates) Marshal

func (m *Rates) Marshal() (dAtA []byte, err error)

func (*Rates) MarshalTo

func (m *Rates) MarshalTo(dAtA []byte) (int, error)

func (*Rates) ProtoMessage

func (*Rates) ProtoMessage()

func (*Rates) Reset

func (m *Rates) Reset()

func (*Rates) Size

func (m *Rates) Size() (n int)

func (*Rates) String

func (m *Rates) String() string

func (*Rates) Unmarshal

func (m *Rates) Unmarshal(dAtA []byte) error

type SystemStats

type SystemStats struct {
	Load   *SystemStats_Loadstats   `protobuf:"bytes,1,opt,name=load" json:"load,omitempty"`
	Cpu    *SystemStats_CPUStats    `protobuf:"bytes,2,opt,name=cpu" json:"cpu,omitempty"`
	Memory *SystemStats_MemoryStats `protobuf:"bytes,3,opt,name=memory" json:"memory,omitempty"`
}

func GetSystemStats

func GetSystemStats() *SystemStats

GetSystemStats gets statistics about the system

func (*SystemStats) Descriptor

func (*SystemStats) Descriptor() ([]byte, []int)

func (*SystemStats) GetCpu

func (m *SystemStats) GetCpu() *SystemStats_CPUStats

func (*SystemStats) GetLoad

func (m *SystemStats) GetLoad() *SystemStats_Loadstats

func (*SystemStats) GetMemory

func (m *SystemStats) GetMemory() *SystemStats_MemoryStats

func (*SystemStats) Marshal

func (m *SystemStats) Marshal() (dAtA []byte, err error)

func (*SystemStats) MarshalTo

func (m *SystemStats) MarshalTo(dAtA []byte) (int, error)

func (*SystemStats) ProtoMessage

func (*SystemStats) ProtoMessage()

func (*SystemStats) Reset

func (m *SystemStats) Reset()

func (*SystemStats) Size

func (m *SystemStats) Size() (n int)

func (*SystemStats) String

func (m *SystemStats) String() string

func (*SystemStats) Unmarshal

func (m *SystemStats) Unmarshal(dAtA []byte) error

type SystemStats_CPUStats

type SystemStats_CPUStats struct {
	User   float32 `protobuf:"fixed32,1,opt,name=user,proto3" json:"user,omitempty"`
	System float32 `protobuf:"fixed32,2,opt,name=system,proto3" json:"system,omitempty"`
	Idle   float32 `protobuf:"fixed32,3,opt,name=idle,proto3" json:"idle,omitempty"`
}

func (*SystemStats_CPUStats) Descriptor

func (*SystemStats_CPUStats) Descriptor() ([]byte, []int)

func (*SystemStats_CPUStats) Marshal

func (m *SystemStats_CPUStats) Marshal() (dAtA []byte, err error)

func (*SystemStats_CPUStats) MarshalTo

func (m *SystemStats_CPUStats) MarshalTo(dAtA []byte) (int, error)

func (*SystemStats_CPUStats) ProtoMessage

func (*SystemStats_CPUStats) ProtoMessage()

func (*SystemStats_CPUStats) Reset

func (m *SystemStats_CPUStats) Reset()

func (*SystemStats_CPUStats) Size

func (m *SystemStats_CPUStats) Size() (n int)

func (*SystemStats_CPUStats) String

func (m *SystemStats_CPUStats) String() string

func (*SystemStats_CPUStats) Unmarshal

func (m *SystemStats_CPUStats) Unmarshal(dAtA []byte) error

type SystemStats_Loadstats

type SystemStats_Loadstats struct {
	Load1  float32 `protobuf:"fixed32,1,opt,name=load1,proto3" json:"load1,omitempty"`
	Load5  float32 `protobuf:"fixed32,2,opt,name=load5,proto3" json:"load5,omitempty"`
	Load15 float32 `protobuf:"fixed32,3,opt,name=load15,proto3" json:"load15,omitempty"`
}

func (*SystemStats_Loadstats) Descriptor

func (*SystemStats_Loadstats) Descriptor() ([]byte, []int)

func (*SystemStats_Loadstats) Marshal

func (m *SystemStats_Loadstats) Marshal() (dAtA []byte, err error)

func (*SystemStats_Loadstats) MarshalTo

func (m *SystemStats_Loadstats) MarshalTo(dAtA []byte) (int, error)

func (*SystemStats_Loadstats) ProtoMessage

func (*SystemStats_Loadstats) ProtoMessage()

func (*SystemStats_Loadstats) Reset

func (m *SystemStats_Loadstats) Reset()

func (*SystemStats_Loadstats) Size

func (m *SystemStats_Loadstats) Size() (n int)

func (*SystemStats_Loadstats) String

func (m *SystemStats_Loadstats) String() string

func (*SystemStats_Loadstats) Unmarshal

func (m *SystemStats_Loadstats) Unmarshal(dAtA []byte) error

type SystemStats_MemoryStats

type SystemStats_MemoryStats struct {
	Total     uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	Available uint64 `protobuf:"varint,2,opt,name=available,proto3" json:"available,omitempty"`
	Used      uint64 `protobuf:"varint,3,opt,name=used,proto3" json:"used,omitempty"`
}

func (*SystemStats_MemoryStats) Descriptor

func (*SystemStats_MemoryStats) Descriptor() ([]byte, []int)

func (*SystemStats_MemoryStats) Marshal

func (m *SystemStats_MemoryStats) Marshal() (dAtA []byte, err error)

func (*SystemStats_MemoryStats) MarshalTo

func (m *SystemStats_MemoryStats) MarshalTo(dAtA []byte) (int, error)

func (*SystemStats_MemoryStats) ProtoMessage

func (*SystemStats_MemoryStats) ProtoMessage()

func (*SystemStats_MemoryStats) Reset

func (m *SystemStats_MemoryStats) Reset()

func (*SystemStats_MemoryStats) Size

func (m *SystemStats_MemoryStats) Size() (n int)

func (*SystemStats_MemoryStats) String

func (m *SystemStats_MemoryStats) String() string

func (*SystemStats_MemoryStats) Unmarshal

func (m *SystemStats_MemoryStats) Unmarshal(dAtA []byte) error

type Validator

type Validator interface {
	// Returns the validation error or nil if valid
	Validate() error
}

Validator interface is used to validate protos

Directories

Path Synopsis
Package broker is a generated protocol buffer package.
Package broker is a generated protocol buffer package.
Package discovery is a generated protocol buffer package.
Package discovery is a generated protocol buffer package.
Package gateway is a generated protocol buffer package.
Package gateway is a generated protocol buffer package.
Package handler is a generated protocol buffer package.
Package handler is a generated protocol buffer package.
Package monitor is a generated protocol buffer package.
Package monitor is a generated protocol buffer package.
Package networkserver is a generated protocol buffer package.
Package networkserver is a generated protocol buffer package.
Package protocol is a generated protocol buffer package.
Package protocol is a generated protocol buffer package.
lorawan
Package lorawan is a generated protocol buffer package.
Package lorawan is a generated protocol buffer package.
Package router is a generated protocol buffer package.
Package router is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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