Documentation ¶
Index ¶
- func GenerateRandomString(alphabet string, length int) (string, error)
- func GenerateSlug() string
- type BabyStruct
- type ClientInfo
- type Connection
- func (c *Connection) AddWord(babyId int64, word string, learnedDate string) (int64, error)
- func (c *Connection) CreateBaby(name string, birth_date string) (*BabyStruct, error)
- func (c *Connection) GetBaby(slug string) (*BabyStruct, error)
- func (c *Connection) ListWords(babyId int64) ([]WordInfo, error)
- func (c *Connection) LogExec(query string, args ...any) (sql.Result, error)
- type WordInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomString ¶
GenerateRandomString returns a securely generated random string. Returns error on failure.
func GenerateSlug ¶
func GenerateSlug() string
GenerateRandomString returns a securely generated random string suitable for use as a URL slug. Calls log.Fatal on failure.
Types ¶
type BabyStruct ¶
type BabyStruct struct { Id int64 Slug string Name string BirthDate string `db:"birth_date"` // TODO do custom type http://jmoiron.net/blog/built-in-interfaces CreatedAt string `db:"created_at"` // // TODO custom type Timezone sql.NullString ClientInfoId sql.NullInt64 `db:"client_info_id"` }
type ClientInfo ¶
type Connection ¶
func NewConnection ¶
func NewConnection(filename string) *Connection
func (*Connection) CreateBaby ¶
func (c *Connection) CreateBaby(name string, birth_date string) (*BabyStruct, error)
func (*Connection) GetBaby ¶
func (c *Connection) GetBaby(slug string) (*BabyStruct, error)
Click to show internal directories.
Click to hide internal directories.