database

package
v0.0.0-...-f127584 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sqlx.DB

Functions

func CreateTables

func CreateTables()

func InitDB

func InitDB()

Types

type BaseModel

type BaseModel struct {
	ID        string    `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

type SQLite3ServicesStorage

type SQLite3ServicesStorage struct{}

func (*SQLite3ServicesStorage) ExistsByName

func (storage *SQLite3ServicesStorage) ExistsByName(ctx context.Context, name string) (bool, error)

func (*SQLite3ServicesStorage) FindAll

func (*SQLite3ServicesStorage) Insert

func (storage *SQLite3ServicesStorage) Insert(ctx context.Context, service entities.Service) error

type ServiceModel

type ServiceModel struct {
	BaseModel
	Name        string
	Description *string
}

func NewFromService

func NewFromService(service entities.Service) *ServiceModel

func (*ServiceModel) ToEntity

func (m *ServiceModel) ToEntity() (entities.Service, error)

Jump to

Keyboard shortcuts

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