models

package
v0.0.0-...-8c158ba Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdate

func CreateOrUpdate(userID int, token string) error

CreateOrUpdate user token

func CreateSource

func CreateSource(userID int, source string) error

CreateSource for user

func DeleteSource

func DeleteSource(userID int, source string) (int64, error)

DeleteSource for user

func GetSources

func GetSources(userID int) ([]string, error)

GetSources for user

func GetToken

func GetToken(userID int) (string, error)

GetToken for user

func InitDB

func InitDB(dbSettings DbSettings) error

InitDB init database

Types

type DbSettings

type DbSettings struct {
	Port     int
	Host     string
	User     string
	Password string
	Dbname   string
}

DbSettings for Db

type User

type User struct {
	UserID int
	Token  string
}

User model

func AllUsers

func AllUsers() ([]*User, error)

AllUsers returns all records from Users table

type UserSource

type UserSource struct {
	UserID int
	Source string
}

UserSource model

Jump to

Keyboard shortcuts

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