Documentation ¶
Index ¶
- func MustFlushRedis(p *redis.Pool)
- func MustPrefillRedisPool(p *redis.Pool, count int)
- func MustResetDB(db *common.DBLogger)
- func NewApplicationServerPool(client *ApplicationClient) asclient.Pool
- func NewJoinServerPool(client jsclient.Client) jsclient.Pool
- type ApplicationClient
- func (t *ApplicationClient) HandleDownlinkACK(ctx context.Context, in *as.HandleDownlinkACKRequest, opts ...grpc.CallOption) (*as.HandleDownlinkACKResponse, error)
- func (t *ApplicationClient) HandleError(ctx context.Context, in *as.HandleErrorRequest, opts ...grpc.CallOption) (*as.HandleErrorResponse, error)
- func (t *ApplicationClient) HandleProprietaryUplink(ctx context.Context, in *as.HandleProprietaryUplinkRequest, ...) (*as.HandleProprietaryUplinkResponse, error)
- func (t *ApplicationClient) HandleUplinkData(ctx context.Context, in *as.HandleUplinkDataRequest, opts ...grpc.CallOption) (*as.HandleUplinkDataResponse, error)
- type ApplicationServerPool
- type Config
- type GatewayBackend
- func (b *GatewayBackend) Close() error
- func (b *GatewayBackend) RXPacketChan() chan gw.RXPacket
- func (b *GatewayBackend) SendGatewayConfigPacket(config gw.GatewayConfigPacket) error
- func (b *GatewayBackend) SendTXPacket(txPacket gw.TXPacket) error
- func (b *GatewayBackend) StatsPacketChan() chan gw.GatewayStatsPacket
- type JoinServerClient
- type JoinServerPool
- type NetworkControllerClient
- func (t *NetworkControllerClient) HandleDataUpMACCommand(ctx context.Context, in *nc.HandleDataUpMACCommandRequest, ...) (*nc.HandleDataUpMACCommandResponse, error)
- func (t *NetworkControllerClient) HandleRXInfo(ctx context.Context, in *nc.HandleRXInfoRequest, opts ...grpc.CallOption) (*nc.HandleRXInfoResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustPrefillRedisPool ¶
MustPrefillRedisPool pre-fills the pool with count connections.
func MustResetDB ¶
MustResetDB re-applies all database migrations.
func NewApplicationServerPool ¶
func NewApplicationServerPool(client *ApplicationClient) asclient.Pool
NewApplicationServerPool create an application-server client pool which always returns the given client on Get.
Types ¶
type ApplicationClient ¶
type ApplicationClient struct { HandleDataUpErr error HandleProprietaryUpErr error HandleDownlinkACKErr error HandleDataUpChan chan as.HandleUplinkDataRequest HandleProprietaryUpChan chan as.HandleProprietaryUplinkRequest HandleErrorChan chan as.HandleErrorRequest HandleDownlinkACKChan chan as.HandleDownlinkACKRequest HandleDataUpResponse as.HandleUplinkDataResponse HandleProprietaryUpResponse as.HandleProprietaryUplinkResponse HandleErrorResponse as.HandleErrorResponse HandleDownlinkACKResponse as.HandleDownlinkACKResponse }
ApplicationClient is an application client for testing.
func NewApplicationClient ¶
func NewApplicationClient() *ApplicationClient
NewApplicationClient returns a new ApplicationClient.
func (*ApplicationClient) HandleDownlinkACK ¶
func (t *ApplicationClient) HandleDownlinkACK(ctx context.Context, in *as.HandleDownlinkACKRequest, opts ...grpc.CallOption) (*as.HandleDownlinkACKResponse, error)
HandleDownlinkACK method.
func (*ApplicationClient) HandleError ¶
func (t *ApplicationClient) HandleError(ctx context.Context, in *as.HandleErrorRequest, opts ...grpc.CallOption) (*as.HandleErrorResponse, error)
HandleError method.
func (*ApplicationClient) HandleProprietaryUplink ¶
func (t *ApplicationClient) HandleProprietaryUplink(ctx context.Context, in *as.HandleProprietaryUplinkRequest, opts ...grpc.CallOption) (*as.HandleProprietaryUplinkResponse, error)
HandleProprietaryUplink method.
func (*ApplicationClient) HandleUplinkData ¶
func (t *ApplicationClient) HandleUplinkData(ctx context.Context, in *as.HandleUplinkDataRequest, opts ...grpc.CallOption) (*as.HandleUplinkDataResponse, error)
HandleUplinkData method.
type ApplicationServerPool ¶
type ApplicationServerPool struct { Client as.ApplicationServerClient GetHostname string }
ApplicationServerPool is an application-server pool for testing.
func (*ApplicationServerPool) Get ¶
func (p *ApplicationServerPool) Get(hostname string, caCert, tlsCert, tlsKey []byte) (as.ApplicationServerClient, error)
Get returns the Client.
type GatewayBackend ¶
type GatewayBackend struct { TXPacketChan chan gw.TXPacket GatewayConfigPacketChan chan gw.GatewayConfigPacket // contains filtered or unexported fields }
GatewayBackend is a test gateway backend.
func NewGatewayBackend ¶
func NewGatewayBackend() *GatewayBackend
NewGatewayBackend returns a new GatewayBackend.
func (*GatewayBackend) RXPacketChan ¶
func (b *GatewayBackend) RXPacketChan() chan gw.RXPacket
RXPacketChan method.
func (*GatewayBackend) SendGatewayConfigPacket ¶
func (b *GatewayBackend) SendGatewayConfigPacket(config gw.GatewayConfigPacket) error
SendGatewayConfigPacket method.
func (*GatewayBackend) SendTXPacket ¶
func (b *GatewayBackend) SendTXPacket(txPacket gw.TXPacket) error
SendTXPacket method.
func (*GatewayBackend) StatsPacketChan ¶
func (b *GatewayBackend) StatsPacketChan() chan gw.GatewayStatsPacket
StatsPacketChan method.
type JoinServerClient ¶
type JoinServerClient struct { JoinReqPayloadChan chan backend.JoinReqPayload JoinReqError error JoinAnsPayload backend.JoinAnsPayload }
JoinServerClient is a join-server client for testing.
func NewJoinServerClient ¶
func NewJoinServerClient() *JoinServerClient
NewJoinServerClient creates a new join-server client.
func (*JoinServerClient) JoinReq ¶
func (c *JoinServerClient) JoinReq(pl backend.JoinReqPayload) (backend.JoinAnsPayload, error)
JoinReq method.
type JoinServerPool ¶
JoinServerPool is a join-server pool for testing.
type NetworkControllerClient ¶
type NetworkControllerClient struct { HandleRXInfoChan chan nc.HandleRXInfoRequest HandleDataUpMACCommandChan chan nc.HandleDataUpMACCommandRequest HandleRXInfoResponse nc.HandleRXInfoResponse HandleDataUpMACCommandResponse nc.HandleDataUpMACCommandResponse }
NetworkControllerClient is a network-controller client for testing.
func NewNetworkControllerClient ¶
func NewNetworkControllerClient() *NetworkControllerClient
NewNetworkControllerClient returns a new NetworkControllerClient.
func (*NetworkControllerClient) HandleDataUpMACCommand ¶
func (t *NetworkControllerClient) HandleDataUpMACCommand(ctx context.Context, in *nc.HandleDataUpMACCommandRequest, opts ...grpc.CallOption) (*nc.HandleDataUpMACCommandResponse, error)
HandleDataUpMACCommand method.
func (*NetworkControllerClient) HandleRXInfo ¶
func (t *NetworkControllerClient) HandleRXInfo(ctx context.Context, in *nc.HandleRXInfoRequest, opts ...grpc.CallOption) (*nc.HandleRXInfoResponse, error)
HandleRXInfo method.