Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configurator ¶
type Configurator func(o *Options)
func WithDatabase ¶
func WithDatabase(db *sql.DB) Configurator
WithDatabase is a configurator that injects the given database instance into the final configuration.
func WithLogger ¶
func WithLogger(logger zerolog.Logger) Configurator
WithLogger is a configurator that injects the given Logger into the final configuration.
type Options ¶
Options is a collection of settings exposed to configure a Server at generation time.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements a http.Hander and provides all the functionality required for creating new short links.
func New ¶
func New(configurators ...Configurator) *Server
New creates a new Server instance after applying all provided configurators.
Click to show internal directories.
Click to hide internal directories.