web

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Webapp

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

func (*Webapp) AuthenticatedUser

func (webapp *Webapp) AuthenticatedUser(req *http.Request) (*slack.User, error)

func (*Webapp) GetSession

func (webapp *Webapp) GetSession(r *http.Request) *sessions.Session

func (*Webapp) InitWebServer

func (webapp *Webapp) InitWebServer(bot *bawt.Bot, enabledPlugins []string)

func (*Webapp) PrivateRouter

func (webapp *Webapp) PrivateRouter() *mux.Router

func (*Webapp) PublicRouter

func (webapp *Webapp) PublicRouter() *mux.Router

func (*Webapp) RunServer

func (webapp *Webapp) RunServer()

func (*Webapp) SetAuthMiddleware

func (webapp *Webapp) SetAuthMiddleware(middleware func(http.Handler) http.Handler)

SetAuthMiddleware should be called once by a WebServerAuth plugin, if any.

func (*Webapp) SetAuthenticatedUserFunc

func (webapp *Webapp) SetAuthenticatedUserFunc(f func(req *http.Request) (*slack.User, error))

SetAuthenticatedUserFunc should be called once by a WebServerAuth plugin, if any.

type WebappConfig

type WebappConfig struct {
	Listen            string `json:"listen" mapstructure:"listen"`
	SessionAuthKey    string `json:"session_auth_key" mapstructure:"session_auth_key"`
	SessionEncryptKey string `json:"session_encrypt_key" mapstructure:"session_encrypt_key"`
}

Jump to

Keyboard shortcuts

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