core

package
v0.0.0-...-91c63a3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2016 License: GPL-2.0 Imports: 8 Imported by: 0

README

Core functionality

This contains various parts of the core application, including:

  • Module definition
  • ResponseWriter definition
  • Input definition
  • Default Response object
  • Default input object
  • Scheduling and control functionality
  • Various utility functions commonly used by modules

As the codebase grows, this will probably be split out into various sub libs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertByte

func ConvertByte(in interface{}) ([]byte, error)

func ConvertInt

func ConvertInt(in interface{}) (int64, error)

Types

type ConfigInput

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

func NewConfigInput

func NewConfigInput(in map[string]interface{}) *ConfigInput

func (*ConfigInput) Data

func (c *ConfigInput) Data(val string) (interface{}, error)

func (*ConfigInput) Type

func (c *ConfigInput) Type(val string) (string, error)

func (*ConfigInput) Validate

func (c *ConfigInput) Validate(schema InputSchema) error

type Input

type Input interface {
	Data(string) (interface{}, error)
	Type(string) (string, error)
	Validate(InputSchema) error
}

type InputSchema

type InputSchema map[string]struct {
	Types    []string
	Required bool
	Values   []interface{}
}

func NewInputSchema

func NewInputSchema(in []byte) (InputSchema, error)

type Module

type Module interface {
	Name() string
	Configure(Input) error
	Run(rwvfs.FileSystem, ResponseWriter)
}

type Response

type Response struct {
	Ok     bool
	Notify bool
	Fields log.Fields
}

func NewResponse

func NewResponse() *Response

func (*Response) Changed

func (r *Response) Changed(ok bool)

func (*Response) Message

func (r *Response) Message(level string, messages ...interface{})

func (*Response) Success

func (r *Response) Success(ok bool)

type ResponseWriter

type ResponseWriter interface {
	Success(bool)
	Changed(bool)
	Message(string, ...interface{})
}

type RunControl

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

func NewRunControl

func NewRunControl() *RunControl

func (RunControl) Register

func (r RunControl) Register() func()

func (RunControl) Start

func (r RunControl) Start()

func (RunControl) Wait

func (r RunControl) Wait()

Jump to

Keyboard shortcuts

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