Documentation ¶
Index ¶
- type Context
- func (c *Context) Copy(src io.Reader) (written int64, err error)
- func (c *Context) Deadline() (deadline time.Time, ok bool)
- func (c *Context) Done() <-chan struct{}
- func (c *Context) Err() error
- func (c *Context) Port() int
- func (c *Context) Print(a ...interface{}) (n int, err error)
- func (c *Context) Printf(format string, a ...interface{}) (n int, err error)
- func (c *Context) Println(a ...interface{}) (n int, err error)
- func (c *Context) Recv() <-chan struct{}
- func (c *Context) ServePort() string
- func (c *Context) Signal() (os.Signal, error)
- func (c *Context) Value(key interface{}) interface{}
- func (c *Context) Write(p []byte) (n int, err error)
- type Logger
- type Runner
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context struct for golet
func (*Context) Done ¶
func (c *Context) Done() <-chan struct{}
Done is implemented for context.Context
func (*Context) Print ¶
Print formats using the default formats for its operands and writes to golet writer. Spaces are added between operands when neither is a string. It returns the number of bytes written and any write error encountered.
func (*Context) Printf ¶
Printf formats according to a format specifier and writes to golet writer It returns the number of bytes written and any write error encountered.
func (*Context) Println ¶
Println formats using the default formats for its operands and writes to golet writer. Spaces are always added between operands and a newline is appended. It returns the number of bytes written and any write error encountered.
func (*Context) Recv ¶
func (c *Context) Recv() <-chan struct{}
Recv send channel when a process receives a signal.
type Runner ¶
type Runner interface { SetInterval(time.Duration) EnableColor() SetLogger(io.Writer) DisableLogger() DisableExecNotice() SetCtxCancelSignal(syscall.Signal) Env(map[string]string) error Add(...Service) error Run() error }
Runner interface have methods for configuration and to run services.
type Service ¶
type Service struct { Exec string Code func(context.Context) error // Routine of services. Worker int // Number of goroutine. The maximum number of workers is 100. Tag string // Keyword for log. Every string // Crontab like format. See https://godoc.org/github.com/robfig/cron#hdr-CRON_Expression_Format // contains filtered or unexported fields }
Service struct to add services to golet.