mysql

package
v0.0.0-...-18e4d4a Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserExistsError   = fmt.Errorf("user already exists")
	UserNotAddedError = fmt.Errorf("user was not added")
)

Functions

This section is empty.

Types

type Conn

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

func NewInstance

func NewInstance(dbuser, dbpass, dbhost string, dbport uint16, logger *log.Entry) (*Conn, error)

func (*Conn) AddAddress

func (db *Conn) AddAddress(ctx context.Context, addr *sharedv1.Address, cid sharedv1.CID) (string, error)

func (*Conn) AddContact

func (db *Conn) AddContact(ctx context.Context, c *sharedv1.Contact, cid sharedv1.CID) (string, error)

func (*Conn) AddUser

func (db *Conn) AddUser(ctx context.Context, u *sharedv1.User, cid sharedv1.CID) (string, error)

func (*Conn) BasicAuth

func (db *Conn) BasicAuth(ctx context.Context, login *sharedv1.BasicAuth, cid sharedv1.CID) (*sharedv1.User, error)

func (*Conn) CreateContact

func (db *Conn) CreateContact(ctx context.Context, id string, c *sharedv1.Contact, cid sharedv1.CID) (string, error)

func (*Conn) DeleteAddress

func (db *Conn) DeleteAddress(ctx context.Context, id string, cid sharedv1.CID) error

func (*Conn) DeleteContact

func (db *Conn) DeleteContact(ctx context.Context, id string, cid sharedv1.CID) error

func (*Conn) DeleteUser

func (db *Conn) DeleteUser(ctx context.Context, id string, cid sharedv1.CID) error

func (*Conn) GetAddress

func (db *Conn) GetAddress(ctx context.Context, id string, cid sharedv1.CID) (*sharedv1.Address, error)

func (*Conn) GetContact

func (db *Conn) GetContact(ctx context.Context, userID string, cid sharedv1.CID) (*sharedv1.Contact, error)

func (*Conn) GetUser

func (db *Conn) GetUser(ctx context.Context, id string, cid sharedv1.CID) (*sharedv1.User, error)

func (*Conn) UpdateAddress

func (db *Conn) UpdateAddress(ctx context.Context, addr *sharedv1.Address, cid sharedv1.CID) error

func (*Conn) UpdateContact

func (db *Conn) UpdateContact(ctx context.Context, c *sharedv1.Contact, cid sharedv1.CID) error

func (*Conn) UpdateUser

func (db *Conn) UpdateUser(ctx context.Context, u *sharedv1.User, cid sharedv1.CID) error

Jump to

Keyboard shortcuts

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