memo

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: LGPL-2.1 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMemoNotFound = server.NewHTTPError(http.StatusBadRequest, "MEMO_NOTFOUND", "Memo not found")
)

Custom errors

Functions

func NewHTTP

func NewHTTP(svc Service, eg *echo.Group)

NewHTTP attaches handlers to Echo routers under given group

Types

type ChangePasswordReq

type ChangePasswordReq struct {
	OldPassword        string `json:"old_password" validate:"required"`
	NewPassword        string `json:"new_password" validate:"required,min=8"`
	NewPasswordConfirm string `json:"new_password_confirm" validate:"required,eqfield=NewPassword"`
}

ChangePasswordReq contains request data to change memo password swagger:model

type CreateMemoReq

type CreateMemoReq struct {
	Content string `json:"content" validate:"required"`
}

CreateMemoReq contains request data to create new memo swagger:model

type HTTP

type HTTP struct {
	contextutil.Context
	// contains filtered or unexported fields
}

HTTP represents memo http service

type ListMemoReq

type ListMemoReq struct {
	requestutil.ListQueryRequest
}

ListMemoReq contains request data to get list of memos swagger:parameters memosList

type ListMemosResp

type ListMemosResp struct {
	Data       []*types.Memo `json:"data"`
	TotalCount int64         `json:"total_count"`
}

ListMemosResp contains list of paginated memos and total numbers after filtered swagger:model

type Memo

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

Memo represents memo application service

func New

func New(repo *repo.Service, rbacSvc rbac.Intf) *Memo

New creates new memo application service

func (*Memo) Create

func (s *Memo) Create(c contextutil.Context, data CreateMemoReq) (*types.Memo, error)

Create creates new memo

func (*Memo) Delete

func (s *Memo) Delete(c contextutil.Context, id string) error

Delete deletes memo by id

func (*Memo) List

func (s *Memo) List(c contextutil.Context, req ListMemoReq) (*ListMemosResp, error)

List returns the list of memos

func (*Memo) Read

func (s *Memo) Read(c contextutil.Context, id string) (*types.Memo, error)

Read returns single memo by id

func (*Memo) Update

func (s *Memo) Update(c contextutil.Context, id string, data UpdateMemoReq) (*types.Memo, error)

Update updates memo information

type Service

Service represents memo application interface

type UpdateMemoReq

type UpdateMemoReq struct {
	Content *string `json:"content,omitempty"`
}

UpdateMemoReq contains request data to update existing memo swagger:model

Jump to

Keyboard shortcuts

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