handler

package
v0.0.0-...-5122af3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(
	srv *service.UserService,
	logger *zap.Logger,
) *Handler

func NewHandlerTest

func NewHandlerTest(
	srv UserService,
	logger *zap.Logger,
) *Handler

func (*Handler) Auth

func (h *Handler) Auth(ctx context.Context, req *connect.Request[userv1.AuthRequest],
) (*connect.Response[userv1.AuthResponse], error)

func (*Handler) LoggingInterceptor

func (h *Handler) LoggingInterceptor() connect.UnaryInterceptorFunc

func (*Handler) NewRouter

func (h *Handler) NewRouter() http.Handler

func (*Handler) SignIn

func (h *Handler) SignIn(ctx context.Context, req *connect.Request[userv1.SignInRequest],
) (*connect.Response[userv1.SignInResponse], error)

func (*Handler) SignOut

func (h *Handler) SignOut(ctx context.Context, req *connect.Request[userv1.SignOutRequest],
) (*connect.Response[userv1.SignOutResponse], error)

func (*Handler) SignUp

func (h *Handler) SignUp(ctx context.Context, req *connect.Request[userv1.SignUpRequest],
) (*connect.Response[userv1.SignUpResponse], error)

func (*Handler) ValidateInterceptor

func (h *Handler) ValidateInterceptor() connect.UnaryInterceptorFunc

type Option

type Option func(srv *http.Server)

func WithAddrOption

func WithAddrOption(addr string) Option

func WithTimeOutOption

func WithTimeOutOption(t time.Duration) Option

type Serv

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

func NewServer

func NewServer(handler http.Handler, opts ...Option) *Serv

func (*Serv) Run

func (s *Serv) Run() error

func (*Serv) Shutdown

func (s *Serv) Shutdown(ctx context.Context) error

type SessionService

type SessionService interface {
	GenerateSessionID(ctx context.Context, login, password string) (*session.ID, error)
	CheckSessionID(ctx context.Context, id *session.ID) (*session.Session, error)
	DeleteSessionID(ctx context.Context, id *session.ID) error
}

type UserService

type UserService interface {
	SessionService
	CreateAccount(ctx context.Context, user *service.User) (*service.Account, error)
}

type Validate

type Validate interface {
	Validate() error
}

Directories

Path Synopsis
Package mock_handler is a generated GoMock package.
Package mock_handler is a generated GoMock package.

Jump to

Keyboard shortcuts

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