test

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustFlushRedis

func MustFlushRedis(p *redis.Pool)

MustFlushRedis flushes the Redis storage.

func MustResetDB

func MustResetDB(db *common.DBLogger)

MustResetDB re-applies all database migrations.

func NewNetworkServerPool

func NewNetworkServerPool(client *NetworkServerClient) nsclient.Pool

NewNetworkServerPool creates a network-server client pool which always returns the given client on Get.

Types

type Config

type Config struct {
	PostgresDSN  string
	RedisURL     string
	MQTTServer   string
	MQTTUsername string
	MQTTPassword string
}

Config contains the test configuration.

func GetConfig

func GetConfig() *Config

GetConfig returns the test configuration.

type NetworkServerClient

type NetworkServerClient struct {
	CreateServiceProfileChan     chan ns.CreateServiceProfileRequest
	CreateServiceProfileResponse ns.CreateServiceProfileResponse

	GetServiceProfileChan     chan ns.GetServiceProfileRequest
	GetServiceProfileResponse ns.GetServiceProfileResponse

	UpdateServiceProfileChan     chan ns.UpdateServiceProfileRequest
	UpdateServiceProfileResponse ns.UpdateServiceProfileResponse

	DeleteServiceProfileChan     chan ns.DeleteServiceProfileRequest
	DeleteServiceProfileResponse ns.DeleteServiceProfileResponse

	CreateRoutingProfileChan     chan ns.CreateRoutingProfileRequest
	CreateRoutingProfileResponse ns.CreateRoutingProfileResponse

	GetRoutingProfileChan     chan ns.GetRoutingProfileRequest
	GetRoutingProfileResponse ns.GetRoutingProfileResponse

	UpdateRoutingProfileChan     chan ns.UpdateRoutingProfileRequest
	UpdateRoutingProfileResponse ns.UpdateRoutingProfileResponse

	DeleteRoutingProfileChan     chan ns.DeleteRoutingProfileRequest
	DeleteRoutingProfileResponse ns.DeleteRoutingProfileResponse

	CreateDeviceProfileChan     chan ns.CreateDeviceProfileRequest
	CreateDeviceProfileResponse ns.CreateDeviceProfileResponse

	GetDeviceProfileChan     chan ns.GetDeviceProfileRequest
	GetDeviceProfileResponse ns.GetDeviceProfileResponse

	UpdateDeviceProfileChan     chan ns.UpdateDeviceProfileRequest
	UpdateDeviceProfileResponse ns.UpdateDeviceProfileResponse

	DeleteDeviceProfileChan     chan ns.DeleteDeviceProfileRequest
	DeleteDeviceProfileResponse ns.DeleteDeviceProfileResponse

	CreateDeviceChan     chan ns.CreateDeviceRequest
	CreateDeviceResponse ns.CreateDeviceResponse

	GetDeviceChan     chan ns.GetDeviceRequest
	GetDeviceResponse ns.GetDeviceResponse

	UpdateDeviceChan     chan ns.UpdateDeviceRequest
	UpdateDeviceResponse ns.UpdateDeviceResponse

	DeleteDeviceChan     chan ns.DeleteDeviceRequest
	DeleteDeviceResponse ns.DeleteDeviceResponse

	ActivateDeviceChan     chan ns.ActivateDeviceRequest
	ActivateDeviceResponse ns.ActivateDeviceResponse

	DeactivateDeviceChan     chan ns.DeactivateDeviceRequest
	DeactivateDeviceResponse ns.DeactivateDeviceResponse

	GetDeviceActivationChan     chan ns.GetDeviceActivationRequest
	GetDeviceActivationResponse ns.GetDeviceActivationResponse

	GetRandomDevAddrChan     chan ns.GetRandomDevAddrRequest
	GetRandomDevAddrResponse ns.GetRandomDevAddrResponse

	CreateMACCommandQueueItemChan     chan ns.CreateMACCommandQueueItemRequest
	CreateMACCommandQueueItemResponse ns.CreateMACCommandQueueItemResponse

	SendProprietaryPayloadChan     chan ns.SendProprietaryPayloadRequest
	SendProprietaryPayloadResponse ns.SendProprietaryPayloadResponse

	CreateGatewayChan     chan ns.CreateGatewayRequest
	CreateGatewayResponse ns.CreateGatewayResponse

	GetGatewayChan     chan ns.GetGatewayRequest
	GetGatewayResponse ns.GetGatewayResponse

	UpdateGatewayChan     chan ns.UpdateGatewayRequest
	UpdateGatewayResponse ns.UpdateGatewayResponse

	DeleteGatewayChan     chan ns.DeleteGatewayRequest
	DeleteGatewayResponse ns.DeleteGatewayResponse

	GetGatewayStatsChan     chan ns.GetGatewayStatsRequest
	GetGatewayStatsResponse ns.GetGatewayStatsResponse

	CreateGatewayProfileChan     chan ns.CreateGatewayProfileRequest
	CreateGatewayProfileResponse ns.CreateGatewayProfileResponse

	GetGatewayProfileChan     chan ns.GetGatewayProfileRequest
	GetGatewayProfileResponse ns.GetGatewayProfileResponse

	UpdateGatewayProfileChan     chan ns.UpdateGatewayProfileRequest
	UpdateGatewayProfileResponse ns.UpdateGatewayProfileResponse

	DeleteGatewayProfileChan     chan ns.DeleteGatewayProfileRequest
	DeleteGatewayProfileResponse ns.DeleteGatewayProfileResponse

	CreateDeviceQueueItemChan     chan ns.CreateDeviceQueueItemRequest
	CreateDeviceQueueItemResponse ns.CreateDeviceQueueItemResponse

	FlushDeviceQueueForDevEUIChan     chan ns.FlushDeviceQueueForDevEUIRequest
	FlushDeviceQueueForDevEUIResponse ns.FlushDeviceQueueForDevEUIResponse

	GetDeviceQueueItemsForDevEUIChan     chan ns.GetDeviceQueueItemsForDevEUIRequest
	GetDeviceQueueItemsForDevEUIResponse ns.GetDeviceQueueItemsForDevEUIResponse

	GetNextDownlinkFCntForDevEUIChan     chan ns.GetNextDownlinkFCntForDevEUIRequest
	GetNextDownlinkFCntForDevEUIResponse ns.GetNextDownlinkFCntForDevEUIResponse

	GetVersionResponse ns.GetVersionResponse
}

NetworkServerClient is a test network-server client.

func NewNetworkServerClient

func NewNetworkServerClient() *NetworkServerClient

NewNetworkServerClient creates a new NetworkServerClient.

func (*NetworkServerClient) ActivateDevice

ActivateDevice method.

func (*NetworkServerClient) CreateDevice

CreateDevice method.

func (*NetworkServerClient) CreateDeviceProfile

CreateDeviceProfile method.

func (NetworkServerClient) CreateDeviceQueueItem

CreateDeviceQueueItem method.

func (*NetworkServerClient) CreateGateway

CreateGateway method.

func (*NetworkServerClient) CreateGatewayProfile

CreateGatewayProfile method.

func (*NetworkServerClient) CreateMACCommandQueueItem

CreateMACCommandQueueItem method.

func (*NetworkServerClient) CreateRoutingProfile

CreateRoutingProfile method.

func (*NetworkServerClient) CreateServiceProfile

CreateServiceProfile method.

func (*NetworkServerClient) DeactivateDevice

DeactivateDevice method.

func (*NetworkServerClient) DeleteDevice

DeleteDevice method.

func (*NetworkServerClient) DeleteDeviceProfile

DeleteDeviceProfile method.

func (*NetworkServerClient) DeleteGateway

DeleteGateway method.

func (*NetworkServerClient) DeleteGatewayProfile

DeleteGatewayProfile method.

func (*NetworkServerClient) DeleteRoutingProfile

DeleteRoutingProfile method.

func (*NetworkServerClient) DeleteServiceProfile

DeleteServiceProfile method.

func (NetworkServerClient) FlushDeviceQueueForDevEUI

FlushDeviceQueueForDevEUI method.

func (*NetworkServerClient) GetDevice

GetDevice method.

func (*NetworkServerClient) GetDeviceActivation

GetDeviceActivation method.

func (*NetworkServerClient) GetDeviceProfile

GetDeviceProfile method.

func (NetworkServerClient) GetDeviceQueueItemsForDevEUI

GetDeviceQueueItemsForDevEUI method.

func (*NetworkServerClient) GetGateway

GetGateway method.

func (*NetworkServerClient) GetGatewayProfile

GetGatewayProfile method.

func (*NetworkServerClient) GetGatewayStats

GetGatewayStats method.

func (NetworkServerClient) GetNextDownlinkFCntForDevEUI

GetNextDownlinkFCntForDevEUI method.

func (*NetworkServerClient) GetRandomDevAddr

GetRandomDevAddr method.

func (*NetworkServerClient) GetRoutingProfile

GetRoutingProfile method.

func (*NetworkServerClient) GetServiceProfile

GetServiceProfile method.

func (NetworkServerClient) GetVersion

GetVersion method.

func (NetworkServerClient) MigrateChannelConfigurationToGatewayProfile

MigrateChannelConfigurationToGatewayProfile method.

func (*NetworkServerClient) MigrateNodeToDeviceSession

MigrateNodeToDeviceSession is not implemented.

func (*NetworkServerClient) SendProprietaryPayload

SendProprietaryPayload method.

func (NetworkServerClient) StreamFrameLogsForDevice

StreamFrameLogsForDevice method.

func (NetworkServerClient) StreamFrameLogsForGateway

StreamFrameLogsForGateway method.

func (*NetworkServerClient) UpdateDevice

UpdateDevice method.

func (*NetworkServerClient) UpdateDeviceProfile

UpdateDeviceProfile method.

func (*NetworkServerClient) UpdateGateway

UpdateGateway method.

func (*NetworkServerClient) UpdateGatewayProfile

UpdateGatewayProfile method.

func (*NetworkServerClient) UpdateRoutingProfile

UpdateRoutingProfile method.

func (*NetworkServerClient) UpdateServiceProfile

UpdateServiceProfile method.

type NetworkServerPool

type NetworkServerPool struct {
	Client      ns.NetworkServerClient
	GetHostname string
}

NetworkServerPool is a network-server pool for testing.

func (*NetworkServerPool) Get

func (p *NetworkServerPool) Get(hostname string, caCert, tlsCert, tlsKey []byte) (ns.NetworkServerClient, error)

Get returns the Client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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