storage

package module
v0.0.0-...-d08c1d5 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TOKEN       = ""
	XDT         = "XDT"
	S3          = "S3"
	ELASTICACHE = "ELASTICACHE"
)

Variables

View Source
var (
	AKID          string
	SECRET_KEY    string
	AWS_S3_REGION string
)

Functions

func Get

func Get(key string) []byte

Get retrieves a payload corresponding to the provided key from the storage service. An error will occur if the key is not prescent on the service.

func InitStorage

func InitStorage(service string, bucket string)

InitStorage initialises the storage modue. This function is used to provide information about which service to use. If s3 is used, "bucket" is the bucket used for storage, and in the case when elasticache is used "bucket" should be the redis URL and port. Note that one must be on an AWS VPC (e.g. using EC2) to access elasticache.

func Put

func Put(key string, payloadData []byte) string

Put uploads the payload to the storage service using the provided key

func PutFile

func PutFile(key string, file *os.File) string

Put uploads the payload to the storage service using the provided key

Types

This section is empty.

Jump to

Keyboard shortcuts

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