Documentation
¶
Index ¶
- Variables
- func FetchCAASTags(timeout time.Duration)
- type CAASFont
- type CAASImageFilter
- type CAASImageFit
- type CAASImagePosition
- type CAASImageType
- type CAASTags
- type CatMetadata
- type CatURL
- func (c *CatURL) AsHTML() *CatURL
- func (c *CatURL) AsJSON() *CatURL
- func (c *CatURL) Generate() (string, error)
- func (c *CatURL) WithBlur(blur int) *CatURL
- func (c *CatURL) WithBrightness(brightness int) *CatURL
- func (c *CatURL) WithCAASImageFilter(filter CAASImageFilter) *CatURL
- func (c *CatURL) WithCAASImageFit(fit CAASImageFit) *CatURL
- func (c *CatURL) WithCAASImagePosition(position CAASImagePosition) *CatURL
- func (c *CatURL) WithCAASImageType(imgType CAASImageType) *CatURL
- func (c *CatURL) WithFilterB(b int) *CatURL
- func (c *CatURL) WithFilterG(g int) *CatURL
- func (c *CatURL) WithFilterR(r int) *CatURL
- func (c *CatURL) WithFilterRGB(r, g, b int) *CatURL
- func (c *CatURL) WithFont(font CAASFont) *CatURL
- func (c *CatURL) WithFontBackground(hexColor string) *CatURL
- func (c *CatURL) WithFontColor(hexColor string) *CatURL
- func (c *CatURL) WithFontSize(size int) *CatURL
- func (c *CatURL) WithHeight(height int) *CatURL
- func (c *CatURL) WithHue(hue int) *CatURL
- func (c *CatURL) WithID(id string) *CatURL
- func (c *CatURL) WithLightness(lightness int) *CatURL
- func (c *CatURL) WithSaturation(saturation int) *CatURL
- func (c *CatURL) WithSays(txt string) *CatURL
- func (c *CatURL) WithTag(tag string) *CatURL
- func (c *CatURL) WithWidth(width int) *CatURL
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrIDAndTag = fmt.Errorf("cannot generate url with id and tag") ErrSaysNoText = fmt.Errorf("cannot generate a Says URL with no text") ErrInvalidTag = fmt.Errorf("invalid tag") ErrHTMLAndJSON = fmt.Errorf("cannot generate as both HTML and JSON") )
View Source
var AvailableTags = CAASTags{}
View Source
var CAASFonts = map[CAASFont]string{ CAASFontImpact: "Impact", CAASFontAndale: "Andale", CAASFontMono: "Mono", CAASFontArial: "Arial", CAASFontArialBlack: url.QueryEscape("Arial Black"), CAASFontComicSansMS: url.QueryEscape("Comic Sans MS"), CAASFontCourierNew: url.QueryEscape("Courier New"), CAASFontGeorgia: "Georgia", CAASFontTimesNewRoman: url.QueryEscape("Times New Roman"), CAASFontVerdana: "Verdana", CAASFontWebdings: "Webdings", }
View Source
var CAASImageFilters = map[CAASImageFilter]string{ CAASImageFilterMono: "mono", CAASImageFilterNegate: "negate", CAASImageFilterCustom: "custom", }
View Source
var CAASImageFits = map[CAASImageFit]string{ CAASImageFitCover: "cover", CAASImageFitContain: "contain", CAASImageFitFill: "fill", CAASImageFitInside: "inside", CAASImageFitOutside: "outside", }
View Source
var CAASImagePositions = map[CAASImagePosition]string{ CAASImagePositionCenter: "center", CAASImagePositionTop: "top", CAASImagePositionRightTop: url.QueryEscape("right top"), CAASImagePositionRight: "right", CAASImagePositionRightBottom: url.QueryEscape("right bottom"), CAASImagePositionBottom: "bottom", CAASImagePositionLeftBottom: url.QueryEscape("left bottom"), CAASImagePositionLeft: "left", CAASImagePositionLeftTop: url.QueryEscape("left top"), }
View Source
var CAASImageTypes = map[CAASImageType]string{ CAASImageTypeSquare: "square", CAASImageTypeMedium: "medium", CAASImageTypeSmall: "small", CAASImageTypeXSmall: "xsmall", }
Functions ¶
func FetchCAASTags ¶ added in v0.4.0
Types ¶
type CAASImageFilter ¶ added in v0.4.0
type CAASImageFilter int
const ( CAASImageFilterMono CAASImageFilter = iota CAASImageFilterNegate CAASImageFilterCustom )
type CAASImageFit ¶ added in v0.4.0
type CAASImageFit int
const ( CAASImageFitCover CAASImageFit = iota CAASImageFitContain CAASImageFitFill CAASImageFitInside CAASImageFitOutside )
type CAASImagePosition ¶ added in v0.4.0
type CAASImagePosition int
const ( CAASImagePositionCenter CAASImagePosition = iota CAASImagePositionTop CAASImagePositionRightTop CAASImagePositionRight CAASImagePositionRightBottom CAASImagePositionBottom CAASImagePositionLeftBottom CAASImagePositionLeft CAASImagePositionLeftTop )
type CAASImageType ¶ added in v0.4.0
type CAASImageType int
const ( CAASImageTypeSquare CAASImageType = iota CAASImageTypeMedium CAASImageTypeSmall CAASImageTypeXSmall )
type CatMetadata ¶
type CatMetadata struct {
ID string `json:"id"`
Tags []string `json:"tags"`
CreatedAt time.Time `json:"created_at"`
URL string `json:"url"`
MIMEType string `json:"mimetype"`
}
func RequestRandomCat ¶
func (*CatMetadata) GetCreatedAt ¶
func (cm *CatMetadata) GetCreatedAt() time.Time
func (*CatMetadata) GetID ¶
func (cm *CatMetadata) GetID() string
func (*CatMetadata) GetMIMEType ¶
func (cm *CatMetadata) GetMIMEType() string
func (*CatMetadata) GetTags ¶
func (cm *CatMetadata) GetTags() []string
func (*CatMetadata) GetURL ¶
func (cm *CatMetadata) GetURL() string
type CatURL ¶ added in v0.4.0
type CatURL struct {
// contains filtered or unexported fields
}
func (*CatURL) WithBrightness ¶ added in v0.4.0
func (*CatURL) WithCAASImageFilter ¶ added in v0.4.0
func (c *CatURL) WithCAASImageFilter(filter CAASImageFilter) *CatURL
func (*CatURL) WithCAASImageFit ¶ added in v0.4.0
func (c *CatURL) WithCAASImageFit(fit CAASImageFit) *CatURL
func (*CatURL) WithCAASImagePosition ¶ added in v0.4.0
func (c *CatURL) WithCAASImagePosition(position CAASImagePosition) *CatURL
func (*CatURL) WithCAASImageType ¶ added in v0.4.0
func (c *CatURL) WithCAASImageType(imgType CAASImageType) *CatURL
func (*CatURL) WithFilterB ¶ added in v0.4.0
func (*CatURL) WithFilterG ¶ added in v0.4.0
func (*CatURL) WithFilterR ¶ added in v0.4.0
func (*CatURL) WithFilterRGB ¶ added in v0.4.0
WithFilterRGB is a convenience function combining all 3 values
func (*CatURL) WithFontBackground ¶ added in v0.4.0
func (*CatURL) WithFontColor ¶ added in v0.4.0
func (*CatURL) WithFontSize ¶ added in v0.4.0
func (*CatURL) WithHeight ¶ added in v0.4.0
func (*CatURL) WithLightness ¶ added in v0.4.0
func (*CatURL) WithSaturation ¶ added in v0.4.0
Click to show internal directories.
Click to hide internal directories.