service

package
v0.0.0-...-14d2bb4 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShrlsService

type ShrlsService struct {
	State shrls.ServerState
	// contains filtered or unexported fields
}

func New

func New(config *config.Config) ShrlsService

This function is responsible for returning a concrete implementation of the Shrls service with a mongodb state backend. Other backends can be setup by manually configuring the ShrlsService{} type itself.

func (*ShrlsService) NewClient

func (s *ShrlsService) NewClient() server.ServerState

func (*ShrlsService) Redirect

func (s *ShrlsService) Redirect(w http.ResponseWriter, r *http.Request)

func (*ShrlsService) Run

func (s *ShrlsService) Run() error

func (*ShrlsService) SetConfig

func (s *ShrlsService) SetConfig(config *config.Config)

func (*ShrlsService) SetServer

func (s *ShrlsService) SetServer(server shrls.ServerHandler)

func (*ShrlsService) SetState

func (s *ShrlsService) SetState(state shrls.ServerState)

func (*ShrlsService) SetStorage

func (s *ShrlsService) SetStorage(storage shrls.ServerStorage)

func (*ShrlsService) ToQR

func (s *ShrlsService) ToQR(url *pb.ShortURL) ([]byte, error)

Jump to

Keyboard shortcuts

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