shorten

package
v0.0.0-...-f217533 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package shorten is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAvailable = errors.New("short url not available")

Functions

This section is empty.

Types

type MockShortener

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

MockShortener is a mock of Shortener interface.

func NewMockShortener

func NewMockShortener(ctrl *gomock.Controller) *MockShortener

NewMockShortener creates a new mock instance.

func (*MockShortener) EXPECT

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

func (*MockShortener) Shorten

func (m *MockShortener) Shorten(ctx context.Context, url *url.URL, ttl time.Duration) (*models.ShortenedURL, error)

Shorten mocks base method.

func (*MockShortener) ShortenCustom

func (m *MockShortener) ShortenCustom(ctx context.Context, url *url.URL, customString string, ttl time.Duration) (*models.ShortenedURL, error)

ShortenCustom mocks base method.

type MockShortenerMockRecorder

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

MockShortenerMockRecorder is the mock recorder for MockShortener.

func (*MockShortenerMockRecorder) Shorten

func (mr *MockShortenerMockRecorder) Shorten(ctx, url, ttl interface{}) *gomock.Call

Shorten indicates an expected call of Shorten.

func (*MockShortenerMockRecorder) ShortenCustom

func (mr *MockShortenerMockRecorder) ShortenCustom(ctx, url, customString, ttl interface{}) *gomock.Call

ShortenCustom indicates an expected call of ShortenCustom.

type Shortener

type Shortener interface {
	Shorten(ctx context.Context, url *url.URL, ttl time.Duration) (*models.ShortenedURL, error)
	ShortenCustom(ctx context.Context, url *url.URL, customString string, ttl time.Duration) (*models.ShortenedURL, error)
}

func NewShortener

func NewShortener(minLength int,
	customMinLength int,
	customMaxLength int,
	host string,
	storage storage.URLStorage) Shortener

Jump to

Keyboard shortcuts

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