constants

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

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

Go to latest
Published: Jun 10, 2020 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DiscordOAuth2AuthorizeURL is the Discord OAuth 2 authorization endpoint URL.
	DiscordOAuth2AuthorizeURL = "https://discord.com/api/oauth2/authorize"

	// DiscordOAuth2TokenURL is the Discord OAuth 2 token endpoint URL.
	DiscordOAuth2TokenURL = "https://discord.com/api/oauth2/token"
)
View Source
const (

	// AttachedGuildsCollectionName is the name of the MongoDB collection
	// of Discord guilds that taalabc provides service to.
	AttachedGuildsCollectionName = "attached_guilds"

	// NounsCollectionName is the name of the MongoDB nouns collection.
	NounsCollectionName = "nouns"

	// BotOAuth2FlowSessionsCollectionName is the name of the MongoDB collection
	// for bot OAuth 2 flow sessions.
	// The sole purpose of these sessions is to maintain state during an ongoing
	// OAuth 2 authorization flow.
	BotOAuth2FlowSessionsCollectionName = "bot_oauth2_flow_sessions"

	// UserOAuth2FlowSessionsCollectionName is the name of the MongoDB collection
	// for user OAuth 2 flow sessions.
	// See BotOAuth2FlowSessionsCollectionName.
	UserOAuth2FlowSessionsCollectionName = "user_oauth2_flow_sessions"

	// UserOAuth2TokenSessionsCollectionName is the name of the MongoDB collection
	// for OAuth 2 token sessions.
	// As soon as an user OAuth 2 authorization flow completes, the flow session
	// "graduates" and becomes a token session, which holds a token payload.
	UserOAuth2TokenSessionsCollectionName = "user_oauth2_token_sessions"

	// OAuth2SessionsIDField is the name of the session ID field in OAuth 2 session documents.
	OAuth2SessionsIDField = "session_id"

	// OAuth2SessionsModificationDateField is the name of the modification date field
	// to insert into OAuth 2 session documents.
	OAuth2SessionsModificationDateField = "modified_at"
)
View Source
const (
	// OAuth2SessionCookiePath is the value for the Path attribute of the OAuth 2 session cookie.
	OAuth2SessionCookiePath = "/"

	// OAuth2SessionIDSize is the size in bytes of OAuth 2 proxy session IDs.
	OAuth2SessionIDSize = 32

	// OAuth2FlowSessionMaxAge is the amount of time, in seconds, for which OAuth 2 flow sessions are valid.
	// These sessions are short-lived on purpose, since their only purpose is to maintain state during an
	// ongoing OAuth 2 authorization flow.
	OAuth2FlowSessionMaxAge = 1800

	// OAuth2TokenSessionMaxAge is the amount of time, in seconds, for which OAuth 2 token sessions are valid.
	// Contrary to OAuth 2 flow sessions, these ones are long-lived, as they contain OAuth 2 tokens
	// which have their own expiration date and are renewable.
	// The maximum age defined here is just a convenient way to automatically delete session documents
	// that have remained untouched for long periods.
	OAuth2TokenSessionMaxAge = 86400 * 30

	// OAuth2TokenSessionCredentialsKey is the key used to store OAuth 2 credentials in a session.
	OAuth2TokenSessionCredentialsKey = "credentials"
)
View Source
const (
	// DiscordAPIClientTimeout is the default timeout for HTTP client interacting with Discord gateway.
	DiscordAPIClientTimeout = 10 * time.Second

	// FileServerTimeout is the default timeout for HTTP file server contexts.
	FileServerTimeout = 3 * time.Second

	// MongoOperationTimeout is the default timeout for MongoDB operations.
	MongoOperationTimeout = 10 * time.Second

	// OAuth2OperationTimeout is the default timeout for HTTP operations concerning OAuth 2 flows.
	OAuth2OperationTimeout = 10 * time.Second

	// RPCOperationTimeout is the default timeout for RPC invocation contexts.
	RPCOperationTimeout = 10 * time.Second
)
View Source
const (
	// CORSPreflightMaxAge is the amount of time, in seconds, between two CORS preflight requests.
	CORSPreflightMaxAge = 300
)
View Source
const (
	// CodeDuplicateKey is the code of the error returned by MongoDB
	// when an insert would result in duplicate keys.
	CodeDuplicateKey = 11000
)
View Source
const (
	// DefaultBotCommandPrefix is the default bot command prefix.
	DefaultBotCommandPrefix = "!"
)

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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