handlers

package
v0.0.0-...-9192568 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(repoURL string) (*chi.Mux, error)

Types

type Handler

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

func (Handler) Auth

func (h Handler) Auth(next http.Handler) http.Handler

func (Handler) DeleteBinary

func (h Handler) DeleteBinary() http.HandlerFunc

func (Handler) DeleteCard

func (h Handler) DeleteCard() http.HandlerFunc

func (Handler) DeletePassword

func (h Handler) DeletePassword() http.HandlerFunc

func (Handler) DeleteText

func (h Handler) DeleteText() http.HandlerFunc

func (Handler) GetAllBinaries

func (h Handler) GetAllBinaries() http.HandlerFunc

func (Handler) GetAllCards

func (h Handler) GetAllCards() http.HandlerFunc

func (Handler) GetAllPasswords

func (h Handler) GetAllPasswords() http.HandlerFunc

func (Handler) GetAllTexts

func (h Handler) GetAllTexts() http.HandlerFunc

func (Handler) GetBinaryByID

func (h Handler) GetBinaryByID() http.HandlerFunc

func (Handler) GetCardByID

func (h Handler) GetCardByID() http.HandlerFunc

func (Handler) GetPasswordByID

func (h Handler) GetPasswordByID() http.HandlerFunc

func (Handler) GetTextByID

func (h Handler) GetTextByID() http.HandlerFunc

func (Handler) Login

func (h Handler) Login() http.HandlerFunc

func (Handler) Logout

func (h Handler) Logout() http.HandlerFunc

func (Handler) Register

func (h Handler) Register() http.HandlerFunc

func (Handler) StoreBinary

func (h Handler) StoreBinary() http.HandlerFunc

func (Handler) StoreCard

func (h Handler) StoreCard() http.HandlerFunc

func (Handler) StorePassword

func (h Handler) StorePassword() http.HandlerFunc

func (Handler) StoreText

func (h Handler) StoreText() http.HandlerFunc

type IAuthService

type IAuthService interface {
	Authorize(token string) (string, error)
	Login(ctx context.Context, cid string, user models.UserRequest) (string, string, error)
	Logout(ctx context.Context, cid string) (bool, error)
	Register(ctx context.Context, user models.UserRequest) error
}

type IBinaryService

type IBinaryService interface {
	DeleteBinary(ctx context.Context, uid, id string) error
	GetAllBinaries(ctx context.Context, uid string) ([]models.BinaryResponse, error)
	GetBinaryByID(ctx context.Context, uid, id string) (models.BinaryResponse, error)
	StoreBinary(ctx context.Context, uid string, data models.BinaryRequest) (string, error)
}

type ICardService

type ICardService interface {
	DeleteCard(ctx context.Context, uid, id string) error
	GetAllCards(ctx context.Context, uid string) ([]models.CardResponse, error)
	GetCardByID(ctx context.Context, uid, id string) (models.CardResponse, error)
	StoreCard(ctx context.Context, uid string, data models.CardRequest) (string, error)
}

type IPasswordService

type IPasswordService interface {
	DeletePassword(ctx context.Context, uid, id string) error
	GetAllPasswords(ctx context.Context, uid string) ([]models.PasswordResponse, error)
	GetPasswordByID(ctx context.Context, uid, id string) (models.PasswordResponse, error)
	StorePassword(ctx context.Context, uid string, data models.PasswordRequest) (string, error)
}

type ITextService

type ITextService interface {
	DeleteText(ctx context.Context, uid, id string) error
	GetAllTexts(ctx context.Context, uid string) ([]models.TextResponse, error)
	GetTextByID(ctx context.Context, uid, id string) (models.TextResponse, error)
	StoreText(ctx context.Context, uid string, data models.TextRequest) (string, error)
}

type UserID

type UserID string

Jump to

Keyboard shortcuts

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