utils

package
v0.0.0-...-0c63922 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoPlaygroundClient

type GoPlaygroundClient struct {
	Host    string
	DebugOn bool
}

func (*GoPlaygroundClient) CleanUpTempFile

func (c *GoPlaygroundClient) CleanUpTempFile(f *os.File)

func (*GoPlaygroundClient) Compile

func (c *GoPlaygroundClient) Compile(code string) (*GoPlaygroundResult, error)

func (*GoPlaygroundClient) Format

func (c *GoPlaygroundClient) Format(input string) (string, error)

func (*GoPlaygroundClient) Printf

func (c *GoPlaygroundClient) Printf(format string, v ...interface{})

type GoPlaygroundResult

type GoPlaygroundResult struct {
	CompileErrors string `json:"compile_errors"`
	Output        string `json:"output"`
}

func (*GoPlaygroundResult) GetOutput

func (r *GoPlaygroundResult) GetOutput() string

type MessageContext

type MessageContext struct {
	*slack.Client
	MsgChannel   string
	MsgTimestamp string
	MsgUser      string
	MsgText      string
	MsgEdited    bool
	ReplyToID    string
	Host         string
	BotName      string
	DebugOn      bool
}

func NewMessageContext

func NewMessageContext(client *slack.Client, event *slack.MessageEvent, config *config.SlackoConfig) *MessageContext

func (*MessageContext) ExtractCode

func (mc *MessageContext) ExtractCode(botID string) string

func (*MessageContext) ExtractReplyToID

func (mc *MessageContext) ExtractReplyToID() string

func (*MessageContext) GetInfo

func (mc *MessageContext) GetInfo() (string, error)

func (*MessageContext) IsBot

func (mc *MessageContext) IsBot() (bool, error)

func (*MessageContext) Printf

func (mc *MessageContext) Printf(format string, v ...interface{})

Jump to

Keyboard shortcuts

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