Documentation ¶
Index ¶
- func AppendBinding(bb []apps.Binding, b *apps.Binding) []apps.Binding
- type App
- type AppConfig
- type CallRequest
- func (creq CallRequest) AppProxyURL(paths ...string) string
- func (creq CallRequest) AppendDebugJSON(in []apps.Field) []apps.Field
- func (creq CallRequest) AsActingUser() *appclient.Client
- func (creq CallRequest) AsBot() *appclient.Client
- func (creq CallRequest) BoolValue(name string) (value, found bool)
- func (creq CallRequest) DeleteAppConfig() error
- func (creq CallRequest) GetAppConfig() (*AppConfig, error)
- func (creq CallRequest) GetUserAccess() (*UsersAccess, error)
- func (creq CallRequest) GetValue(name, defaultValue string) string
- func (creq CallRequest) Respond(message string, v interface{}) apps.CallResponse
- func (creq CallRequest) StoreAppConfig(cfg *AppConfig) error
- func (creq CallRequest) StoreUserAccess(userID string) error
- func (creq CallRequest) StringValue(name string) (string, bool)
- type Command
- type HandlerFunc
- func CallHandler(h func(CallRequest) (string, error)) HandlerFunc
- func FormHandler(h func(CallRequest) (apps.Form, error)) HandlerFunc
- func LookupHandler(h func(CallRequest) []apps.SelectOption) HandlerFunc
- func RequireAdmin(h HandlerFunc) HandlerFunc
- func RequireConnectedUsers(h HandlerFunc) HandlerFunc
- type UsersAccess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
func (*App) HandleCall ¶
func (a *App) HandleCall(p string, h HandlerFunc)
func (*App) HandleCommand ¶
type CallRequest ¶
type CallRequest struct { apps.CallRequest App App GoContext context.Context // contains filtered or unexported fields }
func (CallRequest) AppProxyURL ¶
func (creq CallRequest) AppProxyURL(paths ...string) string
func (CallRequest) AppendDebugJSON ¶
func (creq CallRequest) AppendDebugJSON(in []apps.Field) []apps.Field
func (CallRequest) AsActingUser ¶
func (creq CallRequest) AsActingUser() *appclient.Client
func (CallRequest) AsBot ¶
func (creq CallRequest) AsBot() *appclient.Client
func (CallRequest) BoolValue ¶
func (creq CallRequest) BoolValue(name string) (value, found bool)
func (CallRequest) DeleteAppConfig ¶
func (creq CallRequest) DeleteAppConfig() error
DeleteAppConfig deletes the config of the app from KV store
func (CallRequest) GetAppConfig ¶
func (creq CallRequest) GetAppConfig() (*AppConfig, error)
GetAppConfig return store the config of the app from KV store
func (CallRequest) GetUserAccess ¶
func (creq CallRequest) GetUserAccess() (*UsersAccess, error)
GetUserAccess returns the user access config from KV store
func (CallRequest) GetValue ¶
func (creq CallRequest) GetValue(name, defaultValue string) string
GetValue scans Values, then State if it is a map for a name, returns the value, or the default if not found.
func (CallRequest) Respond ¶
func (creq CallRequest) Respond(message string, v interface{}) apps.CallResponse
func (CallRequest) StoreAppConfig ¶
func (creq CallRequest) StoreAppConfig(cfg *AppConfig) error
StoreAppConfig store the config of the app in KV store
func (CallRequest) StoreUserAccess ¶
func (creq CallRequest) StoreUserAccess(userID string) error
StoreUserAccess stores the user access config in KV store
func (CallRequest) StringValue ¶
func (creq CallRequest) StringValue(name string) (string, bool)
type Command ¶
type HandlerFunc ¶
type HandlerFunc func(CallRequest) apps.CallResponse
func CallHandler ¶
func CallHandler(h func(CallRequest) (string, error)) HandlerFunc
func FormHandler ¶
func FormHandler(h func(CallRequest) (apps.Form, error)) HandlerFunc
func LookupHandler ¶
func LookupHandler(h func(CallRequest) []apps.SelectOption) HandlerFunc
func RequireAdmin ¶
func RequireAdmin(h HandlerFunc) HandlerFunc
func RequireConnectedUsers ¶
func RequireConnectedUsers(h HandlerFunc) HandlerFunc
type UsersAccess ¶
type UsersAccess struct {
UserIDS []string `json:"user_ids"`
}
UsersAccess the users can use the app
func (*UsersAccess) IsAllowed ¶
func (ua *UsersAccess) IsAllowed(userID string) bool
IsAllowed if user allowed
Click to show internal directories.
Click to hide internal directories.