mocks

package
v0.0.0-...-9a529fd Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mocks offers dedicated mocking interface / structures for testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppClient

type AppClient struct {
	Failures     map[string]error
	InHandleData struct {
		Ctx  context.Context
		Req  *core.DataAppReq
		Opts []grpc.CallOption
	}
	OutHandleData struct {
		Res *core.DataAppRes
	}
	InHandleJoin struct {
		Ctx  context.Context
		Req  *core.JoinAppReq
		Opts []grpc.CallOption
	}
	OutHandleJoin struct {
		Res *core.JoinAppRes
	}
}

AppClient mocks the core.AppClient interface

func NewAppClient

func NewAppClient() *AppClient

NewAppClient creates a new mock AppClient

func (*AppClient) HandleData

func (m *AppClient) HandleData(ctx context.Context, in *core.DataAppReq, opts ...grpc.CallOption) (*core.DataAppRes, error)

HandleData implements the core.AppClient interface

func (*AppClient) HandleJoin

func (m *AppClient) HandleJoin(ctx context.Context, in *core.JoinAppReq, opts ...grpc.CallOption) (*core.JoinAppRes, error)

HandleJoin implements the core.AppClient interface

type AuthBrokerClient

type AuthBrokerClient struct {
	Failures     map[string]error
	InHandleData struct {
		Ctx  context.Context
		Req  *core.DataBrokerReq
		Opts []grpc.CallOption
	}
	OutHandleData struct {
		Res *core.DataBrokerRes
	}
	InHandleJoin struct {
		Ctx  context.Context
		Req  *core.JoinBrokerReq
		Opts []grpc.CallOption
	}
	OutHandleJoin struct {
		Res *core.JoinBrokerRes
	}
	InUpsertABP struct {
		Ctx  context.Context
		Req  *core.UpsertABPBrokerReq
		Opts []grpc.CallOption
	}
	OutUpsertABP struct {
		Res *core.UpsertABPBrokerRes
	}
	InValidateOTAA struct {
		Ctx  context.Context
		Req  *core.ValidateOTAABrokerReq
		Opts []grpc.CallOption
	}
	OutValidateOTAA struct {
		Res *core.ValidateOTAABrokerRes
	}
	InValidateToken struct {
		Ctx  context.Context
		Req  *core.ValidateTokenBrokerReq
		Opts []grpc.CallOption
	}
	OutValidateToken struct {
		Res *core.ValidateTokenBrokerRes
	}
}

AuthBrokerClient mocks the core.AuthBrokerClient interface

func NewAuthBrokerClient

func NewAuthBrokerClient() *AuthBrokerClient

NewAuthBrokerClient creates a new mock AuthBrokerClient

func (*AuthBrokerClient) DeleteDevice

DeleteDevice implements the core.Broker interface

func (*AuthBrokerClient) HandleData

HandleData implements the core.Broker interface

func (*AuthBrokerClient) HandleJoin

HandleJoin implements the core.Broker interface

func (*AuthBrokerClient) UpsertABP

UpsertABP implements the core.Broker interface

func (*AuthBrokerClient) ValidateOTAA

ValidateOTAA implements the core.Broker interface

func (*AuthBrokerClient) ValidateToken

ValidateToken implements the core.Broker interface

type DutyManager

type DutyManager struct {
	Failures map[string]error
	InUpdate struct {
		ID   []byte
		Freq float32
		Size uint32
		Datr string
		Codr string
	}
	InLookup struct {
		ID []byte
	}
	OutLookup struct {
		Cycles dutycycle.Cycles
	}
	InClose struct {
		Called bool
	}
}

DutyManager mocks the dutycycle.DutyManager interface

func NewDutyManager

func NewDutyManager() *DutyManager

NewDutyManager creates a new mock DutyManager

func (*DutyManager) Close

func (m *DutyManager) Close() error

Close implements the dutycycle.DutyManager interface

func (*DutyManager) Lookup

func (m *DutyManager) Lookup(id []byte) (dutycycle.Cycles, error)

Lookup implements the dutycycle.DutyManager interface

func (*DutyManager) Update

func (m *DutyManager) Update(id []byte, freq float32, size uint32, datr string, codr string) error

Update implements the dutycycle.DutyManager interface

type HandlerClient

type HandlerClient struct {
	Failures     map[string]error
	InHandleJoin struct {
		Ctx  context.Context
		Req  *core.JoinHandlerReq
		Opts []grpc.CallOption
	}
	OutHandleJoin struct {
		Res *core.JoinHandlerRes
	}
	InHandleDataUp struct {
		Ctx  context.Context
		Req  *core.DataUpHandlerReq
		Opts []grpc.CallOption
	}
	OutHandleDataUp struct {
		Res *core.DataUpHandlerRes
	}
	InHandleDataDown struct {
		Ctx  context.Context
		Req  *core.DataDownHandlerReq
		Opts []grpc.CallOption
	}
	OutHandleDataDown struct {
		Res *core.DataDownHandlerRes
	}
}

HandlerClient mocks the core.HandlerClient interface

func NewHandlerClient

func NewHandlerClient() *HandlerClient

NewHandlerClient creates a new mock HandlerClient

func (*HandlerClient) HandleDataDown

HandleDataDown implements the core.HandlerClient interface

func (*HandlerClient) HandleDataUp

HandleDataUp implements the core.HandlerClient interface

func (*HandlerClient) HandleJoin

func (m *HandlerClient) HandleJoin(ctx context.Context, in *core.JoinHandlerReq, opts ...grpc.CallOption) (*core.JoinHandlerRes, error)

HandleJoin implements the core.HandlerClient interface

type HandlerServer

type HandlerServer struct {
	Failures       map[string]error
	InHandleDataUp struct {
		Ctx context.Context
		Req *core.DataUpHandlerReq
	}
	OutHandleDataUp struct {
		Res *core.DataUpHandlerRes
	}
	InHandleDataDown struct {
		Ctx context.Context
		Req *core.DataDownHandlerReq
	}
	OutHandleDataDown struct {
		Res *core.DataDownHandlerRes
	}
	InHandleJoin struct {
		Ctx context.Context
		Req *core.JoinHandlerReq
	}
	OutHandleJoin struct {
		Res *core.JoinHandlerRes
	}
}

HandlerServer mocks the core.HandlerServer interface

func NewHandlerServer

func NewHandlerServer() *HandlerServer

NewHandlerServer creates a new mock HandlerServer

func (*HandlerServer) HandleDataDown

HandleDataDown implements the core.HandlerServer interface

func (*HandlerServer) HandleDataUp

HandleDataUp implements the core.HandlerServer interface

func (*HandlerServer) HandleJoin

HandleJoin implements the core.HandlerServer interface

type RouterServer

type RouterServer struct {
	Failures     map[string]error
	InHandleData struct {
		Ctx context.Context
		Req *core.DataRouterReq
	}
	OutHandleData struct {
		Res *core.DataRouterRes
	}
	InHandleStats struct {
		Ctx context.Context
		Req *core.StatsReq
	}
	OutHandleStats struct {
		Res *core.StatsRes
	}
	InHandleJoin struct {
		Ctx context.Context
		Req *core.JoinRouterReq
	}
	OutHandleJoin struct {
		Res *core.JoinRouterRes
	}
}

RouterServer mocks the core.RouterServer interface

func NewRouterServer

func NewRouterServer() *RouterServer

NewRouterServer creates a new mock RouterServer

func (*RouterServer) HandleData

func (m *RouterServer) HandleData(ctx context.Context, in *core.DataRouterReq) (*core.DataRouterRes, error)

HandleData implements the core.RouterServer interface

func (*RouterServer) HandleJoin

func (m *RouterServer) HandleJoin(ctx context.Context, in *core.JoinRouterReq) (*core.JoinRouterRes, error)

HandleJoin implements the core.RouterServer interface

func (*RouterServer) HandleStats

func (m *RouterServer) HandleStats(ctx context.Context, in *core.StatsReq) (*core.StatsRes, error)

HandleStats implements the core.RouterServer interface

Jump to

Keyboard shortcuts

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