Documentation ¶
Index ¶
- Constants
- func CheckError(msg string, err error)
- type MyStruct
- type Tardigrade
- func (tar *Tardigrade) AddField(key, data string, db string) bool
- func (tar *Tardigrade) CountSize(db string) int
- func (tar *Tardigrade) CreateDB(db string) (msg string, status bool)
- func (tar *Tardigrade) CreatedDBCopy(db string) (msg string, status bool)
- func (tar *Tardigrade) DeleteDB(db string) (msg string, status bool)
- func (tar *Tardigrade) EmptyDB(db string) (msg string, status bool)
- func (tar *Tardigrade) FirstField(f string, db string) string
- func (tar *Tardigrade) FirstXFields(count int, format string, db string) (string, []byte)
- func (tar *Tardigrade) GetOS() rune
- func (tar *Tardigrade) GetUpdated() (updated string)
- func (tar *Tardigrade) GetVersion() (release string)
- func (tar *Tardigrade) LastField(f string, db string) string
- func (tar *Tardigrade) LastXFields(count int, format string, db string) (string, []byte)
- func (tar *Tardigrade) ModifyField(id int, k, v string, db string) (msg string, status bool)
- func (tar *Tardigrade) MyDecode(s string) []byte
- func (tar *Tardigrade) MyDecrypt(text, Password string) (string, error)
- func (tar *Tardigrade) MyEncode(b []byte) string
- func (tar *Tardigrade) MyEncrypt(text, Password string) (string, error)
- func (tar *Tardigrade) MyIndent(v interface{}, prefix, indent string) ([]byte, error)
- func (tar *Tardigrade) MyMarshal(t interface{}) ([]byte, error)
- func (tar *Tardigrade) RemoveField(id int, db string) (string, bool)
- func (tar *Tardigrade) SelectByID(id int, f string, db string) string
- func (tar *Tardigrade) SelectSearch(search, format string, db string) (string, []byte)
- func (tar *Tardigrade) UniqueID(db string) int
Constants ¶
const Release = "0.2.5"
Updated - Sun 10 Sep 18:54:19 BST 2023
const Updated = "Sun 10 Sep 18:54:19 BST 2023"
Variables ¶
This section is empty.
Functions ¶
func CheckError ¶
CheckError function takes in a string and the error code!
Types ¶
type Tardigrade ¶
type Tardigrade struct{}
Tardigrade is the main structure
func (*Tardigrade) AddField ¶
func (tar *Tardigrade) AddField(key, data string, db string) bool
AddField take in (key, sprint) (data, string) and add to tardigrade.db
func (*Tardigrade) CountSize ¶
func (tar *Tardigrade) CountSize(db string) int
CountSize will return number of rows in the tardigrade.db
func (*Tardigrade) CreateDB ¶
func (tar *Tardigrade) CreateDB(db string) (msg string, status bool)
CreateDB - This function will create a database file if it does not exist and return true | false
func (*Tardigrade) CreatedDBCopy ¶
func (tar *Tardigrade) CreatedDBCopy(db string) (msg string, status bool)
CreatedDBCopy creates a copy of the Database and store in UserHomeDir().
func (*Tardigrade) DeleteDB ¶
func (tar *Tardigrade) DeleteDB(db string) (msg string, status bool)
DeleteDB - WARNING - this function delete the database file return true | false
func (*Tardigrade) EmptyDB ¶
func (tar *Tardigrade) EmptyDB(db string) (msg string, status bool)
EmptyDB function - WARNING - this will destroy the database and all data stored in it!
func (*Tardigrade) FirstField ¶
func (tar *Tardigrade) FirstField(f string, db string) string
FirstField returns the first entry in the database in all formats [ raw | json | id | key | value ], must specify format required Example: FirstField("json")
func (*Tardigrade) FirstXFields ¶
FirstXFields returns first X number of entries from database in byte[] format Example: (0.1.2) specify number of fields X and format [ raw | json | id | key | value ] to return FirstXFields(2)
func (*Tardigrade) GetOS ¶
func (tar *Tardigrade) GetOS() rune
func (*Tardigrade) GetUpdated ¶
func (tar *Tardigrade) GetUpdated() (updated string)
GetUpdated function returns the last updated time
func (*Tardigrade) GetVersion ¶
func (tar *Tardigrade) GetVersion() (release string)
GetVersion function returns the current release version
func (*Tardigrade) LastField ¶
func (tar *Tardigrade) LastField(f string, db string) string
LastField returns the last entry of the database in all formats [ raw | json | id | key | value ] specify format required
func (*Tardigrade) LastXFields ¶
LastXFields returns last X numbers of entries from db in byte[] format
Example: specify number of fields to return LastXFields(2)
func (*Tardigrade) ModifyField ¶
ModifyField function takes ID, Key, Value and update row = ID with new information provided
func (*Tardigrade) MyDecode ¶ added in v0.2.5
func (tar *Tardigrade) MyDecode(s string) []byte
MyDecode returns the bytes represented by the base64 string s
func (*Tardigrade) MyDecrypt ¶ added in v0.2.5
func (tar *Tardigrade) MyDecrypt(text, Password string) (string, error)
Decrypt method is to extract back the encrypted text
func (*Tardigrade) MyEncode ¶ added in v0.2.5
func (tar *Tardigrade) MyEncode(b []byte) string
MyEncode returns the base64 encoding of source
func (*Tardigrade) MyEncrypt ¶ added in v0.2.5
func (tar *Tardigrade) MyEncrypt(text, Password string) (string, error)
Encrypt method is to encrypt or hide any classified text
func (*Tardigrade) MyIndent ¶ added in v0.2.0
func (tar *Tardigrade) MyIndent(v interface{}, prefix, indent string) ([]byte, error)
MyIndent function is adapted to SetEscapeHTML to false before encoding and indenting
func (*Tardigrade) MyMarshal ¶ added in v0.2.0
func (tar *Tardigrade) MyMarshal(t interface{}) ([]byte, error)
MyMarshal function is adapted to SetEscapeHTML to false before encoding
func (*Tardigrade) RemoveField ¶
func (tar *Tardigrade) RemoveField(id int, db string) (string, bool)
RemoveField function takes an unique field id as an input and remove the matching field entry
func (*Tardigrade) SelectByID ¶
func (tar *Tardigrade) SelectByID(id int, f string, db string) string
SelectByID function returns an entry string for a specific id in all formats [ raw | json | id | key | value ]
func (*Tardigrade) SelectSearch ¶
func (tar *Tardigrade) SelectSearch(search, format string, db string) (string, []byte)
SelectSearch function takes in a single or multiple words(comma,separated) and format type, Returns the format [ raw | json | id | key | value ] and []bytes array with result search will need to match ALL words for it to be true and return result.
func (*Tardigrade) UniqueID ¶
func (tar *Tardigrade) UniqueID(db string) int
UniqueID function returns an int for the last used UniqueID to AutoIncrement in the AddField()