utils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SECONDS int64 = 1
	MINUTES int64 = 60
	HOURS         = MINUTES * 60
	DAYS          = HOURS * 24
	WEEKS         = DAYS * 7
	MONTHS        = WEEKS * 4
	YEARS         = MONTHS * 12
)

Functions

func Log added in v0.0.2

func Log(args ...interface{})

func Logf added in v0.0.2

func Logf(format string, args ...interface{})

func TimeAgo

func TimeAgo(past, present int64) string

Expects unix timestamp as parameter values

func TruncateString

func TruncateString(s string, length int) string

Truncate strings

Types

type AppConf

type AppConf struct {
	Name          string   `json:"name"`         // Name of application
	Type          string   `json:"type"`         // "server" or "static"
	Listeners     []string `json:"listeners"`    // Required if "Renderer" is "server"
	RootDirectory string   `json:"root"`         // Path to root directory. Required for "static" rendering
	Tunnelled     bool     `json:"is_tunnelled"` // Share service to the internet
	Server        string   `json:"server"`       // Leave empty. If tunnelled, the domain name will be automatically added
}

func ValidateConf

func ValidateConf(conf AppConf) (AppConf, error)

Validate and fix errors in configuration

Jump to

Keyboard shortcuts

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