vanguard

package
v0.0.0-...-dbefbc8 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAuthRoute

func AddAuthRoute(method string, pattern string, handlerFunc http.HandlerFunc)

AddAuthRoute adds an authenticated web handler to the route list this should be called by func init() within the views package

func AddNotFoundHandler

func AddNotFoundHandler(handlerFunc http.HandlerFunc)

AddNotFoundHandler provides a 404 handler

func AddRoute

func AddRoute(method string, pattern string, handlerFunc http.HandlerFunc)

AddRoute adds a non-authenticated web handler to the route list this should be called by func init() within the views package

func ServeAdsHandler

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

ServeAdsHandler deals with ads.txt

func ServeFavIconHandler

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

ServeFavIconHandler deals with favicon.ico

func SessionFromContext

func SessionFromContext(ctx context.Context) *sessions.Session

SessionFromContext returns user session data from a request.Context

Types

type Vanguard

type Vanguard struct {
	OutQueue    *redisqueue.RedisQueue
	ESI         *goesi.APIClient
	Db          *sqlx.DB
	Cache       *redis.Pool
	HTTPClient  *http.Client
	Store       *gsr.RediStore
	TokenStore  *tokenstore.TokenStore
	Conservator *rpc.Client

	TokenAuthenticator   *goesi.SSOAuthenticator
	SSOAuthenticator     *goesi.SSOAuthenticator
	Verifier             *oidc.IDTokenVerifier
	DiscordAuthenticator *discordauth.Authenticator
	// contains filtered or unexported fields
}

func GlobalsFromContext

func GlobalsFromContext(ctx context.Context) *Vanguard

GlobalsFromContext returns attached AppContext from a request.Context

func NewVanguard

func NewVanguard(redis *redis.Pool, db *sqlx.DB) *Vanguard

func (*Vanguard) Close

func (s *Vanguard) Close()

Close the service

func (*Vanguard) JWTVerify

func (s *Vanguard) JWTVerify(token string) (*goesi.VerifyResponse, error)

JWTVerify validates jwt tokens and returns legacy VerifyResponse response

func (*Vanguard) NewRouter

func (ctx *Vanguard) NewRouter() *mux.Router

NewRouter sets up the routes that were added.

func (*Vanguard) RPCConnect

func (s *Vanguard) RPCConnect() error

Close the service

func (*Vanguard) RPCall

func (s *Vanguard) RPCall(method string, in interface{}, out interface{}) error

RPCall calls remote procedures

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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