storage

package
v0.0.0-...-1ecf039 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port             string
	Dbname           string
	UsernamePassword string
	Hostname         string
}

Config contains database access configuration.

type MySQLStorage

type MySQLStorage struct {
	Config
}

MySQLStorage represents a storage implementation using MySQL.

func NewMySQLStorage

func NewMySQLStorage(cfg Config) *MySQLStorage

NewMySQLStorage creates a new Image storage.

func (*MySQLStorage) GetImage

func (m *MySQLStorage) GetImage(id int) (*models.Image, error)

GetImage returns an image.

func (*MySQLStorage) GetPersonFromImage

func (m *MySQLStorage) GetPersonFromImage(image string) (*models.Person, error)

GetPersonFromImage returns a person from an image url.

func (*MySQLStorage) UpdateImage

func (m *MySQLStorage) UpdateImage(id int, person int, status models.Status) error

UpdateImage updates an image. There is no check if the person exists or not, because that is happening in GetPersonFromImage.

Jump to

Keyboard shortcuts

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