package
0.0.0-20240831224326-ce5417ef2c07
Repository: https://github.com/mineatar-io/api-server.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

BackBodyHandler is the API handler used for the `/body/back/:uuid` route.
Clamp clamps the input value between the minimum and maximum values.
Contains returns true if the array contains the value.
DecodeTexturesValue decodes the value from a MinecraftProfile texture property.
EncodeImage encodes the image into the format specified by the query parameters.
EncodePNG encodes the image into PNG format and returns the data as a byte array.
ExtractUUID returns the UUID from the route param, allowing values such as "<uuid>.png" to be returned as "<uuid>".
FaceHandler is the API handler used for the `/face/:uuid` route.
FetchImage fetches the image by the URL and returns it as a parsed image.
FrontBodyHandler is the API handler used for the `/body/front/:uuid` route.
FullBodyHandler is the API handler used for the `/body/full/:uuid` route.
GetCachedRenderResult returns the render result from Redis cache, or nil if it does not exist or cache is disabled.
GetCachedSkin returns the raw skin of a player by UUID from the cache, also returning if the player has a slim player model.
GetInstanceID returns the INSTANCE_ID environment variable parsed as an unsigned 16-bit integer.
GetMinecraftProfile returns the textures of a Minecraft player from Mojang.
GetPlayerSkin fetches the skin of the Minecraft player by the UUID.
GetCacheKey returns the key used in the cache based on the rendering options, calculated as an SHA-256 hash.
HeadHandler is the API handler used for the `/head/:uuid` route.
LeftBodyHandler is the API handler used for the `/body/left/:uuid` route.
ParseQueryParams parses the query parameters from the request and returns a QueryParams struct, using default values from the provided configuration.
ParseUUID parses the UUID given by the route parameters, and returns a boolean if the UUID is valid.
PingHandler is the API handler used for the `/ping` route.
PointerOf returns the value of the first argument as a pointer.
Render will render the image using the specified details and return the result.
RightBodyHandler is the API handler used for the `/body/right/:uuid` route.
SetCachedRenderResult puts the render result into cache, or does nothing is cache is disabled.
No description provided by the author
SHA256 computes the SHA-256 hash of the input string.
SkinHandler is the API handler used for the `/skin/:uuid` route.

# Variables

No description provided by the author
DefaultConfig is the default configuration values used by the application.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

CacheConfig is the configuration data used to set TTL values for Redis keys.
Config is the root configuration object for the application.
DecodedTextures is the decoded object of the base64-encoded values property in a MinecraftProfile properties value.
MinecraftProfile is metadata about a Minecraft player returned from the Mojang API.
Mutex is a mutually exclusive lock held across all processes.
QueryParams is used by most all API routes as options for how the image should be rendered, or how errors should be handled.
Redis is a utility client for reading and writing values to the Redis server.
No description provided by the author
RouteConfig is the configuration data used by a single API route.
Routes is the configuration data of all API routes.