model

package
v0.0.0-...-9004257 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InvalidInput indicates an inputs is not valid
	InvalidInput = 1
	// InvalidLogin indicates an incorrect login
	InvalidLogin = 10
)

Variables

This section is empty.

Functions

func DelSink

func DelSink(id int) error

func UserMutationField

func UserMutationField() *graphql.Field

UserMutationField for mutating users

func UserQueryField

func UserQueryField() *graphql.Field

UserQueryField for querying users

Types

type Resource

type Resource struct {
	ID        int64     `json:"id" db:"id"`
	OwnerID   int64     `db:"owner_id"`
	SinkID    int64     `db:"sink_id"`
	Name      string    `json:"name" db:"name"`
	Path      string    `json:"path" db:"path"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

Resource model

type Sink

type Sink struct {
	ID          int            `json:"id" db:"id"`
	SinkType    int8           `json:"type" db:"sink_type"`
	CreatedAt   time.Time      `db:"created_at"`
	UpdatedAt   time.Time      `db:"updated_at"`
	Name        pgtype.Varchar `json:"name" db:"name"`
	Description pgtype.Varchar `json:"description" db:"description"`
}

Sink model

func GetSinks

func GetSinks() ([]Sink, error)

GetSinks returns all the sinks in the database

func (*Sink) AddSink

func (s *Sink) AddSink() error

type User

type User struct {
	ID         int64     `json:"id" db:"id"`
	Name       string    `json:"name" db:"name"`
	Email      string    `json:"email" db:"email"`
	Password   string    `db:"password"`
	IsEnabled  bool      `json:"enabled" db:"is_enabled"`
	IsAdmin    bool      `json:"admin" db:"is_admin"`
	CreatedAt  time.Time `json:"created_at" db:"created_at"`
	UpdatedAt  time.Time `json:"updated_at" db:"updated_at"`
	LoginAt    time.Time `json:"login_at" db:"login_at"`
	VerifyAt   time.Time `json:"verify_at" db:"verify_at"`
	DisabledAt time.Time `json:"disabled_at" db:"disabled_at"`
}

User struct

func (*User) CreateAdmin

func (u *User) CreateAdmin() error

CreateAdmin creates a new admin user

Jump to

Keyboard shortcuts

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