settings

package
v0.0.0-...-26c31b8 Latest Latest
Warning

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

Go to latest
Published: May 11, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToUpperCaseFirst

func ToUpperCaseFirst(language string) string

ToUpperCaseFirst takes a string and Uppercases the first Letter

Types

type User

type User struct {
	Language string
}

User holds the settings for the user of Rosetta

func (*User) DeleteSettings

func (u *User) DeleteSettings()

DeleteSettings removes the settings.gob file @ERROR error: prints the error and returns

func (*User) ReadSettings

func (u *User) ReadSettings() User

ReadSettings reads the 'settings.gob' file from disk Decoding with encoding/gob from the std lib Decodes the bytes back to an User struct @RETURNS user: The User struct with user settings

func (*User) WriteSettings

func (u *User) WriteSettings()

WriteSettings write's the user object to Disk Writesettings create's a settings.gob when it is not there The method uses the encoding/gob from the std lib encode the User struct The user struct is then written and persisted to disk @ERROR error: exits the program when writing of the settings is not possible

Jump to

Keyboard shortcuts

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