Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct { CreateShortURLFunc func(ctx context.Context, longURL string) (string, error) RedirectToLongURLFunc func(ctx context.Context, shortURL string) (string, error) GetStatsFunc func(ctx context.Context, shortURL string) (int, error) }
func (*Mock) CreateShortURL ¶
type Service ¶
type Service interface { CreateShortURL(ctx context.Context, longURL string) (string, error) RedirectToLongURL(ctx context.Context, shortURL string) (string, error) GetStats(ctx context.Context, shortURL string) (int, error) }
Service is an interface that defines the methods that a service should implement.
type ServiceDefault ¶
type ServiceDefault struct {
// contains filtered or unexported fields
}
func NewServiceDefault ¶
func NewServiceDefault(logger *zap.Logger, appHost string, repo repository.Repository) *ServiceDefault
func (*ServiceDefault) CreateShortURL ¶
func (*ServiceDefault) RedirectToLongURL ¶
Click to show internal directories.
Click to hide internal directories.