anbe

package
v0.0.0-...-a205234 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableTrace

func EnableTrace(enable bool)

func NewCore

func NewCore(hub Hub) *coreDso

Types

type AllArgs

type AllArgs struct {
	Files []*OneArgs
}

type CreateArgs

type CreateArgs struct {
	Id   uint
	Name string
	Data string
}

type Dao

type Dao interface {
	Close()
	All() []FileDro
	Delete(id uint)
	Create(name string, data string) *FileDro
	Rename(id uint, name string) *FileDro
	Update(id uint, data string) *FileDro
	Enable(id uint, enabled bool) *FileDro
}

func NewDao

func NewDao(path string) Dao

type DeleteArgs

type DeleteArgs struct {
	Id uint
}

type EnableArgs

type EnableArgs struct {
	Id      uint
	Enabled bool
}

type Entry

type Entry interface {
	Port() int
	Close()
}

func NewEntry

func NewEntry(hub Hub, port int) Entry

type FileDro

type FileDro struct {
	gorm.Model
	Name    string
	Data    string
	Enabled bool
}

type Hub

type Hub interface {
	Subscribe(sid string, fid uint, client func(mutation *Mutation))
	Unsubscribe(id string)
	Apply(mutation *Mutation)
	NextId() string
	Close()
}

func NewHub

func NewHub(state State) Hub

type Mutation

type Mutation struct {
	Sid     uint
	Session string
	Fid     uint
	Name    string
	Args    interface{}
	Pin     []byte
	Pout    []byte
}

type OneArgs

type OneArgs struct {
	Id      uint
	Name    string
	Data    string
	Enabled bool
}

type RenameArgs

type RenameArgs struct {
	Id   uint
	Name string
}

type State

type State interface {
	All() *AllArgs
	One(id uint) *OneArgs
	Apply(mutation *Mutation) error
	Close()
}

func NewState

func NewState(dao Dao) State

type UpdateArgs

type UpdateArgs struct {
	Id   uint
	Data string
}

Jump to

Keyboard shortcuts

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