adam

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ctx

type Ctx struct {
	AdamRemote        bool
	AdamRemoteRedis   bool   //use redis for obtain logs and info
	AdamRedisURLEden  string //string with redis url for obtain logs and info
	AdamCaching       bool   //enable caching of adam`s logs/info
	AdamCachingRedis  bool   //caching to redis instead of files
	AdamCachingPrefix string //custom prefix for file or stream naming for cache
	// contains filtered or unexported fields
}

Ctx stores controller settings

func (*Ctx) CertsGet

func (adam *Ctx) CertsGet(devUUID uuid.UUID) (out string, err error)

CertsGet get attest certs for devID

func (*Ctx) ConfigGet

func (adam *Ctx) ConfigGet(devUUID uuid.UUID) (out string, err error)

ConfigGet get config for devID

func (*Ctx) ConfigSet

func (adam *Ctx) ConfigSet(devUUID uuid.UUID, devConfig []byte) (err error)

ConfigSet set config for devID

func (*Ctx) DeviceGetByOnboard

func (adam *Ctx) DeviceGetByOnboard(eveCert string) (devUUID uuid.UUID, err error)

DeviceGetByOnboard try to get device by onboard eveCert

func (*Ctx) DeviceGetByOnboardUUID

func (adam *Ctx) DeviceGetByOnboardUUID(onboardUUID string) (devUUID uuid.UUID, err error)

DeviceGetByOnboardUUID try to get device by onboard uuid

func (*Ctx) DeviceGetOnboard

func (adam *Ctx) DeviceGetOnboard(devUUID uuid.UUID) (onboardUUID uuid.UUID, err error)

DeviceGetOnboard get device onboardUUID for devUUID

func (*Ctx) DeviceList

func (adam *Ctx) DeviceList(filter types.DeviceStateFilter) (out []string, err error)

DeviceList return device list

func (*Ctx) DeviceRemove

func (adam *Ctx) DeviceRemove(devUUID uuid.UUID) (err error)

DeviceRemove remove device by devUUID

func (*Ctx) FlowLogChecker

func (adam *Ctx) FlowLogChecker(devUUID uuid.UUID, q map[string]string, handler eflowlog.HandlerFunc, mode eflowlog.FlowLogCheckerMode, timeout time.Duration) (err error)

FlowLogChecker check FlowLogs by pattern from existence files with FlowLogLast and use FlowLogWatchWithTimeout with timeout for observe new files

func (*Ctx) FlowLogLastCallback

func (adam *Ctx) FlowLogLastCallback(devUUID uuid.UUID, q map[string]string, handler eflowlog.HandlerFunc) (err error)

FlowLogLastCallback check FlowLogs by pattern from existence files with callback

func (*Ctx) GetDeviceCert

func (adam *Ctx) GetDeviceCert(device *device.Ctx) (deviceCert *types.DeviceCert, err error)

GetDeviceCert gets deviceCert contains certificates and serial

func (*Ctx) GetDir

func (adam *Ctx) GetDir() (dir string)

GetDir return dir

func (*Ctx) InfoChecker

func (adam *Ctx) InfoChecker(devUUID uuid.UUID, q map[string]string, handler einfo.HandlerFunc, mode einfo.InfoCheckerMode, timeout time.Duration) (err error)

InfoChecker checks the information in the regular expression pattern 'query' and processes the info.ZInfoMsg found by the function 'handler' from existing files (mode=einfo.InfoExist), new files (mode=einfo.InfoNew) or any of them (mode=einfo.InfoAny) with timeout.

func (*Ctx) InfoLastCallback

func (adam *Ctx) InfoLastCallback(devUUID uuid.UUID, q map[string]string, handler einfo.HandlerFunc) (err error)

InfoLastCallback check info by pattern from existence files with callback

func (*Ctx) InitWithVars

func (adam *Ctx) InitWithVars(vars *utils.ConfigVars) error

InitWithVars use variables from viper for init controller

func (*Ctx) LogAppsChecker

func (adam *Ctx) LogAppsChecker(devUUID uuid.UUID, appUUID uuid.UUID, q map[string]string, handler eapps.HandlerFunc, mode eapps.LogCheckerMode, timeout time.Duration) (err error)

LogAppsChecker check app logs by pattern from existence files with LogLast and use LogWatchWithTimeout with timeout for observe new files

func (*Ctx) LogAppsLastCallback

func (adam *Ctx) LogAppsLastCallback(devUUID uuid.UUID, appUUID uuid.UUID, q map[string]string, handler eapps.HandlerFunc) (err error)

LogAppsLastCallback check app logs by pattern from existence files with callback

func (*Ctx) LogChecker

func (adam *Ctx) LogChecker(devUUID uuid.UUID, q map[string]string, handler elog.HandlerFunc, mode elog.LogCheckerMode, timeout time.Duration) (err error)

LogChecker check logs by pattern from existence files with LogLast and use LogWatchWithTimeout with timeout for observe new files

func (*Ctx) LogLastCallback

func (adam *Ctx) LogLastCallback(devUUID uuid.UUID, q map[string]string, handler elog.HandlerFunc) (err error)

LogLastCallback check logs by pattern from existence files with callback

func (*Ctx) MetricChecker

func (adam *Ctx) MetricChecker(devUUID uuid.UUID, q map[string]string, handler emetric.HandlerFunc, mode emetric.MetricCheckerMode, timeout time.Duration) (err error)

MetricChecker check metrics by pattern from existence files with LogLast and use LogWatchWithTimeout with timeout for observe new files

func (*Ctx) MetricLastCallback

func (adam *Ctx) MetricLastCallback(devUUID uuid.UUID, q map[string]string, handler emetric.HandlerFunc) (err error)

MetricLastCallback check metrics by pattern from existence files with callback

func (*Ctx) OnboardRemove

func (adam *Ctx) OnboardRemove(onboardUUID string) (err error)

OnboardRemove remove onboard by onboardUUID

func (*Ctx) Register

func (adam *Ctx) Register(device *device.Ctx) error

Register device in adam

func (*Ctx) RequestLastCallback

func (adam *Ctx) RequestLastCallback(devUUID uuid.UUID, q map[string]string, handler erequest.HandlerFunc) (err error)

RequestLastCallback check request by pattern from existence files with callback

func (*Ctx) UploadDeviceCert

func (adam *Ctx) UploadDeviceCert(deviceCert types.DeviceCert) error

UploadDeviceCert upload deviceCert into Adam

Jump to

Keyboard shortcuts

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