Documentation
¶
Index ¶
- Constants
- Variables
- func CaptureRaspiStill(width, height int, cameraParams map[string]interface{}) (bytes []byte, err error)
- type CurlMod
- type DedupArgs
- type EchoMod
- type EvalArgs
- type EvalMod
- func (m *EvalMod) DoWithJSON(fn string, jsonStr []byte, jrw *ResponseCollector)
- func (m *EvalMod) EvalAndRegexp(fn string, jsonStr []byte, jrw *ResponseCollector)
- func (m *EvalMod) EvalFloat(vInterface interface{}, op string, v2Interface interface{}) (bool, error)
- func (m *EvalMod) EvalInt(vInterface interface{}, op string, v2Interface interface{}) (bool, error)
- func (m *EvalMod) EvalString(vInterface interface{}, op string, v2Interface interface{}) (bool, error)
- func (m *EvalMod) GetArgSuggestions(fn string, arg string, otherArgs map[string]interface{}) map[string]string
- func (m *EvalMod) GetFunctions() []string
- func (m *EvalMod) GetPossibleArgs(fn string) []string
- func (m *EvalMod) Regexp(vInterface interface{}, op string, regexpInterface interface{}) (string, error)
- type FieldWithType
- type FluxMod
- type FritzMod
- func (m *FritzMod) DoWithJSON(fn string, jsonStr []byte, jrw *ResponseCollector)
- func (m *FritzMod) GetArgSuggestions(fn string, arg string, otherArgs map[string]interface{}) map[string]string
- func (m *FritzMod) GetDevices() map[string]string
- func (m *FritzMod) GetFunctions() []string
- func (m *FritzMod) GetPossibleArgs(fn string) []string
- type JsonArgs
- type MessageAndTime
- type Mod
- type MuttMod
- type MuttModConfig
- type MuttParameters
- type OutputModeT
- type RaspistillMod
- func (m *RaspistillMod) DoWithJSON(fn string, jsonStr []byte, jrw *ResponseCollector)
- func (m *RaspistillMod) GetArgSuggestions(fn string, arg string, otherArgs map[string]interface{}) map[string]string
- func (m *RaspistillMod) GetFunctions() []string
- func (m *RaspistillMod) GetPossibleArgs(fn string) []string
- type Response
- type ResponseCollector
- func (j *ResponseCollector) Clone() *ResponseCollector
- func (j *ResponseCollector) GetCreator() string
- func (j *ResponseCollector) GetFinalResponse(pretty bool) (int, ResponseType, []byte)
- func (j *ResponseCollector) GetMarshalledOutput() ([]byte, error)
- func (j *ResponseCollector) GetOutput() (*Response, error)
- func (j *ResponseCollector) GetResponseTree() []byte
- func (j *ResponseCollector) GetStatusCode() int
- func (j *ResponseCollector) IsRoot() bool
- func (j *ResponseCollector) IsStatusFailed() bool
- func (j *ResponseCollector) SetContext(ta *TemplateAction)
- func (j *ResponseCollector) SetOutputMode(outputMode OutputModeT)
- func (j *ResponseCollector) WriteError(statusCode int, format string, a ...interface{})
- func (j *ResponseCollector) WriteMessageWithCode(statusCode int, response interface{})
- func (j *ResponseCollector) WriteMessageWithCodef(statusCode int, format string, a ...interface{})
- func (j *ResponseCollector) WriteResponseWithCodeAndType(statusCode int, outputType ResponseType, response interface{})
- func (j *ResponseCollector) WriteSuccess()
- func (j *ResponseCollector) WriteSuccessMessage(response interface{})
- func (j *ResponseCollector) WriteSuccessf(format string, a ...interface{})
- type ResponseType
- type ScriptMod
- func (m *ScriptMod) DoWithJSON(function string, jsonStr []byte, jrw *ResponseCollector)
- func (m *ScriptMod) GetArgSuggestions(fn string, arg string, otherArgs map[string]interface{}) map[string]string
- func (m *ScriptMod) GetFunctions() []string
- func (m *ScriptMod) GetPossibleArgs(fn string) []string
- type ScriptModConfig
- type ScriptParameters
- type SystemMod
- type TelegramConfig
- type TelegramMod
- func (m *TelegramMod) DoWithJSON(function string, jsonStr []byte, jrw *ResponseCollector)
- func (m *TelegramMod) GetArgSuggestions(fn string, arg string, otherArgs map[string]interface{}) map[string]string
- func (m *TelegramMod) GetFunctions() []string
- func (m *TelegramMod) GetPossibleArgs(fn string) []string
- type Template
- type TemplateAction
- type TemplateMod
- func (m *TemplateMod) DoWithJSON(templateName string, jsonStr []byte, jrw *ResponseCollector)
- func (m *TemplateMod) ExecuteModWithJson(mod string, fn string, jsonStr []byte, jrw *ResponseCollector)
- func (m *TemplateMod) ExecuteTemplateAction(ta *TemplateAction, jrw *ResponseCollector)
- func (m *TemplateMod) ExecuteTemplateActionWithAdditionalArgs(t *TemplateAction, moreJsonArgs []byte, jrw *ResponseCollector)
- func (m *TemplateMod) ExecuteTemplateWithAdditionalArgs(template *Template, jsonStr []byte, jrw *ResponseCollector)
- func (m *TemplateMod) GetAllTemplates(includeTemp bool) map[string]*Template
- func (m *TemplateMod) GetArgSuggestions(fn string, arg string, otherArgs map[string]interface{}) map[string]string
- func (m *TemplateMod) GetFunctions() []string
- func (m *TemplateMod) GetPossibleArgs(fn string) []string
- func (m *TemplateMod) GetTemplate(templateName string) (*Template, bool)
- func (m *TemplateMod) GetTemporaryTemplateAction(ID string) *TemplateAction
- func (m *TemplateMod) RemoveTemporaryTemplate(ID string)
- func (m *TemplateMod) SaveTemplateAction(templateName string, ta *TemplateAction) error
- type TemplateModConfig
Constants ¶
View Source
const ( OutputModeFirstNonEmpty = iota OutputModeIgnore )
View Source
const ( ResponseTypeNone = iota ResponseTypePlainText ResponseTypeJSON ResponseTypeJPEG )
Variables ¶
View Source
var DefaultConfig = TemplateModConfig{}
View Source
var DefaultTelegramConfig = TelegramConfig{Token: ""}
View Source
var MuttModDefaultConfig = MuttModConfig{DefaultSubject: "default subject", DefaultBody: "default Body", DefaultRecv: ""}
View Source
var ScriptModDefaultConfig = ScriptModConfig{"/etc/freepsd/scripts"}
Functions ¶
Types ¶
type CurlMod ¶
type CurlMod struct { }
func (*CurlMod) DoWithJSON ¶
func (m *CurlMod) DoWithJSON(function string, jsonStr []byte, jrw *ResponseCollector)
func (*CurlMod) GetArgSuggestions ¶ added in v0.9.1
func (*CurlMod) GetFunctions ¶ added in v0.9.1
func (*CurlMod) GetPossibleArgs ¶ added in v0.9.1
type EchoMod ¶
type EchoMod struct { }
func (*EchoMod) DoWithJSON ¶
func (m *EchoMod) DoWithJSON(fn string, jsonStr []byte, jrw *ResponseCollector)
func (*EchoMod) GetArgSuggestions ¶ added in v0.9.1
func (*EchoMod) GetFunctions ¶ added in v0.9.1
func (*EchoMod) GetPossibleArgs ¶ added in v0.9.1
type EvalMod ¶ added in v0.9.1
type EvalMod struct {
// contains filtered or unexported fields
}
func (*EvalMod) DoWithJSON ¶ added in v0.9.1
func (m *EvalMod) DoWithJSON(fn string, jsonStr []byte, jrw *ResponseCollector)
func (*EvalMod) EvalAndRegexp ¶ added in v0.9.1
func (m *EvalMod) EvalAndRegexp(fn string, jsonStr []byte, jrw *ResponseCollector)
func (*EvalMod) EvalString ¶ added in v0.9.1
func (*EvalMod) GetArgSuggestions ¶ added in v0.9.1
func (*EvalMod) GetFunctions ¶ added in v0.9.1
func (*EvalMod) GetPossibleArgs ¶ added in v0.9.1
type FieldWithType ¶
type FluxMod ¶
type FluxMod struct {
// contains filtered or unexported fields
}
func NewFluxMod ¶
func NewFluxMod(cr *utils.ConfigReader) *FluxMod
func (*FluxMod) DoWithJSON ¶
func (m *FluxMod) DoWithJSON(fn string, jsonStr []byte, jrw *ResponseCollector)
func (*FluxMod) GetArgSuggestions ¶ added in v0.9.1
func (*FluxMod) GetFunctions ¶ added in v0.9.1
func (*FluxMod) GetPossibleArgs ¶ added in v0.9.1
type FritzMod ¶
type FritzMod struct {
// contains filtered or unexported fields
}
func NewFritzMod ¶
func NewFritzMod(cr *utils.ConfigReader) *FritzMod
func (*FritzMod) DoWithJSON ¶
func (m *FritzMod) DoWithJSON(fn string, jsonStr []byte, jrw *ResponseCollector)
func (*FritzMod) GetArgSuggestions ¶ added in v0.9.1
func (*FritzMod) GetDevices ¶ added in v0.9.1
func (*FritzMod) GetFunctions ¶ added in v0.9.1
func (*FritzMod) GetPossibleArgs ¶ added in v0.9.1
type MessageAndTime ¶ added in v0.9.1
type MessageAndTime struct {
// contains filtered or unexported fields
}
type MuttMod ¶ added in v0.9.1
type MuttMod struct {
// contains filtered or unexported fields
}
func NewMuttMod ¶ added in v0.9.1
func NewMuttMod(cr *utils.ConfigReader) *MuttMod
func (*MuttMod) DoWithJSON ¶ added in v0.9.1
func (m *MuttMod) DoWithJSON(function string, inputBytes []byte, jrw *ResponseCollector)
func (*MuttMod) GetArgSuggestions ¶ added in v0.9.1
func (*MuttMod) GetFunctions ¶ added in v0.9.1
func (*MuttMod) GetPossibleArgs ¶ added in v0.9.1
type MuttModConfig ¶ added in v0.9.1
type MuttParameters ¶ added in v0.9.1
type OutputModeT ¶ added in v0.9.1
type OutputModeT int
func (OutputModeT) MarshalJSON ¶ added in v0.9.1
func (g OutputModeT) MarshalJSON() ([]byte, error)
func (*OutputModeT) UnmarshalJSON ¶ added in v0.9.1
func (g *OutputModeT) UnmarshalJSON(b []byte) error
type RaspistillMod ¶
type RaspistillMod struct { }
func (*RaspistillMod) DoWithJSON ¶
func (m *RaspistillMod) DoWithJSON(fn string, jsonStr []byte, jrw *ResponseCollector)
func (*RaspistillMod) GetArgSuggestions ¶ added in v0.9.1
func (*RaspistillMod) GetFunctions ¶ added in v0.9.1
func (m *RaspistillMod) GetFunctions() []string
func (*RaspistillMod) GetPossibleArgs ¶ added in v0.9.1
func (m *RaspistillMod) GetPossibleArgs(fn string) []string
type Response ¶ added in v0.9.1
type Response struct { StatusCode int `json:",omitempty"` Output interface{} `json:",omitempty"` OutputType ResponseType `json:",omitempty"` }
type ResponseCollector ¶ added in v0.9.1
type ResponseCollector struct {
// contains filtered or unexported fields
}
func NewResponseCollector ¶ added in v0.9.1
func NewResponseCollector(creator string) *ResponseCollector
func (*ResponseCollector) Clone ¶ added in v0.9.1
func (j *ResponseCollector) Clone() *ResponseCollector
func (*ResponseCollector) GetCreator ¶ added in v0.9.1
func (j *ResponseCollector) GetCreator() string
func (*ResponseCollector) GetFinalResponse ¶ added in v0.9.1
func (j *ResponseCollector) GetFinalResponse(pretty bool) (int, ResponseType, []byte)
func (*ResponseCollector) GetMarshalledOutput ¶ added in v0.9.1
func (j *ResponseCollector) GetMarshalledOutput() ([]byte, error)
GetMarshalledOutput runs GetOutput and returnes the json-encoded Output or an error if the operation failed
func (*ResponseCollector) GetOutput ¶ added in v0.9.1
func (j *ResponseCollector) GetOutput() (*Response, error)
GetOutput collects the output of the collector and all it's children
func (*ResponseCollector) GetResponseTree ¶ added in v0.9.1
func (j *ResponseCollector) GetResponseTree() []byte
func (*ResponseCollector) GetStatusCode ¶ added in v0.9.1
func (j *ResponseCollector) GetStatusCode() int
func (*ResponseCollector) IsRoot ¶ added in v0.9.1
func (j *ResponseCollector) IsRoot() bool
func (*ResponseCollector) IsStatusFailed ¶ added in v0.9.1
func (j *ResponseCollector) IsStatusFailed() bool
func (*ResponseCollector) SetContext ¶ added in v0.9.1
func (j *ResponseCollector) SetContext(ta *TemplateAction)
func (*ResponseCollector) SetOutputMode ¶ added in v0.9.1
func (j *ResponseCollector) SetOutputMode(outputMode OutputModeT)
func (*ResponseCollector) WriteError ¶ added in v0.9.1
func (j *ResponseCollector) WriteError(statusCode int, format string, a ...interface{})
func (*ResponseCollector) WriteMessageWithCode ¶ added in v0.9.1
func (j *ResponseCollector) WriteMessageWithCode(statusCode int, response interface{})
func (*ResponseCollector) WriteMessageWithCodef ¶ added in v0.9.1
func (j *ResponseCollector) WriteMessageWithCodef(statusCode int, format string, a ...interface{})
func (*ResponseCollector) WriteResponseWithCodeAndType ¶ added in v0.9.1
func (j *ResponseCollector) WriteResponseWithCodeAndType(statusCode int, outputType ResponseType, response interface{})
func (*ResponseCollector) WriteSuccess ¶ added in v0.9.1
func (j *ResponseCollector) WriteSuccess()
func (*ResponseCollector) WriteSuccessMessage ¶ added in v0.9.1
func (j *ResponseCollector) WriteSuccessMessage(response interface{})
func (*ResponseCollector) WriteSuccessf ¶ added in v0.9.1
func (j *ResponseCollector) WriteSuccessf(format string, a ...interface{})
type ResponseType ¶ added in v0.9.1
type ResponseType int
func (ResponseType) MarshalJSON ¶ added in v0.9.1
func (g ResponseType) MarshalJSON() ([]byte, error)
func (ResponseType) ToString ¶ added in v0.9.1
func (g ResponseType) ToString() (string, error)
func (*ResponseType) UnmarshalJSON ¶ added in v0.9.1
func (g *ResponseType) UnmarshalJSON(b []byte) error
type ScriptMod ¶
type ScriptMod struct {
ScriptDir string
}
func NewScriptMod ¶ added in v0.9.1
func NewScriptMod(cr *utils.ConfigReader) *ScriptMod
func (*ScriptMod) DoWithJSON ¶
func (m *ScriptMod) DoWithJSON(function string, jsonStr []byte, jrw *ResponseCollector)
func (*ScriptMod) GetArgSuggestions ¶ added in v0.9.1
func (*ScriptMod) GetFunctions ¶ added in v0.9.1
func (*ScriptMod) GetPossibleArgs ¶ added in v0.9.1
type ScriptModConfig ¶ added in v0.9.1
type ScriptModConfig struct {
ScriptDir string
}
type ScriptParameters ¶
type SystemMod ¶ added in v0.9.1
type SystemMod struct {
Modinator *TemplateMod
}
func NewSystemeMod ¶ added in v0.9.1
func NewSystemeMod(modintor *TemplateMod) *SystemMod
func (*SystemMod) DoWithJSON ¶ added in v0.9.1
func (m *SystemMod) DoWithJSON(fn string, jsonStr []byte, jrw *ResponseCollector)
func (*SystemMod) GetArgSuggestions ¶ added in v0.9.1
func (*SystemMod) GetFunctions ¶ added in v0.9.1
func (*SystemMod) GetPossibleArgs ¶ added in v0.9.1
type TelegramConfig ¶ added in v0.9.1
type TelegramMod ¶ added in v0.9.1
type TelegramMod struct {
// contains filtered or unexported fields
}
func NewTelegramBot ¶ added in v0.9.1
func NewTelegramBot(cr *utils.ConfigReader) *TelegramMod
func (*TelegramMod) DoWithJSON ¶ added in v0.9.1
func (m *TelegramMod) DoWithJSON(function string, jsonStr []byte, jrw *ResponseCollector)
func (*TelegramMod) GetArgSuggestions ¶ added in v0.9.1
func (*TelegramMod) GetFunctions ¶ added in v0.9.1
func (m *TelegramMod) GetFunctions() []string
func (*TelegramMod) GetPossibleArgs ¶ added in v0.9.1
func (m *TelegramMod) GetPossibleArgs(fn string) []string
type Template ¶
type Template struct { Actions []TemplateAction OutputMode OutputModeT `json:",omitempty"` }
type TemplateAction ¶
type TemplateMod ¶
type TemplateMod struct { Mods map[string]Mod Config TemplateModConfig TemporaryTemplates map[string]*Template ExternalTemplates map[string]*Template Cache map[string][]byte // contains filtered or unexported fields }
func NewTemplateMod ¶
func NewTemplateMod(cr *utils.ConfigReader) *TemplateMod
func (*TemplateMod) DoWithJSON ¶
func (m *TemplateMod) DoWithJSON(templateName string, jsonStr []byte, jrw *ResponseCollector)
func (*TemplateMod) ExecuteModWithJson ¶
func (m *TemplateMod) ExecuteModWithJson(mod string, fn string, jsonStr []byte, jrw *ResponseCollector)
func (*TemplateMod) ExecuteTemplateAction ¶ added in v0.9.1
func (m *TemplateMod) ExecuteTemplateAction(ta *TemplateAction, jrw *ResponseCollector)
func (*TemplateMod) ExecuteTemplateActionWithAdditionalArgs ¶ added in v0.9.1
func (m *TemplateMod) ExecuteTemplateActionWithAdditionalArgs(t *TemplateAction, moreJsonArgs []byte, jrw *ResponseCollector)
func (*TemplateMod) ExecuteTemplateWithAdditionalArgs ¶
func (m *TemplateMod) ExecuteTemplateWithAdditionalArgs(template *Template, jsonStr []byte, jrw *ResponseCollector)
func (*TemplateMod) GetAllTemplates ¶ added in v0.9.1
func (m *TemplateMod) GetAllTemplates(includeTemp bool) map[string]*Template
func (*TemplateMod) GetArgSuggestions ¶ added in v0.9.1
func (*TemplateMod) GetFunctions ¶ added in v0.9.1
func (m *TemplateMod) GetFunctions() []string
func (*TemplateMod) GetPossibleArgs ¶ added in v0.9.1
func (m *TemplateMod) GetPossibleArgs(fn string) []string
func (*TemplateMod) GetTemplate ¶ added in v0.9.1
func (m *TemplateMod) GetTemplate(templateName string) (*Template, bool)
func (*TemplateMod) GetTemporaryTemplateAction ¶ added in v0.9.1
func (m *TemplateMod) GetTemporaryTemplateAction(ID string) *TemplateAction
func (*TemplateMod) RemoveTemporaryTemplate ¶ added in v0.9.1
func (m *TemplateMod) RemoveTemporaryTemplate(ID string)
func (*TemplateMod) SaveTemplateAction ¶ added in v0.9.1
func (m *TemplateMod) SaveTemplateAction(templateName string, ta *TemplateAction) error
Click to show internal directories.
Click to hide internal directories.