hog

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FILE = ".hog.yml"

FILE name of the hog configuration file

Functions

func AddFiles

func AddFiles(files []string) (string, error)

AddFiles to the hog file and return the bucket id

func BaseDir added in v0.2.0

func BaseDir() (string, error)

BaseDir return the path of the directory that contains the hog file

func CreateEmptyHogFile

func CreateEmptyHogFile(hogPath string) error

CreateEmptyHogFile create a default hog object in the default hog path

func GetID

func GetID() string

GetID returns a random id

func Path added in v0.2.0

func Path() (string, error)

Path return the path of the hog file

func Save

func Save(hog Hog) error

Save a hog object in the default hog path

func SaveToPath

func SaveToPath(hogPath string, hog Hog) error

SaveToPath saves a hog object in a specific path

func Url added in v0.3.0

func Url(hog Hog, id string) string

Url from a hog object

Types

type Hog

type Hog struct {
	Domain   string              `yaml:"domain"`
	Protocol string              `yaml:"protocol"`
	Port     int                 `yaml:"port"`
	Buckets  map[string][]string `yaml:"buckets"`
}

Hog hold the structure of the files

func FromPath

func FromPath(hogPath string) (Hog, error)

FromPath load a hog object from an specific path

func Get

func Get() (Hog, error)

Get the hog object from the hog path

Jump to

Keyboard shortcuts

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