v1

package
v0.0.0-...-b0c9753 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminHandler

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

func NewAdminHandler

func NewAdminHandler(svc *service.AdminService) *AdminHandler

func (*AdminHandler) HandleVerifySignature

func (h *AdminHandler) HandleVerifySignature(w http.ResponseWriter, r *http.Request)

type AdminService

type AdminService interface {
	VerifySignature(ctx context.Context, userID uint64, signature string) ([]domain.Answer, int64, error)
}

type ErrResponse

type ErrResponse struct {
	Err error `json:"-"` // low-level runtime error

	StatusText string `json:"status"` // user-level status message
	StatusCode int    `json:"status_code"`

	AppCode   int64  `json:"code,omitempty"`  // application-specific error code
	ErrorText string `json:"error,omitempty"` // application-level error message, for debugging
}

func ErrBadRequest

func ErrBadRequest(err error) *ErrResponse

func ErrInternalServerError

func ErrInternalServerError(err error) *ErrResponse

func ErrNotFound

func ErrNotFound(err error) *ErrResponse

type UserHandler

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

func NewUserHandler

func NewUserHandler(svc UserService) *UserHandler

func (*UserHandler) HandleSignTest

func (h *UserHandler) HandleSignTest(w http.ResponseWriter, r *http.Request)

type UserService

type UserService interface {
	SignTest(ctx context.Context, userID uint64, answers []domain.Answer) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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