core

package
v0.0.0-...-92ff8fd Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name    = "SentryGram"
	Version = "0.1.3"
	Author  = "Gianluca Braga aka Matrix86"
)

Variables

This section is empty.

Functions

func NewRpcHandler

func NewRpcHandler(port int, bot bot.Bot)

Types

type Configuration

type Configuration struct {
	Logs        string   `json:"logs"`
	LogsLevel   string   `json:"log_level"`
	TgmAPI      string   `json:"tgm_api"`
	PluginsPath string   `json:"plugins_path"`
	Users       []string `json:"users"`
	RpcEnabled  bool     `json:"rpc_enabled"`
	RpcPort     int      `json:"rpc_port"`
}

func LoadConfiguration

func LoadConfiguration(path string) (Configuration, error)

Read a JSON conf file and return the Configuration object

func (*Configuration) GetLogLevel

func (c *Configuration) GetLogLevel() log.Verbosity

type Handler

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

func (*Handler) SendMessage

func (h *Handler) SendMessage(req RpcRequest, res *RpcResponse) (err error)

type RpcRequest

type RpcRequest struct {
	Text     string
	UserName string
}

type RpcResponse

type RpcResponse struct {
	Message string
}

Jump to

Keyboard shortcuts

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