app

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFormatRunTime added in v0.0.6

func GetFormatRunTime() string

func GetRunTime added in v0.0.6

func GetRunTime() int64

func StartTime added in v0.0.6

func StartTime() int64

func StartTimestamp added in v0.0.6

func StartTimestamp() string

Types

type App

type App struct {
	Action  func(AppInterface) error
	Reload  func(AppInterface) error
	Stop    func(AppInterface) error
	Panic   func(AppInterface)
	Show    func(*gui.Table)
	PidFile func(AppInterface) string
	// contains filtered or unexported fields
}

func NewApp

func NewApp(name string) *App

func (*App) Flag

func (a *App) Flag(name string, def any, t Type, comment string)

func (*App) Get

func (a *App) Get(name string) (*Flag, error)

func (*App) Name added in v0.0.6

func (a *App) Name() string

func (*App) Pid

func (a *App) Pid() int

func (*App) PidString

func (a *App) PidString() string

func (*App) Run

func (a *App) Run() error

func (*App) SetDebugLevel added in v0.0.8

func (a *App) SetDebugLevel(t debug.DebugType)

func (*App) SetServ added in v1.0.4

func (a *App) SetServ(serv ServInterface)

type AppInterface added in v1.0.6

type AppInterface interface {
	Get(name string) (*Flag, error)
	Name() string
	SetDebugLevel(t debug.DebugType)
	Flag(name string, def any, t Type, comment string)
}

type Flag

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

func (*Flag) Bool

func (f *Flag) Bool() bool

func (*Flag) Int

func (f *Flag) Int() int

func (*Flag) String

func (f *Flag) String() string

type ServBase added in v1.0.6

type ServBase struct {
}

func (*ServBase) Flag added in v1.0.6

func (s *ServBase) Flag(AppInterface) error

func (*ServBase) Panic added in v1.0.9

func (s *ServBase) Panic(a AppInterface)

func (*ServBase) Reload added in v1.0.6

func (s *ServBase) Reload(AppInterface) error

type ServInterface added in v1.0.4

type ServInterface interface {
	Flag(AppInterface) error
	Init(AppInterface) error
	Run(AppInterface) error
	Shutdown(AppInterface) error
	Reload(AppInterface) error
	Panic(AppInterface)
}

type Type

type Type int
const (
	TYPE_INT    Type = 1
	TYPE_STRING Type = 2
	TYPE_BOOL   Type = 3
)

Jump to

Keyboard shortcuts

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