external

package
v0.0.0-...-785145d Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SlackAuthReturnURL

func SlackAuthReturnURL(cfg *config.Giffy) string

SlackAuthReturnURL formats an oauth return uri.

func SlackAuthURL

func SlackAuthURL(cfg *config.Giffy) string

SlackAuthURL is the url to start the OAuth 2.0 process with slack.

Types

type SlackOAuthResponse

type SlackOAuthResponse struct {
	OK    bool   `json:"ok"`
	Error string `json:"error"`

	AccessToken string `json:"access_token"`
	Scope       string `json:"scopes"`

	UserID   string `json:"user_id"`
	TeamID   string `json:"team_id"`
	TeamName string `json:"team_name"`
}

SlackOAuthResponse is the response from the second phase of slack oauth 2.0

func SlackOAuth

func SlackOAuth(code string, cfg *config.Giffy) (*SlackOAuthResponse, error)

SlackOAuth completes the oauth 2.0 process with slack.

type SlackProfile

type SlackProfile struct {
	OK     bool   `json:"ok"`
	URL    string `json:"url"`
	User   string `json:"user"`
	Team   string `json:"team"`
	UserID string `json:"user_id"`
	TeamID string `json:"team_id"`
}

SlackProfile is the response from the auth.test service.

func FetchSlackProfile

func FetchSlackProfile(accessToken string, cfg *config.Giffy) (*SlackProfile, error)

FetchSlackProfile gets the slack user details for an access token.

Jump to

Keyboard shortcuts

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