test_utils

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDevices

func CreateDevices(bus *nats.Conn, devices []*mir_apiv1.CreateDeviceRequest) ([]*mir_apiv1.CreateDeviceResponse, error)

func DeleteDevicesWithLabelsPanic

func DeleteDevicesWithLabelsPanic(b *nats.Conn, lbl map[string]string)

func ExecuteTestQueryForType

func ExecuteTestQueryForType[T any](t *testing.T, db *surrealdb.DB, query string, vars map[string]any) T

func GetJsonBytes

func GetJsonBytes(m proto.Message) ([]byte, string, error)

func GetProtoBytes

func GetProtoBytes(m proto.Message) ([]byte, string, error)

func IsIntegratedServices

func IsIntegratedServices() bool

func ProtoToMap added in v0.2.0

func ProtoToMap(p proto.Message) (map[string]any, error)

func ProtoToPropertyMap added in v0.3.1

func ProtoToPropertyMap(p proto.Message) (map[string]any, error)

func ProtoToStructPb added in v0.2.0

func ProtoToStructPb(p proto.Message) (*structpb.Struct, error)

func SetupAllExternalsPanic

func SetupAllExternalsPanic(ctx context.Context, conns ConnsInfo) (*nats.Conn, *surrealdb.DB, influxdb2.Client, api.WriteAPI, api.QueryAPI)

func SetupInfluxConnsPanic

func SetupInfluxConnsPanic(ctx context.Context, url, token, org, bucket string) (influxdb2.Client, api.WriteAPI, api.QueryAPI)

func SetupNatsConPanic

func SetupNatsConPanic(url string) *nats.Conn

func SetupSurrealDbConnsPanic

func SetupSurrealDbConnsPanic(url, user, pass, ns, db string) *surrealdb.DB

func TestLogger

func TestLogger(component string) zerolog.Logger

Types

type ConnsInfo

type ConnsInfo struct {
	Name    string
	BusUrl  string
	Surreal SurrealInfo
	Influx  InfluxInfo
}

type InfluxInfo

type InfluxInfo struct {
	Url    string
	Token  string
	Org    string
	Bucket string
}

type SurrealInfo

type SurrealInfo struct {
	Url  string
	User string
	Pass string
	Ns   string
	Db   string
}

Jump to

Keyboard shortcuts

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