server

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateEnrichedSlashResponse

func GenerateEnrichedSlashResponse(title, text, color, respType string) []byte

func GenerateIncomingWebhookRequest

func GenerateIncomingWebhookRequest(channelName, title, text, color string) ([]byte, error)

func GenerateStandardSlashResponse

func GenerateStandardSlashResponse(text string, respType string) string

func ParseCommand added in v0.0.2

func ParseCommand(inputCmd string) (rootCmd string, cmdText string, args map[string]string, err error)

ParseCommand parses a command from a string and returns the commands + the args

func SendViaIncomingHook

func SendViaIncomingHook(hook, channelName, title, text, color string) error

func WriteEnrichedResponse

func WriteEnrichedResponse(w http.ResponseWriter, title, resp, color, style string)

func WriteErrorResponse

func WriteErrorResponse(w http.ResponseWriter, err *AppError)

func WriteResponse

func WriteResponse(w http.ResponseWriter, resp string, style string)

Types

type AppError

type AppError struct {
	ErrorDescription string
	Parent           error
}

func NewError

func NewError(description string, parent error) *AppError

func (*AppError) Error

func (err *AppError) Error() string

type HookResponse

type HookResponse struct {
	Title        string
	Color        string
	ResponseType string
	Body         string
}

type Server added in v0.0.2

type Server struct {
	Config *config.Config

	DialogStore store.DialogStore
	// contains filtered or unexported fields
}

func New added in v0.0.2

func New() *Server

func (*Server) SendDialogRequest added in v0.0.2

func (s *Server) SendDialogRequest(ctx context.Context, url string, request *mmmodel.OpenDialogRequest)

func (*Server) Start added in v0.0.2

func (s *Server) Start(ctx context.Context, configPath string) error

func (*Server) Stop added in v0.0.2

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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