base

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2020 License: BSD-2-Clause Imports: 10 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*App) Bus

func (this *App) Bus() gopi.Bus

func (*App) Close

func (this *App) Close() error

func (*App) Display

func (this *App) Display() gopi.Display

func (*App) Emit added in v2.0.4

func (this *App) Emit(e gopi.Event)

func (*App) Flags

func (this *App) Flags() gopi.Flags

func (*App) I2C added in v2.0.4

func (this *App) I2C() gopi.I2C

func (*App) Init

func (this *App) Init(name string, units []string) error

func (*App) Log

func (this *App) Log() gopi.Logger

func (*App) Platform

func (this *App) Platform() gopi.Platform

func (*App) Run

func (this *App) Run() int

func (*App) Start

func (this *App) Start(args []string) int

func (*App) String

func (this *App) String() string

func (*App) Timer

func (this *App) Timer() gopi.Timer

func (*App) UnitInstance

func (this *App) UnitInstance(name string) gopi.Unit

func (*App) UnitInstancesByName

func (this *App) UnitInstancesByName(name string) []gopi.Unit

func (*App) WaitForSignal

func (this *App) WaitForSignal(ctx context.Context, signals ...os.Signal) error

type Logger

type Logger struct {
	Unit
	// contains filtered or unexported fields
}

Logger is the base struct for any logger

func (*Logger) Clone

func (this *Logger) Clone(name string) gopi.Logger

func (*Logger) Debug

func (this *Logger) Debug(args ...interface{})

func (*Logger) Error

func (this *Logger) Error(err error) error

func (*Logger) Init

func (this *Logger) Init(writer io.Writer, name string, debug bool) error

func (*Logger) IsDebug

func (this *Logger) IsDebug() bool

func (*Logger) Name

func (this *Logger) Name() string

func (*Logger) String

func (this *Logger) String() string

type Publisher

type Publisher struct {
	sync.Mutex
	sync.WaitGroup
	// contains filtered or unexported fields
}

func (*Publisher) Close

func (this *Publisher) Close() error

func (*Publisher) Emit

func (this *Publisher) Emit(queue uint, value interface{})

func (*Publisher) Len

func (this *Publisher) Len(queue uint) int

func (*Publisher) Subscribe

func (this *Publisher) Subscribe(queue uint, capacity int, callback func(value interface{})) gopi.Channel

Subscribe receives emitted messages until Unsubscribe is called

func (*Publisher) SubscribeInt

func (this *Publisher) SubscribeInt(queue uint, capacity int) <-chan interface{}

func (*Publisher) Unsubscribe

func (this *Publisher) Unsubscribe(stop gopi.Channel)

Unsubscribe waits until the receive loop has completed

func (*Publisher) UnsubscribeInt

func (this *Publisher) UnsubscribeInt(c <-chan interface{}) bool

type Unit

type Unit struct {
	Log    gopi.Logger
	Closed bool
}

Unit is the base struct for any unit

func (*Unit) Close

func (this *Unit) Close() error

func (*Unit) Init

func (this *Unit) Init(log gopi.Logger) error

func (*Unit) String

func (this *Unit) String() string

Jump to

Keyboard shortcuts

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