save

package
v0.0.0-...-a30bc99 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package save implements a system for saving files to various targets

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PNG

func PNG(directory string, fileName string, img image.Image) (string, error)

PNG saves a PNG image to permanent storage. It relies on an environment variable WORLD_SAVE_TARGET to determine behavior. The default behavior is to save to the local filesystem. Set WORLD_SAVE_DIRECTORY to the directory to use as the root directory for saving files. Set WORLD_WEB_DOMAIN to the domain name (without protocol) the API serves on.

func PNGToDO

func PNGToDO(filePath string, img image.Image) (string, error)

PNGToDO saves a PNG image to the given space

func SVGToDO

func SVGToDO(filePath string, contents string) (string, error)

SVGToDO saves an SVG image to the given space

func ToDOSpaces

func ToDOSpaces(filePath string, reader io.Reader, contentType string) (string, error)

ToDOSpaces saves a file to Digital Ocean spaces with the given MIME type

Types

This section is empty.

Jump to

Keyboard shortcuts

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