ginrouter

package
v0.0.0-...-5bf7098 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delivery

type Delivery interface {
	Create() gin.HandlerFunc
	Redirect() gin.HandlerFunc
	GetStat() gin.HandlerFunc
	WebGenerate() gin.HandlerFunc
}

func New

func New(url usecase.UseCase, logger *zap.SugaredLogger) Delivery

type DeliveryMock

type DeliveryMock struct {
	CreateMock mDeliveryMockCreate

	GetStatMock mDeliveryMockGetStat

	RedirectMock mDeliveryMockRedirect

	WebGenerateMock mDeliveryMockWebGenerate
	// contains filtered or unexported fields
}

DeliveryMock implements Delivery

func NewDeliveryMock

func NewDeliveryMock(t minimock.Tester) *DeliveryMock

NewDeliveryMock returns a mock for Delivery

func (*DeliveryMock) Create

func (mmCreate *DeliveryMock) Create() (h1 gin.HandlerFunc)

Create implements Delivery

func (*DeliveryMock) CreateAfterCounter

func (mmCreate *DeliveryMock) CreateAfterCounter() uint64

CreateAfterCounter returns a count of finished DeliveryMock.Create invocations

func (*DeliveryMock) CreateBeforeCounter

func (mmCreate *DeliveryMock) CreateBeforeCounter() uint64

CreateBeforeCounter returns a count of DeliveryMock.Create invocations

func (*DeliveryMock) GetStat

func (mmGetStat *DeliveryMock) GetStat() (h1 gin.HandlerFunc)

GetStat implements Delivery

func (*DeliveryMock) GetStatAfterCounter

func (mmGetStat *DeliveryMock) GetStatAfterCounter() uint64

GetStatAfterCounter returns a count of finished DeliveryMock.GetStat invocations

func (*DeliveryMock) GetStatBeforeCounter

func (mmGetStat *DeliveryMock) GetStatBeforeCounter() uint64

GetStatBeforeCounter returns a count of DeliveryMock.GetStat invocations

func (*DeliveryMock) MinimockCreateDone

func (m *DeliveryMock) MinimockCreateDone() bool

MinimockCreateDone returns true if the count of the Create invocations corresponds the number of defined expectations

func (*DeliveryMock) MinimockCreateInspect

func (m *DeliveryMock) MinimockCreateInspect()

MinimockCreateInspect logs each unmet expectation

func (*DeliveryMock) MinimockFinish

func (m *DeliveryMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*DeliveryMock) MinimockGetStatDone

func (m *DeliveryMock) MinimockGetStatDone() bool

MinimockGetStatDone returns true if the count of the GetStat invocations corresponds the number of defined expectations

func (*DeliveryMock) MinimockGetStatInspect

func (m *DeliveryMock) MinimockGetStatInspect()

MinimockGetStatInspect logs each unmet expectation

func (*DeliveryMock) MinimockRedirectDone

func (m *DeliveryMock) MinimockRedirectDone() bool

MinimockRedirectDone returns true if the count of the Redirect invocations corresponds the number of defined expectations

func (*DeliveryMock) MinimockRedirectInspect

func (m *DeliveryMock) MinimockRedirectInspect()

MinimockRedirectInspect logs each unmet expectation

func (*DeliveryMock) MinimockWait

func (m *DeliveryMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*DeliveryMock) MinimockWebGenerateDone

func (m *DeliveryMock) MinimockWebGenerateDone() bool

MinimockWebGenerateDone returns true if the count of the WebGenerate invocations corresponds the number of defined expectations

func (*DeliveryMock) MinimockWebGenerateInspect

func (m *DeliveryMock) MinimockWebGenerateInspect()

MinimockWebGenerateInspect logs each unmet expectation

func (*DeliveryMock) Redirect

func (mmRedirect *DeliveryMock) Redirect() (h1 gin.HandlerFunc)

Redirect implements Delivery

func (*DeliveryMock) RedirectAfterCounter

func (mmRedirect *DeliveryMock) RedirectAfterCounter() uint64

RedirectAfterCounter returns a count of finished DeliveryMock.Redirect invocations

func (*DeliveryMock) RedirectBeforeCounter

func (mmRedirect *DeliveryMock) RedirectBeforeCounter() uint64

RedirectBeforeCounter returns a count of DeliveryMock.Redirect invocations

func (*DeliveryMock) WebGenerate

func (mmWebGenerate *DeliveryMock) WebGenerate() (h1 gin.HandlerFunc)

WebGenerate implements Delivery

func (*DeliveryMock) WebGenerateAfterCounter

func (mmWebGenerate *DeliveryMock) WebGenerateAfterCounter() uint64

WebGenerateAfterCounter returns a count of finished DeliveryMock.WebGenerate invocations

func (*DeliveryMock) WebGenerateBeforeCounter

func (mmWebGenerate *DeliveryMock) WebGenerateBeforeCounter() uint64

WebGenerateBeforeCounter returns a count of DeliveryMock.WebGenerate invocations

type DeliveryMockCreateExpectation

type DeliveryMockCreateExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

DeliveryMockCreateExpectation specifies expectation struct of the Delivery.Create

type DeliveryMockCreateResults

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

DeliveryMockCreateResults contains results of the Delivery.Create

type DeliveryMockGetStatExpectation

type DeliveryMockGetStatExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

DeliveryMockGetStatExpectation specifies expectation struct of the Delivery.GetStat

type DeliveryMockGetStatResults

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

DeliveryMockGetStatResults contains results of the Delivery.GetStat

type DeliveryMockRedirectExpectation

type DeliveryMockRedirectExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

DeliveryMockRedirectExpectation specifies expectation struct of the Delivery.Redirect

type DeliveryMockRedirectResults

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

DeliveryMockRedirectResults contains results of the Delivery.Redirect

type DeliveryMockWebGenerateExpectation

type DeliveryMockWebGenerateExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

DeliveryMockWebGenerateExpectation specifies expectation struct of the Delivery.WebGenerate

type DeliveryMockWebGenerateResults

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

DeliveryMockWebGenerateResults contains results of the Delivery.WebGenerate

type URLData

type URLData struct {
	ID       int    `json:"id" form:"id"`
	FullURL  string `json:"full_url" form:"full_url"`
	ShortURL string `json:"short_url" form:"short_url"`
	Counter  int64  `json:"counter" form:"counter"`
}

Jump to

Keyboard shortcuts

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