api

package
v2.5.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2017 License: MIT Imports: 20 Imported by: 120

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 (
	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

DialOptions to use in TTN gRPC

View Source
var KeepAlive = 10 * time.Second

KeepAlive indicates the keep-alive time for the Dialer

View Source
var MaxRetries = 100

MaxRetries indicates how often clients should retry dialing a component

View Source
var RootCAs *x509.CertPool

RootCAs to use in API connections

Functions

func ContextWithID

func ContextWithID(ctx context.Context, id string) context.Context

ContextWithID returns a context with the id

func ContextWithKey

func ContextWithKey(ctx context.Context, key string) context.Context

ContextWithKey returns a context with the key

func ContextWithLimitAndOffset

func ContextWithLimitAndOffset(ctx context.Context, limit, offset uint64) context.Context

ContextWithLimitAndOffset returns a context with the limit and offset

func ContextWithServiceInfo

func ContextWithServiceInfo(ctx context.Context, serviceName, serviceVersion, netAddress string) context.Context

ContextWithServiceInfo returns a context with the id

func ContextWithToken

func ContextWithToken(ctx context.Context, token string) context.Context

ContextWithToken returns a context with the token

func Dial

func Dial(address string) (*grpc.ClientConn, error)

Dial an address

func DialWithCert

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

DialWithCert dials the address using the given TLS cert

func IDFromContext

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

IDFromContext gets the key from the context or returns ErrNoID

func IDFromMetadata

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

IDFromMetadata gets the key from the metadata or returns ErrNoID

func KeyFromContext

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

KeyFromContext gets the key from the context or returns ErrNoKey

func KeyFromMetadata

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

KeyFromMetadata gets the key from the metadata or returns ErrNoKey

func LimitAndOffsetFromContext

func LimitAndOffsetFromContext(ctx context.Context) (limit, offset uint64, err error)

LimitAndOffsetFromContext gets the limit and offset from the context

func LimitFromMetadata

func LimitFromMetadata(md metadata.MD) (uint64, error)

LimitFromMetadata gets the limit from the metadata

func MetadataFromContext

func MetadataFromContext(ctx context.Context) metadata.MD

MetadataFromContext gets the metadata from the given context

func NotEmptyAndValidID

func NotEmptyAndValidID(id string, argument string) error

NotEmptyAndValidID checks if the ID is not empty AND has a valid format

func NotNilAndValid

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

NotNilAndValid checks if the given interface is not nil AND validates it

func OffsetFromMetadata

func OffsetFromMetadata(md metadata.MD) (uint64, error)

OffsetFromMetadata gets the offset from the metadata

func ServiceInfoFromContext

func ServiceInfoFromContext(ctx context.Context) (serviceName, serviceVersion, netAddress string, err error)

ServiceInfoFromContext gets the service information from the context or returns empty strings

func ServiceInfoFromMetadata

func ServiceInfoFromMetadata(md metadata.MD) (serviceName, serviceVersion, netAddress string, err error)

ServiceInfoFromMetadata gets the service information from the metadata or returns empty strings

func TokenFromContext

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

TokenFromContext gets the token from the context or returns ErrNoToken

func TokenFromMetadata

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

TokenFromMetadata gets the token from the metadata or returns ErrNoToken

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 WithTTNDialer

func WithTTNDialer() grpc.DialOption

WithTTNDialer creates a dialer for TTN

Types

type ComponentStats

type ComponentStats struct {
	Uptime        uint64                      `protobuf:"varint,1,opt,name=uptime,proto3" json:"uptime,omitempty"`
	Cpu           *ComponentStats_CPUStats    `protobuf:"bytes,2,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 (*ComponentStats) Descriptor

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

func (*ComponentStats) GetCpu

func (*ComponentStats) GetGcCpuFraction

func (m *ComponentStats) GetGcCpuFraction() float32

func (*ComponentStats) GetGoroutines

func (m *ComponentStats) GetGoroutines() uint64

func (*ComponentStats) GetMemory

func (*ComponentStats) GetUptime

func (m *ComponentStats) GetUptime() uint64

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) GetIdle

func (m *ComponentStats_CPUStats) GetIdle() float32

func (*ComponentStats_CPUStats) GetSystem

func (m *ComponentStats_CPUStats) GetSystem() float32

func (*ComponentStats_CPUStats) GetUser

func (m *ComponentStats_CPUStats) GetUser() float32

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) GetMemory

func (m *ComponentStats_MemoryStats) GetMemory() uint64

func (*ComponentStats_MemoryStats) GetSwap

func (m *ComponentStats_MemoryStats) GetSwap() uint64

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 PayloadUnmarshaler

type PayloadUnmarshaler interface {
	UnmarshalPayload() error
}

PayloadUnmarshaler unmarshals the Payload to a Message

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) GetPercentile1

func (m *Percentiles) GetPercentile1() float32

func (*Percentiles) GetPercentile10

func (m *Percentiles) GetPercentile10() float32

func (*Percentiles) GetPercentile25

func (m *Percentiles) GetPercentile25() float32

func (*Percentiles) GetPercentile5

func (m *Percentiles) GetPercentile5() float32

func (*Percentiles) GetPercentile50

func (m *Percentiles) GetPercentile50() float32

func (*Percentiles) GetPercentile75

func (m *Percentiles) GetPercentile75() float32

func (*Percentiles) GetPercentile90

func (m *Percentiles) GetPercentile90() float32

func (*Percentiles) GetPercentile95

func (m *Percentiles) GetPercentile95() float32

func (*Percentiles) GetPercentile99

func (m *Percentiles) GetPercentile99() float32

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) GetRate1

func (m *Rates) GetRate1() float32

func (*Rates) GetRate15

func (m *Rates) GetRate15() float32

func (*Rates) GetRate5

func (m *Rates) GetRate5() float32

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 (*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) GetIdle

func (m *SystemStats_CPUStats) GetIdle() float32

func (*SystemStats_CPUStats) GetSystem

func (m *SystemStats_CPUStats) GetSystem() float32

func (*SystemStats_CPUStats) GetUser

func (m *SystemStats_CPUStats) GetUser() float32

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) GetLoad1

func (m *SystemStats_Loadstats) GetLoad1() float32

func (*SystemStats_Loadstats) GetLoad15

func (m *SystemStats_Loadstats) GetLoad15() float32

func (*SystemStats_Loadstats) GetLoad5

func (m *SystemStats_Loadstats) GetLoad5() float32

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) GetAvailable

func (m *SystemStats_MemoryStats) GetAvailable() uint64

func (*SystemStats_MemoryStats) GetTotal

func (m *SystemStats_MemoryStats) GetTotal() uint64

func (*SystemStats_MemoryStats) GetUsed

func (m *SystemStats_MemoryStats) GetUsed() uint64

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.
Package trace is a generated protocol buffer package.
Package trace is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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