postgres

package
v0.0.0-...-a6ef0dd Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package postgres is a generated GoMock package.

Index

Constants

View Source
const (
	SQLGetAllURLQuery = `SELECT * FROM shortener_mst_url`

	SQLGetLongURLQuery = `SELECT * from shortener_mst_url
							WHERE short_url = $1`

	SQLCreateNewEntryQuery = `` /* 147-byte string literal not displayed */

	SQLUpdateShortURLQuery = `UPDATE shortener_mst_url SET long_url = $1 
								WHERE short_url = $2`

	SQLDeleteEntryQuery = `DELETE FROM shortener_mst_url 
							WHERE short_url = $1`

	SQLIsEntryExistQuery = `SELECT EXISTS(
								SELECT FROM shortener_mst_url 
								WHERE short_url = $1)`

	SQLHasEntryExpiredQuery = `SELECT EXISTS(
								SELECT * FROM shortener_mst_url 
								WHERE expire_at < $1 and short_url = $2)`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MockShortenerDBRepo

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

MockShortenerDBRepo is a mock of ShortenerDBRepo interface

func NewMockShortenerDBRepo

func NewMockShortenerDBRepo(ctrl *gomock.Controller) *MockShortenerDBRepo

NewMockShortenerDBRepo creates a new mock instance

func (*MockShortenerDBRepo) CreateNewShortURL

func (m *MockShortenerDBRepo) CreateNewShortURL(arg0 entity.URL) error

CreateNewShortURL mocks base method

func (*MockShortenerDBRepo) DeleteURL

func (m *MockShortenerDBRepo) DeleteURL(arg0 string) error

DeleteURL mocks base method

func (*MockShortenerDBRepo) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockShortenerDBRepo) GetAllURL

func (m *MockShortenerDBRepo) GetAllURL(arg0 string) ([]entity.URL, error)

GetAllURL mocks base method

func (*MockShortenerDBRepo) GetURL

func (m *MockShortenerDBRepo) GetURL(arg0 string) (entity.URL, error)

GetURL mocks base method

func (*MockShortenerDBRepo) HasShortURLExpired

func (m *MockShortenerDBRepo) HasShortURLExpired(arg0 string) bool

HasShortURLExpired mocks base method

func (*MockShortenerDBRepo) IsShortURLExist

func (m *MockShortenerDBRepo) IsShortURLExist(arg0 string) bool

IsShortURLExist mocks base method

func (*MockShortenerDBRepo) UpdateShortURL

func (m *MockShortenerDBRepo) UpdateShortURL(arg0, arg1 string) error

UpdateShortURL mocks base method

type MockShortenerDBRepoMockRecorder

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

MockShortenerDBRepoMockRecorder is the mock recorder for MockShortenerDBRepo

func (*MockShortenerDBRepoMockRecorder) CreateNewShortURL

func (mr *MockShortenerDBRepoMockRecorder) CreateNewShortURL(arg0 interface{}) *gomock.Call

CreateNewShortURL indicates an expected call of CreateNewShortURL

func (*MockShortenerDBRepoMockRecorder) DeleteURL

func (mr *MockShortenerDBRepoMockRecorder) DeleteURL(arg0 interface{}) *gomock.Call

DeleteURL indicates an expected call of DeleteURL

func (*MockShortenerDBRepoMockRecorder) GetAllURL

func (mr *MockShortenerDBRepoMockRecorder) GetAllURL(arg0 interface{}) *gomock.Call

GetAllURL indicates an expected call of GetAllURL

func (*MockShortenerDBRepoMockRecorder) GetURL

func (mr *MockShortenerDBRepoMockRecorder) GetURL(arg0 interface{}) *gomock.Call

GetURL indicates an expected call of GetURL

func (*MockShortenerDBRepoMockRecorder) HasShortURLExpired

func (mr *MockShortenerDBRepoMockRecorder) HasShortURLExpired(arg0 interface{}) *gomock.Call

HasShortURLExpired indicates an expected call of HasShortURLExpired

func (*MockShortenerDBRepoMockRecorder) IsShortURLExist

func (mr *MockShortenerDBRepoMockRecorder) IsShortURLExist(arg0 interface{}) *gomock.Call

IsShortURLExist indicates an expected call of IsShortURLExist

func (*MockShortenerDBRepoMockRecorder) UpdateShortURL

func (mr *MockShortenerDBRepoMockRecorder) UpdateShortURL(arg0, arg1 interface{}) *gomock.Call

UpdateShortURL indicates an expected call of UpdateShortURL

type ShortenerDBRepo

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

func NewShortenerDBRepo

func NewShortenerDBRepo(db *sqlx.DB) *ShortenerDBRepo

func (*ShortenerDBRepo) CreateNewShortURL

func (r *ShortenerDBRepo) CreateNewShortURL(url entity.URL) error

func (*ShortenerDBRepo) DeleteURL

func (r *ShortenerDBRepo) DeleteURL(shortURL string) error

func (*ShortenerDBRepo) GetAllURL

func (r *ShortenerDBRepo) GetAllURL(userID string) ([]entity.URL, error)

func (*ShortenerDBRepo) GetURL

func (r *ShortenerDBRepo) GetURL(shortURL string) (entity.URL, error)

func (*ShortenerDBRepo) HasShortURLExpired

func (r *ShortenerDBRepo) HasShortURLExpired(shortURL string) bool

func (*ShortenerDBRepo) IsShortURLExist

func (r *ShortenerDBRepo) IsShortURLExist(shortURL string) bool

func (*ShortenerDBRepo) UpdateShortURL

func (r *ShortenerDBRepo) UpdateShortURL(shortURL string, longURL string) error

Jump to

Keyboard shortcuts

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