button

package
v0.2024.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const TraitName trait.Name = "smartcore.bos.Button"

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

func NewModel

func NewModel(initialPressState gen.ButtonState_Press) *Model

func (*Model) GetButtonState

func (m *Model) GetButtonState(options ...resource.ReadOption) *gen.ButtonState

func (*Model) PullButtonState

func (m *Model) PullButtonState(ctx context.Context, options ...resource.ReadOption) <-chan PullButtonStateChange

func (*Model) UpdateButtonState

func (m *Model) UpdateButtonState(value *gen.ButtonState, options ...resource.WriteOption) (*gen.ButtonState, error)

type ModelServer

type ModelServer struct {
	gen.UnimplementedButtonApiServer
	// contains filtered or unexported fields
}

func NewModelServer

func NewModelServer(model *Model) *ModelServer

func (*ModelServer) GetButtonState

func (s *ModelServer) GetButtonState(ctx context.Context, request *gen.GetButtonStateRequest) (*gen.ButtonState, error)

func (*ModelServer) PullButtonState

func (s *ModelServer) PullButtonState(request *gen.PullButtonStateRequest, server gen.ButtonApi_PullButtonStateServer) error

func (*ModelServer) UpdateButtonState

func (s *ModelServer) UpdateButtonState(ctx context.Context, request *gen.UpdateButtonStateRequest) (*gen.ButtonState, error)

type PullButtonStateChange

type PullButtonStateChange struct {
	Value         *gen.ButtonState
	ChangeTime    time.Time
	LastSeedValue bool
}

Jump to

Keyboard shortcuts

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