server

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MastodonClient      *mastodon.Client
	AllowedOrigins      []string
	AllowedRootAccounts []string
}

type Configurator

type Configurator func(*Config)

func WithAllowedOrigins

func WithAllowedOrigins(origins []string) Configurator

func WithAllowedRootAccounts

func WithAllowedRootAccounts(accounts []string) Configurator

func WithMastodonClient

func WithMastodonClient(mc *mastodon.Client) Configurator

type Server

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

func New

func New(ctx context.Context, configurators ...Configurator) *Server

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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