skind

package
v0.0.0-...-fdc8e6b Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Unlicense Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HealthcheckHandler

func HealthcheckHandler(mc *mcclient.McClient) http.HandlerFunc

func RegisterSkinRoutes

func RegisterSkinRoutes(m *mux.Router, skinWrapper SkinWrapper)

func SizecheckHandler

func SizecheckHandler(mc *mcclient.McClient) http.HandlerFunc

func SkinDownloadProcessor

func SkinDownloadProcessor(logger log.Logger, skinIO mcuser.TextureIO) http.HandlerFunc

SkinDownloadProcessor Uses the TextureIO to set the downloaded filename of the skin

func SkinPageProcessor

func SkinPageProcessor(logger log.Logger, skinIO mcuser.TextureIO) http.HandlerFunc

SkinPageProcessor simply copies the TextureIO to the ResponseWriter

Types

type Config

type Config struct {
	Server   server.Config   `yaml:"server,omitempty"`
	McClient mcclient.Config `yaml:"mcclient,omitempty"`
	Logger   log.Logger
	// Add open CORS headers to easch response
	CorsAllowAll bool
	// Return an ETag based on the texture ID
	UseETags bool
	// Return a 302 redirect for Username requests to their related UUID
	RedirectUsername bool
	CacheControlTTL  time.Duration
}

func (*Config) RegisterFlags

func (c *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags registers flag.

type SkinProcessor

type SkinProcessor func(log.Logger, mcuser.TextureIO) http.HandlerFunc

SkinProcessor *MUST* call mcuser.TextureIO.Close() before completing

type SkinWrapper

type SkinWrapper func(SkinProcessor) http.HandlerFunc

func NewSkinWrapper

func NewSkinWrapper(logger log.Logger, mc *mcclient.McClient, useEtags bool, redirectUsernames bool, cacheControlTTL time.Duration) SkinWrapper

Requires "uuid" or "username" vars

type Skind

type Skind struct {
	Cfg Config

	Server   *server.Server
	McClient *mcclient.McClient
}

func New

func New(cfg Config) (*Skind, error)

func (*Skind) Run

func (s *Skind) Run() error

Jump to

Keyboard shortcuts

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