processd

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

View Source
var (
	DefaultProcessRoutes = map[string]skind.SkinProcessor{
		"Avatar":                 mcskin.HandlerHead,
		"Helm":                   mcskin.HandlerHelm,
		"Cube":                   mcskin.HandlerCube,
		"CubeHelm":               mcskin.HandlerCubeHelm,
		"Bust":                   mcskin.HandlerBust,
		"Body":                   mcskin.HandlerBody,
		"Armor/Bust|Armour/Bust": mcskin.HandlerArmorBust,
		"Armor/Body|Armour/Body": mcskin.HandlerArmorBody,
	}

	UUIDRegex = regexp.MustCompile(minecraft.ValidUUIDPlainRegex)
)

Functions

func RegisterProcessingRoutes

func RegisterProcessingRoutes(m *mux.Router, skinWrapper skind.SkinWrapper, processRoutes map[string]skind.SkinProcessor)

Types

type Config

type Config struct {
	Server          server.Config `yaml:"server,omitempty"`
	UpstreamTimeout time.Duration `yaml:"upstream_timeout"`
	SkindURL        string        `yaml:"skind_url,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 Processd

type Processd struct {
	Cfg Config

	Server        *server.Server
	Client        *http.Client
	UserAgent     string
	SkindURL      string
	ProcessRoutes map[string]skind.SkinProcessor
}

func New

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

func (*Processd) Run

func (p *Processd) Run() error

func (*Processd) SkinLookupWrapper

func (p *Processd) SkinLookupWrapper(processFunc skind.SkinProcessor) http.HandlerFunc

Directories

Path Synopsis
The problem that is sovled by using the handlers is that you can pass in the minecraft.Skin and it does the rest - vs.
The problem that is sovled by using the handlers is that you can pass in the minecraft.Skin and it does the rest - vs.

Jump to

Keyboard shortcuts

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