domain

package
v0.0.0-...-fab7537 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect()

Needed before calling other JUGo-functions. Sets up:

(1) .env-File (creates one, if not-existant) and sets DEFAULTFILENAME for the jug.json-File

(2) the data-directory and jug.json-File in which the Jugs will be stored

func Delete

func Delete(id string)

Delete removes the Jug correlating to the given id from the json-File

func Edit

func Edit(id string, data JugData)

Edit rewrites data correlating to the given id to the json-File

Internally Edit is just Save preceeded by a Delete of the previous entry correlating to the given id

func Save

func Save(id string, data JugData)

Save writes the given data under the given id to the json-File

func Write

func Write(id string, data JugData, mode int)

Write performs the actual storing of data in json-Files

Types

type Jug

type Jug struct {
	ID      string
	Content JugData
}

func GetAll

func GetAll() []Jug

GetAll returns a list of all Jugs saved to the json-File

type JugData

type JugData interface{}

func Get

func Get(id string) JugData

Get returns the Jug correlating to the given id

Jump to

Keyboard shortcuts

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