lib

package
v0.0.0-...-da48aa0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func API

func API(storage store.Store) http.HandlerFunc

API is the handler which parses Plex webhook requests.

func AllowedHostsHandler

func AllowedHostsHandler(allowedHostnames string) func(http.Handler) http.Handler

AllowedHostsHandler is a middleware which takes a comma seperated lists of hostnames and filters requests so those without a Host header with a value in the list recieve a 403. /healthz is whitelisted.

func AuthData

func AuthData(root string) *oauth2.Config

AuthData generates the config for oauth2 for anilist.

func Authorize

func Authorize(storage store.Store) http.HandlerFunc

Authorize is a handler for users to log in and store their authorization information.

func RegisterUser

func RegisterUser(storage store.Store) http.HandlerFunc

RegisterUser is a handler for saving users.

func SelfRoot

func SelfRoot(r *http.Request) string

SelfRoot gets the root url we are serving from.

Types

type AuthorizePage

type AuthorizePage struct {
	Authorized bool
	User       bool
	URL        string
	AuthURL    string
	Token      string
}

AuthorizePage is a data struct for authorized pages.

func EmptyPageData

func EmptyPageData(r *http.Request) *AuthorizePage

EmptyPageData is a generator for a simple page data that is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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