rest

package
v0.0.0-...-c8fcf73 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(log *logrus.Logger, service Service, key *rsa.PublicKey, host, version string) chi.Router

Types

type Claims

type Claims struct {
	jwt.StandardClaims
	ID string `json:"id"`
}

type JSONResponse

type JSONResponse struct {
	Data  interface{} `json:"data,omitempty"`
	Meta  *Meta       `json:"meta,omitempty"`
	Error *string     `json:"error,omitempty"`
	Code  *int        `json:"code,omitempty"`
}

type Meta

type Meta struct {
	Count int `json:"count"`
}

type Service

type Service interface {
	GetFile(ctx context.Context, noteUUID, fileName string) (f *storage.File, err error)
	GetFilesByNoteUUID(ctx context.Context, noteUUID string) ([]*storage.File, error)
	Create(ctx context.Context, noteUUID string, dto storage.CreateFileDTO) error
	Delete(ctx context.Context, noteUUID, fileName string) error
}

Jump to

Keyboard shortcuts

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