Documentation ¶
Index ¶
- Variables
- type Article
- func (ctrl *Article) AddToUser(ctx context.Context, req *connect.Request[articlev1.AddToUserRequest]) (*connect.Response[articlev1.AddToUserResponse], error)
- func (ctrl *Article) Delete(ctx context.Context, req *connect.Request[articlev1.DeleteRequest]) (*connect.Response[articlev1.DeleteResponse], error)
- func (ctrl *Article) List(ctx context.Context, req *connect.Request[articlev1.ListRequest]) (*connect.Response[articlev1.ListResponse], error)
- func (ctrl *Article) ListByUser(ctx context.Context, req *connect.Request[articlev1.ListByUserRequest]) (*connect.Response[articlev1.ListByUserResponse], error)
- func (ctrl *Article) RemoveFromUser(ctx context.Context, req *connect.Request[articlev1.RemoveFromUserRequest]) (*connect.Response[articlev1.RemoveFromUserResponse], error)
- func (ctrl *Article) Share(ctx context.Context, req *connect.Request[articlev1.ShareRequest]) (*connect.Response[articlev1.ShareResponse], error)
- type Controller
- type Health
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidArgument = connect.NewError( connect.CodeInvalidArgument, errInvalidArgument, ) connect.CodeUnauthenticated, errUnauthorized, ) ErrNotFound = connect.NewError( connect.CodeNotFound, errNotFound, ) ErrInternal = connect.NewError( connect.CodeInternal, errInternal, ) )
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct {
// contains filtered or unexported fields
}
Article.
func NewArticle ¶
func NewArticle( controller *Controller, usecase usecase.CoreArticle, ) *Article
NewArticle 記事のコントローラを新規作成する関数.
func (*Article) AddToUser ¶
func (ctrl *Article) AddToUser( ctx context.Context, req *connect.Request[articlev1.AddToUserRequest], ) (*connect.Response[articlev1.AddToUserResponse], error)
func (*Article) Delete ¶
func (ctrl *Article) Delete( ctx context.Context, req *connect.Request[articlev1.DeleteRequest], ) (*connect.Response[articlev1.DeleteResponse], error)
Delete 記事を削除するコントローラメソッド.
func (*Article) List ¶
func (ctrl *Article) List( ctx context.Context, req *connect.Request[articlev1.ListRequest], ) (*connect.Response[articlev1.ListResponse], error)
List 記事を取得するコントローラメソッド.
func (*Article) ListByUser ¶
func (ctrl *Article) ListByUser( ctx context.Context, req *connect.Request[articlev1.ListByUserRequest], ) (*connect.Response[articlev1.ListByUserResponse], error)
ListByUser ユーザーが保有する記事を取得するコントローラメソッド.
func (*Article) RemoveFromUser ¶
func (ctrl *Article) RemoveFromUser( ctx context.Context, req *connect.Request[articlev1.RemoveFromUserRequest], ) (*connect.Response[articlev1.RemoveFromUserResponse], error)
func (*Article) Share ¶
func (ctrl *Article) Share( ctx context.Context, req *connect.Request[articlev1.ShareRequest], ) (*connect.Response[articlev1.ShareResponse], error)
Share 記事を共有するコントローラメソッド.
type Controller ¶
type Controller struct{}
func New ¶
func New() *Controller
func (*Controller) HandleConnectError ¶
func (ctrl *Controller) HandleConnectError(ctx context.Context, err error) error
HandleConnectError 発生したエラーを対応するconnectのcode込みのエラーに変換する.
type Health ¶
type Health struct{}
Health.
func (*Health) Check ¶
func (ctrl *Health) Check( _ context.Context, _ *connect.Request[healthv1.CheckRequest], ) (*connect.Response[healthv1.CheckResponse], error)
Check ヘルスチェックするコントローラメソッド.
type User ¶
type User struct {
// contains filtered or unexported fields
}
User.
func NewUser ¶
func NewUser( controller *Controller, usecase usecase.CoreUser, ) *User
NewUser ユーザーコントローラを新規作成する関数.
func (*User) Create ¶
func (ctrl *User) Create( ctx context.Context, _ *connect.Request[userv1.CreateRequest], ) (*connect.Response[userv1.CreateResponse], error)
func (*User) Update ¶
func (ctrl *User) Update( ctx context.Context, req *connect.Request[userv1.UpdateRequest], ) (*connect.Response[userv1.UpdateResponse], error)
Click to show internal directories.
Click to hide internal directories.