Documentation ¶
Index ¶
- Constants
- type Model
- func (m *Model) GetButtonState(options ...resource.ReadOption) *gen.ButtonState
- func (m *Model) PullButtonState(ctx context.Context, options ...resource.ReadOption) <-chan PullButtonStateChange
- func (m *Model) UpdateButtonState(value *gen.ButtonState, options ...resource.WriteOption) (*gen.ButtonState, error)
- type ModelServer
- func (s *ModelServer) GetButtonState(ctx context.Context, request *gen.GetButtonStateRequest) (*gen.ButtonState, error)
- func (s *ModelServer) PullButtonState(request *gen.PullButtonStateRequest, ...) error
- func (s *ModelServer) UpdateButtonState(ctx context.Context, request *gen.UpdateButtonStateRequest) (*gen.ButtonState, error)
- type PullButtonStateChange
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 }
Click to show internal directories.
Click to hide internal directories.