redis

package
v0.0.0-...-a7f31ed Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MB = common.MB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceManager

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

DeviceManager implementation of DeviceManager interface with a Redis DB as the backing store

func (*DeviceManager) Database

func (d *DeviceManager) Database() string

Database return database hostname and port

func (*DeviceManager) DeviceCheckCert

func (d *DeviceManager) DeviceCheckCert(cert *x509.Certificate) (*uuid.UUID, error)

DeviceCheckCert see if a particular certificate is a valid registered device certificate

func (*DeviceManager) DeviceCheckCertHash

func (d *DeviceManager) DeviceCheckCertHash(hash []byte) (*uuid.UUID, error)

DeviceCheckCertHash see if a particular certificate hash is a valid registered device certificate

func (*DeviceManager) DeviceClear

func (d *DeviceManager) DeviceClear() error

DeviceClear remove all devices

func (*DeviceManager) DeviceGet

DeviceGet get an individual device by UUID

func (*DeviceManager) DeviceList

func (d *DeviceManager) DeviceList() ([]*uuid.UUID, error)

DeviceList list all of the known UUIDs for devices

func (*DeviceManager) DeviceRegister

func (d *DeviceManager) DeviceRegister(unew uuid.UUID, cert, onboard *x509.Certificate, serial string, conf []byte) error

DeviceRegister register a new device cert

func (*DeviceManager) DeviceRemove

func (d *DeviceManager) DeviceRemove(u *uuid.UUID) error

DeviceRemove remove a device

func (*DeviceManager) GetCerts

func (d *DeviceManager) GetCerts(u uuid.UUID) ([]byte, error)

GetCerts retrieve the attest certs for a particular device

func (*DeviceManager) GetConfig

func (d *DeviceManager) GetConfig(u uuid.UUID) ([]byte, error)

GetConfig retrieve the config for a particular device

func (*DeviceManager) GetDeviceOptions

func (d *DeviceManager) GetDeviceOptions(u uuid.UUID) ([]byte, error)

func (*DeviceManager) GetGlobalOptions

func (d *DeviceManager) GetGlobalOptions() ([]byte, error)

func (*DeviceManager) GetInfoReader

func (d *DeviceManager) GetInfoReader(u uuid.UUID) (common.ChunkReader, error)

GetInfoReader get the info for a given uuid

func (*DeviceManager) GetLogsReader

func (d *DeviceManager) GetLogsReader(u uuid.UUID) (common.ChunkReader, error)

GetLogsReader get the logs for a given uuid

func (*DeviceManager) GetRequestsReader

func (d *DeviceManager) GetRequestsReader(u uuid.UUID) (common.ChunkReader, error)

GetRequestsReader get the requests for a given uuid

func (*DeviceManager) GetStorageKeys

func (d *DeviceManager) GetStorageKeys(u uuid.UUID) ([]byte, error)

GetStorageKeys retrieve storage keys for a particular device

func (*DeviceManager) GetUUID

func (d *DeviceManager) GetUUID(u uuid.UUID) ([]byte, error)

GetUUID get UuidResponse for device by uuid

func (*DeviceManager) Init

func (d *DeviceManager) Init(s string, sizes common.MaxSizes) (bool, error)

Init check if a URL is valid and initialize

func (*DeviceManager) MaxAppLogsSize

func (d *DeviceManager) MaxAppLogsSize() int

MaxAppLogsSize return the maximum app logs size in bytes for this device manager

func (*DeviceManager) MaxFlowMessageSize

func (d *DeviceManager) MaxFlowMessageSize() int

MaxFlowMessageSize return the maximum FlowMessage logs size in bytes for this device manager

func (*DeviceManager) MaxInfoSize

func (d *DeviceManager) MaxInfoSize() int

MaxInfoSize return the default maximum info size in bytes for this device manager

func (*DeviceManager) MaxLogSize

func (d *DeviceManager) MaxLogSize() int

MaxLogSize return the default maximum log size in bytes for this device manager

func (*DeviceManager) MaxMetricSize

func (d *DeviceManager) MaxMetricSize() int

MaxMetricSize return the maximum metrics size in bytes for this device manager

func (*DeviceManager) MaxRequestsSize

func (d *DeviceManager) MaxRequestsSize() int

MaxRequestsSize return the maximum requests log size in bytes for this device manager

func (*DeviceManager) Name

func (d *DeviceManager) Name() string

Name return name

func (*DeviceManager) OnboardCheck

func (d *DeviceManager) OnboardCheck(cert *x509.Certificate, serial string) error

OnboardCheck see if a particular certificate and serial combination is valid

func (*DeviceManager) OnboardClear

func (d *DeviceManager) OnboardClear() error

OnboardClear remove all onboarding certs

func (*DeviceManager) OnboardGet

func (d *DeviceManager) OnboardGet(cn string) (*x509.Certificate, []string, error)

OnboardGet get the onboard cert and its serials based on Common Name

func (*DeviceManager) OnboardList

func (d *DeviceManager) OnboardList() ([]string, error)

OnboardList list all of the known Common Names for onboard

func (*DeviceManager) OnboardRegister

func (d *DeviceManager) OnboardRegister(cert *x509.Certificate, serial []string) error

OnboardRegister register an onboard cert and update its serials

func (*DeviceManager) OnboardRemove

func (d *DeviceManager) OnboardRemove(cn string) (result error)

OnboardRemove remove an onboard certificate based on Common Name

func (*DeviceManager) SetCacheTimeout

func (d *DeviceManager) SetCacheTimeout(timeout int)

SetCacheTimeout set the timeout for refreshing the cache, unused in memory

func (*DeviceManager) SetConfig

func (d *DeviceManager) SetConfig(u uuid.UUID, b []byte) error

SetConfig set the config for a particular device

func (*DeviceManager) SetDeviceOptions

func (d *DeviceManager) SetDeviceOptions(u uuid.UUID, b []byte) error

func (*DeviceManager) SetGlobalOptions

func (d *DeviceManager) SetGlobalOptions(b []byte) error

func (*DeviceManager) WriteAppInstanceLogs

func (d *DeviceManager) WriteAppInstanceLogs(instanceID uuid.UUID, deviceID uuid.UUID, b []byte) error

WriteAppInstanceLogs write a message of AppInstanceLogBundle

func (*DeviceManager) WriteCerts

func (d *DeviceManager) WriteCerts(u uuid.UUID, b []byte) error

WriteCerts write an attestation certs information

func (*DeviceManager) WriteFlowMessage

func (d *DeviceManager) WriteFlowMessage(u uuid.UUID, b []byte) error

WriteFlowMessage write FlowMessage

func (*DeviceManager) WriteInfo

func (d *DeviceManager) WriteInfo(u uuid.UUID, b []byte) error

WriteInfo write an info message

func (*DeviceManager) WriteLogs

func (d *DeviceManager) WriteLogs(u uuid.UUID, b []byte) error

WriteLogs write a message of logs

func (*DeviceManager) WriteMetrics

func (d *DeviceManager) WriteMetrics(u uuid.UUID, b []byte) error

WriteMetrics write a metrics message

func (*DeviceManager) WriteRequest

func (d *DeviceManager) WriteRequest(u uuid.UUID, b []byte) error

WriteRequest record a request

func (*DeviceManager) WriteStorageKeys

func (d *DeviceManager) WriteStorageKeys(u uuid.UUID, b []byte) error

WriteStorageKeys write storage keys information

type ManagedStream

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

ManagedStream stream of data interface

func (*ManagedStream) Get

func (m *ManagedStream) Get(index int) ([]byte, error)

func (*ManagedStream) Reader

func (m *ManagedStream) Reader() (common.ChunkReader, error)

func (*ManagedStream) Write

func (m *ManagedStream) Write(b []byte) (int, error)

type RedisStreamReader

type RedisStreamReader struct {
	// Redis client handle
	Client *redis.Client
	// Name of a stream
	Stream string
	// contains filtered or unexported fields
}

RedisStreamReader reads msgpack messages from Redis streams and turns then into JSON strings

func (*RedisStreamReader) Next

func (d *RedisStreamReader) Next() (io.Reader, int64, error)

Next returns reader for the next chunk of data (message), its size and possible error

Jump to

Keyboard shortcuts

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