database

package
v0.0.0-...-b01f0b1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package database provides a client for sqlite database operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the client for database operations.

func New

func New(db *gorm.DB, logger log.Logger) Client

New creates a new database client.

func (Client) FetchUser

func (c Client) FetchUser() User

func (Client) MigrateModels

func (c Client) MigrateModels()

MigrateModels creates all the necessary tables in the database

func (Client) UpdateOrCreateUser

func (c Client) UpdateOrCreateUser(username string, token string) error

type User

type User struct {
	gorm.Model
	Username string
	Token    string
}

Jump to

Keyboard shortcuts

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