repo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceState

type DeviceState struct {
	ID     string
	Status DeviceStatus
}

type DeviceStatus

type DeviceStatus struct {
	Fingerprint []byte
	Enabled     bool
	NamespaceID string
}

type Repo

type Repo interface {
	SetDeviceStatus(DeviceState) (err error)
	GetDeviceStatus(id string) (DeviceState, error)
	DeleteDeviceStatus(id string) (err error)
}

func NewRedisRepo

func NewRedisRepo(addr string) (repo Repo, err error)

type Server

type Server struct {
	Repo Repo
	Log  *zap.Logger
}

func (*Server) DeleteDeviceState

func (s *Server) DeleteDeviceState(context context.Context, request *repopb.DeleteDeviceStateRequest) (response *repopb.DeleteDeviceStateResponse, err error)

func (*Server) Get

func (s *Server) Get(context context.Context, request *repopb.GetRequest) (response *repopb.GetResponse, err error)

func (*Server) SetDeviceState

func (s *Server) SetDeviceState(context context.Context, request *repopb.SetDeviceStateRequest) (response *repopb.SetDeviceStateResponse, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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