srv

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Usage func()

Functions

func Help added in v1.0.13

func Help()

func Main

func Main(app App)

Main server main

func Wait added in v1.0.9

func Wait(app App)

Wait wait signal for reload or shutdown the app

Types

type App

type App interface {
	// Name app/service name
	Name() string

	// DisplayName app/service display name
	DisplayName() string

	// Description app/service description
	Description() string

	// Version app version
	Version() string

	// Revision app revision
	Revision() string

	// BuildTime app build time
	BuildTime() time.Time

	// Init initialize the app
	Init()

	// Reload reload the app
	Reload()

	// Run run the app
	Run()

	// Shutdown shutdown the app
	Shutdown()

	// Wait wait signal for reload or shutdown
	Wait()
}

type Cmd added in v1.0.13

type Cmd interface {
	// Flag set custom options
	Flag()

	// CmdHelp print custom command
	CmdHelp(io.Writer)

	// Exec execute optional command except the internal command
	// Basic: 'help' 'usage' 'version'
	// Windows only: 'install' 'remove' 'start' 'stop' 'debug'
	Exec(cmd string)
}

Jump to

Keyboard shortcuts

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