footballkit

package module
v0.0.0-...-17787cf Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: MIT Imports: 15 Imported by: 0

README

footballkit

Go module that will render images of football kits given an English description.

NOTE:

This module is mainly designed to support local (small) club teams and is used by our web page for showing possible strip clashes. It is not particularly accurate if attempting to render 'famous' club strips, though I have given a few examples here of our nearest approximation.

Monash University Soccer Club (pre 2018)

RenderImage("body stripes skyblue white shorts navy socks navy")

kit

Manchester United

RenderImage("body red shorts white socks black")

kit

Aston Villa

RenderImage("body claret shorts white socks light blue")

kit

Celtic

RenderImage("hoops green white shorts white socks green")

kit

Peru

RenderImage("leftsash white red shorts white socks red")

kit

Croatia

RenderImage("checks red white shorts white socks blue")

kit

Build

Install the go-bindata utility

go install github.com/go-bindata/go-bindata/...

then if any of the images (in data/) have been modified, regenerate the static image data file.

~/go/bin/go-bindata -pkg footballkit data/

Documentation

Overview

Code generated for package main by go-bindata DO NOT EDIT. (@generated) sources: data/body_cross.png data/body_half.png data/body_hoops.png data/body_leftsash.png data/body_plain.png data/body_quarters.png data/body_rightsash.png data/body_squares.png data/body_stripes.png data/body_transparent.png data/body_vee.png data/body_veestripe.png data/body_veeupper.png data/leftarm_plain.png data/rightarm_plain.png data/shorts_plain.png data/socks_plain.png data/socks_topstripe.png data/socks_topstripes.png

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RenderImage

func RenderImage(stripDescription string) *image.Image

RenderImage Given a string description of a football kit, render a rendered image of that kit

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

This section is empty.

Jump to

Keyboard shortcuts

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