shadow

package
v0.0.0-...-094fc0d Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Copyright © 2021-2023 Infinite Devices GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021-2023 Infinite Devices GmbH Nikita Ivanovski info@slnt-opp.xyz

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var Dispatch func(*pb.Shadow, func())

Dispatch stamps a shadow and publishes it without letting a later sequence go out first. The shadow command sets it to the running server.

View Source
var Inbound func(*pb.Shadow)

Inbound stamps a shadow when it enters this process from RabbitMQ. The shadow command sets it to the running server.

Functions

func Key

func Key(device string, key pb.StateKey) string

func MergeJSON

func MergeJSON(old, new []byte) ([]byte, error)

func NewRedisSequencer

func NewRedisSequencer(rdb redis.Cmdable) sequencer

func ValidateState

func ValidateState(st *pb.State) error

Types

type ReadRecorder

type ReadRecorder interface {
	RecordRead(ctx context.Context, device, account, tokenID string)
}

type ShadowServiceServer

type ShadowServiceServer struct {
	pb.UnimplementedShadowServiceServer
	// contains filtered or unexported fields
}

func NewShadowServiceServer

func NewShadowServiceServer(log *zap.Logger, rdb redis.Cmdable, ps pubsub.PubSub) *ShadowServiceServer

func (*ShadowServiceServer) Accept

func (s *ShadowServiceServer) Accept(sh *pb.Shadow)

func (*ShadowServiceServer) Dispatch

func (s *ShadowServiceServer) Dispatch(sh *pb.Shadow, pub func())

func (*ShadowServiceServer) Get

func (*ShadowServiceServer) MergeAndStore

func (s *ShadowServiceServer) MergeAndStore(log *zap.Logger, device string, skey pb.StateKey, state *pb.State)

func (*ShadowServiceServer) Patch

func (s *ShadowServiceServer) Patch(ctx context.Context, req *pb.Shadow) (*pb.Shadow, error)

func (*ShadowServiceServer) PatchMany

func (*ShadowServiceServer) Persister

func (s *ShadowServiceServer) Persister()

func (*ShadowServiceServer) PublishDeviceScope

func (s *ShadowServiceServer) PublishDeviceScope(ctx context.Context, ev *pb.Shadow) (*emptypb.Empty, error)

func (*ShadowServiceServer) Remove

func (s *ShadowServiceServer) Remove(ctx context.Context, req *pb.RemoveRequest) (*pb.Shadow, error)

func (*ShadowServiceServer) SetReadRecorder

func (s *ShadowServiceServer) SetReadRecorder(r ReadRecorder)

func (*ShadowServiceServer) SetSequencer

func (s *ShadowServiceServer) SetSequencer(ids sequencer)

func (*ShadowServiceServer) Store

func (s *ShadowServiceServer) Store(log *zap.Logger, device string, skey pb.StateKey, state interface{}) (string, bool)

func (*ShadowServiceServer) StoreConnectionState

func (s *ShadowServiceServer) StoreConnectionState(log *zap.Logger, device string, state *pb.ConnectionState)

func (*ShadowServiceServer) StreamShadow

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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