canary

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canary

type Canary struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, wg *sync.WaitGroup, config configuration.Config) (canary *Canary, err error)

func (*Canary) GetMetricsHandler

func (this *Canary) GetMetricsHandler() (h http.Handler, err error)

func (*Canary) ServeHTTP

func (this *Canary) ServeHTTP(writer http.ResponseWriter, request *http.Request)

func (*Canary) StartTests

func (this *Canary) StartTests()

type CommandRequestMsg

type CommandRequestMsg = map[ProtocolSegmentName]string

type CommandResponseMsg

type CommandResponseMsg = map[ProtocolSegmentName]string

type Conn

type Conn struct {
	Client paho.Client
}

type DeviceInfo

type DeviceInfo = devicemetadata.DeviceInfo

type Event

type Event interface {
	ProcessStartup(token string, info DeviceInfo) error
	ProcessTeardown(token string) error
}

type HubInfo

type HubInfo struct {
	Id             string   `json:"id"`
	Name           string   `json:"name"`
	DeviceIds      []string `json:"device_ids,omitempty"`
	DeviceLocalIds []string `json:"device_local_ids,omitempty"`
}

type LastValue

type LastValue struct {
	Time  string      `json:"time"`
	Value interface{} `json:"value"`
}

type Message

type Message struct {
	UserId  string `json:"userId" bson:"userId"`
	Title   string `json:"title" bson:"title"`
	Message string `json:"message" bson:"message"`
}

type Notification

type Notification struct {
	Id        string    `json:"_id" bson:"_id"`
	UserId    string    `json:"userId" bson:"userId"`
	Title     string    `json:"title" bson:"title"`
	Message   string    `json:"message" bson:"message"`
	IsRead    bool      `json:"isRead" bson:"isRead"`
	CreatedAt time.Time `json:"created_at" bson:"created_at"`
}

type NotificationList

type NotificationList struct {
	Total         int64          `json:"total"`
	Limit         int            `json:"limit"`
	Offset        int            `json:"offset"`
	Notifications []Notification `json:"notifications"`
}

type OpenidToken

type OpenidToken struct {
	AccessToken      string    `json:"access_token"`
	ExpiresIn        float64   `json:"expires_in"`
	RefreshExpiresIn float64   `json:"refresh_expires_in"`
	RefreshToken     string    `json:"refresh_token"`
	TokenType        string    `json:"token_type"`
	RequestTime      time.Time `json:"-"`
}

type PermDevice

type PermDevice = devicemetadata.PermDevice

type Process

type Process interface {
	NotifyCommand(topic string, payload []byte)
	ProcessStartup(token string, info DeviceInfo) error
	ProcessTeardown(token string) error
}

type ProtocolSegmentName

type ProtocolSegmentName = string

type RequestEnvelope

type RequestEnvelope struct {
	CorrelationId      string            `json:"correlation_id"`
	Payload            CommandRequestMsg `json:"payload"`
	Time               int64             `json:"timestamp"`
	CompletionStrategy string            `json:"completion_strategy"`
}

type ResponseEnvelope

type ResponseEnvelope struct {
	CorrelationId string             `json:"correlation_id"`
	Payload       CommandResponseMsg `json:"payload"`
}

Jump to

Keyboard shortcuts

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