Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func PresignArchiveResource ¶
func PresignArchiveResource(request *ArchiveResourceRequest) string
Downloads an item from an S3 Bucket
func RandString ¶
RandString generates a n-char short code for the archived link This is a pretty simple implementation and I (@batuhan) am sure there are a handful of better ways to handle this. Source: https://stackoverflow.com/a/22892986
func ValidateUrl ¶
Types ¶
type ArchiveResourceRequest ¶
type ArchiveResponsePayload ¶
type ArchiveResponsePayload struct {
Title string `json:"title"`
Description string `json:"description"`
Image string `json:"image"`
}
func RunArchiveLambda ¶
func RunArchiveLambda(archiveId uuid.UUID, requestUrl string) (*ArchiveResponsePayload, error)
type Config ¶
type Config struct {
// Env. to run in, this changed how static files are handled etc.
Env string
// Server address to bind
ServerAddr string
// Base URL to add when generating URL's (for example for redirection after archiving)
BaseUrl string
// Which dialect to pass to GORM (defaults to "mysql")
DbDialect string
// Database connection URI (defaults to "link:root@/teyitlink", see README)
DbUri string
// AWS S3 bucket the archive files are stored in (defaults to "teyitlink")
BucketName string
// Which Lambda to use for archive worker
WorkerLambdaName string
// Which AWS region to use
AwsRegion string
// the duration for which the server gracefully wait for existing connections to finish - e.g. 15s or 1m
GracefulShutdown time.Duration
// limit for how many results will be shown on search page
SearchLimit int
}
Config for the application
var Conf *Config
func InitConfig ¶
func InitConfig() *Config
type NullableTime ¶
func (NullableTime) MarshalJSON ¶
func (t NullableTime) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.