db

package
v0.0.0-...-7fc0c55 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLite

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

func NewSQLite

func NewSQLite(url string) (*SQLite, error)

func (*SQLite) AddUrl

func (db *SQLite) AddUrl(ctx context.Context, url string, short string) (*domain.ShortenURLResponse, error)

func (*SQLite) Close

func (db *SQLite) Close()

func (*SQLite) CreateUser

func (db *SQLite) CreateUser(ctx context.Context, user, pass, key string) error

func (*SQLite) GetAPIKey

func (db *SQLite) GetAPIKey(ctx context.Context, name, hashedPass string) (string, error)

func (*SQLite) GetHashedPassword

func (db *SQLite) GetHashedPassword(ctx context.Context, name string) (string, error)

func (*SQLite) GetLongUrl

func (db *SQLite) GetLongUrl(ctx context.Context, url string) (*domain.ShortURLResponse, error)

func (*SQLite) ValidateAPIKey

func (db *SQLite) ValidateAPIKey(ctx context.Context, key string) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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