backend

package
v0.0.0-...-45d8196 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DatastoreAuthorizations collection AUTHORIZATION
	DatastoreAuthorizations string = "AUTHORIZATIONS"

	// BackgroundWorkQueue is the default background job queue
	BackgroundWorkQueue string = "background-work"
	// DefaultCacheDuration default time to keep stuff in memory
	DefaultCacheDuration string = "15m"
	// SchedulerBaseURL is the prefix for all scheduller/cron tasks
	SchedulerBaseURL string = "/_i/1/scheduler"
	// JobsBaseURL is the prefix for all scheduled jobs
	JobsBaseURL string = "/_i/1/jobs"
)

Variables

This section is empty.

Functions

func AuthorizationKey

func AuthorizationKey(id string) *datastore.Key

AuthorizationKey creates a datastore key for a workspace authorization based on the team_id.

func DumpPayload

func DumpPayload(c *gin.Context)

DumpPayload just prints the entire request body to STDOUT

func GetAuthToken

func GetAuthToken(ctx context.Context, id string) (string, error)

GetAuthToken returns the oauth token of the workspace integration

func UpdateAuthorization

func UpdateAuthorization(ctx context.Context, id, name, token, tokenType, scope, appID, botID string) error

UpdateAuthorization updates the authorization, or creates a new one.

Types

type AuthorizationDS

type AuthorizationDS struct {
	ID          string
	Name        string
	AccessToken string
	TokenType   string
	AppID       string
	BotUserID   string
	Scope       string
	// internal
	Created int64
	Updated int64
}

AuthorizationDS holds basic information about a Slack team/workspace and the OAuth given at installtion time.

func GetAuthorization

func GetAuthorization(ctx context.Context, id string) (*AuthorizationDS, error)

GetAuthorization returns the authorization granted to an app

Jump to

Keyboard shortcuts

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