Documentation ¶
Index ¶
- Constants
- type Server
- func (s *Server) FetchIDToken(ctx context.Context, code string) (*oauth2.Token, error)
- func (s *Server) GenerateAuthCodeURL(state, nonce string) string
- func (s *Server) GetBaseURL() string
- func (s *Server) GetCache() *ristretto.Cache
- func (s *Server) GetChatRouletteConfig() config.ChatRouletteConfig
- func (s *Server) GetDB() *gorm.DB
- func (s *Server) GetHTTPClient() *http.Client
- func (s *Server) GetMux() *mux.Router
- func (s *Server) GetSession(r *http.Request) (*sessions.Session, error)
- func (s *Server) GetSlackBotUserID() string
- func (s *Server) GetSlackClient() *slack.Client
- func (s *Server) GetSlackSigningSecret() string
- func (s *Server) IsDevMode() bool
- func (s *Server) Start(ctx context.Context, ch chan error)
- func (s *Server) Stop(ctx context.Context, wg *sync.WaitGroup, stop chan os.Signal, ch chan error)
- func (s *Server) VerifyIDToken(ctx context.Context, token string) (*oidc.IDToken, error)
- type ServerOptions
Constants ¶
View Source
const ( // SessionKey is the name for the HTTP cookie containing the session SessionKey = "GOSESSION" // SlackOpenIDConnectURL is the base URL for Slack's OIDC discovery SlackOpenIDConnectURL = "https://slack.com" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the API server
func NewTestServer ¶
func NewTestServer(opts *ServerOptions) *Server
NewTestServer returns a Server suitable for use in tests
func (*Server) FetchIDToken ¶
FetchIDToken exchanges an authorization code for a OIDC token
func (*Server) GenerateAuthCodeURL ¶
GenerateAuthCodeURL generates the OIDC URL for Single Sign On with Slack
func (*Server) GetBaseURL ¶
GetBaseURL returns the base URL of the server
func (*Server) GetChatRouletteConfig ¶
func (s *Server) GetChatRouletteConfig() config.ChatRouletteConfig
GetConfig retrieves the chat roulette config
func (*Server) GetHTTPClient ¶
GetHTTPClient retrieves the http client
func (*Server) GetSession ¶
GetSession retrieves an existing or new session
func (*Server) GetSlackBotUserID ¶
GetSlackBotUserID returns the user_id of the chat roulette Slack bot
func (*Server) GetSlackClient ¶
GetSlackClient retrieves the Slack client
func (*Server) GetSlackSigningSecret ¶
GetSlackSigningSecret retrieves the Slack signing secret from the config
Click to show internal directories.
Click to hide internal directories.