handler

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 22 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserScopes = []string{"identity.basic"}
	//"incoming-webhook"
	TeamScopes = []string{"chat:write", "users.profile:read", "users:read"}
)

Functions

func AuthorizationMiddleware

func AuthorizationMiddleware(next http.Handler) http.Handler

func GetTokenFromCookie

func GetTokenFromCookie(r *http.Request, ctx context.Context) (*jwt.Token, error)

func GetTokenFromRequest

func GetTokenFromRequest(r *http.Request, ctx context.Context) (*jwt.Token, error)

func GithubCallback

func GithubCallback(w http.ResponseWriter, r *http.Request)

func Webhook

func Webhook(w http.ResponseWriter, r *http.Request)

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func (*App) CreateUser

func (a *App) CreateUser(w http.ResponseWriter, r *http.Request) error

func (*App) Handler

func (a *App) Handler() chi.Router

func (*App) InstallationCallback

func (a *App) InstallationCallback(w http.ResponseWriter, r *http.Request) error

func (*App) ListSlackAPIUser

func (a *App) ListSlackAPIUser(w http.ResponseWriter, r *http.Request) error

func (*App) ListUser

func (a *App) ListUser(w http.ResponseWriter, r *http.Request) error

func (*App) UpdateUser

func (a *App) UpdateUser(w http.ResponseWriter, r *http.Request) error

type ContextKey

type ContextKey string

ContextKey represents a context key

const (
	// UserIDKey is the key for the user id of the authenticated user
	UserIDKey ContextKey = "userID"
	ReqIDKey  ContextKey = "reqID"
)

type InstallationResponse

type InstallationResponse struct {
	// contains filtered or unexported fields
}

type Server

type Server interface {
	Handler() chi.Router
}

Server interface

func NewApp

func NewApp(
	config config.Config,
	ghSvc ghSvc.Github,
	userRepo repository.UserRepository,
	teamRepo repository.TeamRepository,
	repoRepo repository.RepoRepository,
	taskRepo repository.TaskRepository,
	installationRepo repository.InstallationRepository,
	ghAppSvc ghSvc.Github,
) Server

type User

type User struct {
	ID     string
	TeamID string
}

Jump to

Keyboard shortcuts

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