dataloader

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Payload

type Payload struct {
	// contains filtered or unexported fields
}

The Payload type represents a set of data used for translation, including flags, a map of translations, and file-related information. @property {bool} verbose - A boolean flag indicating whether verbose logging should be enabled or not. @property data - The `data` property is a map of translations, where the keys are strings representing the original text and the values are strings representing the translated text. This map is shared by all instances of the translate package. @property {string} filename - The filename property is a string that represents the name of the file. @property {string} extension - The extension property represents the file extension of the payload file. @property {string} path - The "path" property is a string that represents the directory path where the file is located. @property {string} absolutepath - The `absolutepath` property represents the absolute path of a file.

func New

func New(filename, extension, path string) *Payload

The function `New` returns a new instance of the data payload package

func (*Payload) Debug

func (P *Payload) Debug()

The function Debug provide debug output for the current payload.

func (*Payload) Get

func (P *Payload) Get(property string) string

Get returns a translated string or the original string if no translation is found The Get function returns the result of the get function when given a string inpuP.

func (*Payload) GetBool

func (P *Payload) GetBool(property string) (bool, error)

The GetBool function returns a boolean value based on a given property.

func (*Payload) GetBoolofCategory

func (P *Payload) GetBoolofCategory(property string, category string) (bool, error)

The function GetBoolofCategory returns a boolean value based on the given property and category.

func (*Payload) GetFloat

func (P *Payload) GetFloat(property string) (float64, error)

The GetFloat function retrieves a float value for a given property.

func (*Payload) GetFloatofCategory

func (P *Payload) GetFloatofCategory(property string, category string) (float64, error)

The GetFloatofCategory function retrieves a float value based on a given property and category.

func (*Payload) GetInt

func (P *Payload) GetInt(property string) (int, error)

The GetInt function returns an integer value for a given property.

func (*Payload) GetIntofCategory

func (P *Payload) GetIntofCategory(property string, category string) (int, error)

The function GetIntofCategory retrieves an integer value based on a given property and category.

func (*Payload) GetList

func (P *Payload) GetList(property string) ([]string, error)

The GetList function returns a list of strings based on a given property.

func (*Payload) GetListBool

func (P *Payload) GetListBool(property string) ([]bool, error)

The function GetListBool returns a list of boolean values and an error.

func (*Payload) GetListBoolofCategory

func (P *Payload) GetListBoolofCategory(property string, category string) ([]bool, error)

The function GetListBoolofCategory returns a list of boolean values based on the given property and category.

func (*Payload) GetListFloat

func (P *Payload) GetListFloat(property string) ([]float64, error)

The function GetListFloat returns a list of float64 values and an error, based on a given property.

func (*Payload) GetListFloatofCategory

func (P *Payload) GetListFloatofCategory(property string, category string) ([]float64, error)

The function GetListFloatofCategory returns a list of float64 values based on the given property and category.

func (*Payload) GetListInt

func (P *Payload) GetListInt(property string) ([]int, error)

The function GetListInt returns a list of integers and an error based on a given property.

func (*Payload) GetListIntofCategory

func (P *Payload) GetListIntofCategory(property string, category string) ([]int, error)

The function GetListIntofCategory returns a list of integers based on the given property and category.

func (*Payload) GetListString

func (P *Payload) GetListString(property string) ([]string, error)

The function GetListString returns a list of strings based on a given property.

func (*Payload) GetListStringofCategory

func (P *Payload) GetListStringofCategory(property string, category string) ([]string, error)

The function GetListStringofCategory retrieves a list of strings based on a given property and category.

func (*Payload) GetListofCategory

func (P *Payload) GetListofCategory(property string, category string) ([]string, error)

The function GetListofCategory returns a list of strings based on the given property and category.

func (*Payload) GetLocalised

func (P *Payload) GetLocalised(property, locale string) string

func (*Payload) GetMap

func (P *Payload) GetMap(property string) (map[string]string, error)

The GetMap function returns a map of string key-value pairs and an error, based on the provided property.

func (*Payload) GetMapofCategory

func (P *Payload) GetMapofCategory(property string, category string) (map[string]string, error)

The function GetMapofCategory returns a map of strings and an error based on the given property and category.

func (*Payload) GetString

func (P *Payload) GetString(property string) (string, error)

The GetString function returns a string value for a given property.

func (*Payload) GetStringofCategory

func (P *Payload) GetStringofCategory(property string, category string) (string, error)

The GetStringofCategory function returns a string value based on the given property and category.

func (*Payload) GetValue

func (P *Payload) GetValue(property string, category string) string

GetValue returns translated string for a given property and name The GetValue function returns the value associated with a given property and name.

func (*Payload) Normal

func (P *Payload) Normal()

Normal turns off verbose logging The function "Normal" sets the verbose flag to false.

func (*Payload) ToString added in v1.2.5

func (P *Payload) ToString() string

func (*Payload) Update added in v1.2.5

func (P *Payload) Update(key string, value string) *Payload

func (*Payload) Verbose

func (P *Payload) Verbose()

Verbose turns on verbose logging The Verbose function sets the verbose mode to true.

Jump to

Keyboard shortcuts

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