Documentation ¶
Index ¶
- type ShrlsService
- func (s *ShrlsService) BasicAuthHandler(next http.HandlerFunc) http.HandlerFunc
- func (s *ShrlsService) GRPCAuth(ctx context.Context) (context.Context, error)
- func (s *ShrlsService) NewClient() server.ServerState
- func (s *ShrlsService) Redirect(w http.ResponseWriter, r *http.Request)
- func (s *ShrlsService) Run() error
- func (s *ShrlsService) SetConfig(config *config.Config)
- func (s *ShrlsService) SetServer(server shrls.ServerHandler)
- func (s *ShrlsService) SetState(state shrls.ServerState)
- func (s *ShrlsService) SetStorage(storage shrls.ServerStorage)
- func (s *ShrlsService) ToQR(shrl *pb.ShortURL) ([]byte, error)
- func (s *ShrlsService) ToTextQR(shrl *pb.ShortURL) ([]byte, error)
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) BasicAuthHandler ¶
func (s *ShrlsService) BasicAuthHandler(next http.HandlerFunc) http.HandlerFunc
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)
Click to show internal directories.
Click to hide internal directories.