registry

package
v0.0.0-...-c6a7f1f Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	dgraph.Object
	Tags         []string `json:"tags,omitempty"`
	Enabled      bool     `json:"enabled"`
	BasicEnabled bool     `json:"basic_enabled"`

	Certificates []*X509Cert `json:"certificates,omitempty"`
}

Device data struct with Certificates data strcuture as slice

func (*Device) TagsDiff

func (d *Device) TagsDiff(tags []string) (diff []string)

type Server

type Server struct {
	registrypb.UnimplementedDevicesServer

	Log *zap.Logger
	// contains filtered or unexported fields
}

Server is a Data type for Device Controller file

func NewServer

func NewServer(dg *dgo.Dgraph, rep1 repo.Server) *Server

NewServer is a method to create the Dgraph Server for Device registry

func (*Server) AssignOwnerDevices

func (s *Server) AssignOwnerDevices(ctx context.Context, request *registrypb.OwnershipRequestDevices) (response *registrypb.OwnershipResponseDevices, err error)

AssignOwnerDevices is a method that adds the owner from namespace

func (*Server) AssignOwnerDevicesQ

func (s *Server) AssignOwnerDevicesQ(ctx context.Context, request *registrypb.OwnershipRequestDevices) (err error)

AssignOwnerDevicesQ is a method to delete the Account

func (*Server) Create

Create is a method for creating Devices

func (*Server) CreateQ

CreateQ is a method to execute Dgraph Query to Create a new Device

func (*Server) Delete

func (s *Server) Delete(ctx context.Context, request *registrypb.DeleteRequest) (response *registrypb.DeleteResponse, err error)

Delete is a method that deletes a Device

func (*Server) DeleteQ

func (s *Server) DeleteQ(ctx context.Context, request *registrypb.DeleteRequest) (response *registrypb.DeleteResponse, err error)

DeleteQ is a method to execute Dgraph Query to delete Devices

func (*Server) Get

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

Get is a method for get details for a Device

func (*Server) GetByFingerprint

GetByFingerprint is a method for get FringerPrint for a Device

func (*Server) GetByFingerprintQ

GetByFingerprintQ is a method to execute Dgraph Query to Get Fringerprint of a specific Device

func (*Server) GetDeviceStatus

func (s *Server) GetDeviceStatus(ctx context.Context, request *registrypb.GetDeviceStatusRequest) (response *registrypb.GetDeviceStatusResponse, err error)

return device status from repo

func (*Server) GetQ

func (s *Server) GetQ(ctx context.Context, request *registrypb.GetRequest, accesstocert bool) (response *registrypb.GetResponse, err error)

GetQ is a method to execute Dgraph Query to Get details of a specific Device

func (*Server) List

func (s *Server) List(ctx context.Context, request *registrypb.ListDevicesRequest) (response *registrypb.ListResponse, err error)

List is a method that list all Devices for a specific Namespace

func (*Server) ListForAccountQ

func (s *Server) ListForAccountQ(ctx context.Context, request *registrypb.ListDevicesRequest) (response *registrypb.ListResponse, err error)

ListForAccountQ is a method to execute Dgraph Query to List details of all Devices

func (*Server) ListQ

func (s *Server) ListQ(ctx context.Context, request *registrypb.ListDevicesRequest) (response *registrypb.ListResponse, err error)

ListQ is a method to execute Dgraph Query to List details of all Devices

func (*Server) RemoveOwnerDevices

func (s *Server) RemoveOwnerDevices(ctx context.Context, request *registrypb.OwnershipRequestDevices) (response *registrypb.OwnershipResponseDevices, err error)

RemoveOwnerDevices is a method that removes the owner from namespace

func (*Server) RemoveOwnerDevicesQ

func (s *Server) RemoveOwnerDevicesQ(ctx context.Context, request *registrypb.OwnershipRequestDevices) (err error)

RemoveOwnerDevicesQ is a method to delete the Account.

func (*Server) Update

func (s *Server) Update(ctx context.Context, request *registrypb.UpdateRequest) (response *registrypb.UpdateResponse, err error)

Update is a method for updating Devices details

func (*Server) UpdateQ

func (s *Server) UpdateQ(ctx context.Context, request *registrypb.UpdateRequest) (response *registrypb.UpdateResponse, err error)

UpdateQ is a method to execute Dgraph Query to Update a specific Device

type X509Cert

type X509Cert struct {
	dgraph.Node
	PemData              string `json:"pem_data,omitempty"`
	Algorithm            string `json:"algorithm,omitempty"`
	Fingerprint          []byte `json:"fingerprint,omitempty"`
	FingerprintAlgorithm string `json:"fingerprint.algorithm,omitempty"`
}

X509Cert is Certificate data struct which is refered in Device data strcuture

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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