handler

package
v0.0.0-...-6f95374 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package handler is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequest

func NewRequest[T any](ctx context.Context, msg *T) *connect.Request[T]

Types

type Cookie interface {
	Domain() string
	Secure() bool
	SameSite() http.SameSite
}

type Handler

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

func New

func New(
	key string,
	secret auth.Secret,
	cookie Cookie,
	auth usecase.APIAuth,
	article usecase.APIArticle,
	health usecase.APIHealth,
) *Handler

func (*Handler) ExtractTokens

func (hdl *Handler) ExtractTokens(
	ctx context.Context,
	r *http.Request,
) (Tokens, error)

func (*Handler) ExtractUserID

func (hdl *Handler) ExtractUserID(
	ctx context.Context,
	r *http.Request,
) (user.ID, error)

func (*Handler) HandleConnectError

func (hdl *Handler) HandleConnectError(ctx context.Context, err error) int

func (*Handler) HandleErrorStatus

func (hdl *Handler) HandleErrorStatus(
	w http.ResponseWriter,
	err error,
)

func (*Handler) PointerToString

func (hdl *Handler) PointerToString(s *string) string

func (*Handler) StringToPointer

func (hdl *Handler) StringToPointer(s string) *string

func (*Handler) V1ArticleAddOwn

func (hdl *Handler) V1ArticleAddOwn(
	w http.ResponseWriter,
	r *http.Request,
	articleID types.UUID,
)

記事追加 (POST /v1/articles/{articleId}).

func (*Handler) V1ArticleList

func (hdl *Handler) V1ArticleList(
	w http.ResponseWriter,
	r *http.Request,
	params openapi.V1ArticleListParams,
)

記事一覧 (GET /v1/articles).

func (*Handler) V1ArticleRemoveOwn

func (hdl *Handler) V1ArticleRemoveOwn(
	w http.ResponseWriter,
	r *http.Request,
	articleID types.UUID,
)

記事削除 (DELETE /v1/articles/{articleId}).

func (*Handler) V1ArticleShare

func (hdl *Handler) V1ArticleShare(
	w http.ResponseWriter,
	r *http.Request,
)

記事共有 (POST /v1/articles).

func (*Handler) V1AuthChangePassword

func (hdl *Handler) V1AuthChangePassword(
	w http.ResponseWriter,
	r *http.Request,
)

パスワード変更 (PUT /v1/auth/password).

func (*Handler) V1AuthInvite

func (hdl *Handler) V1AuthInvite(w http.ResponseWriter, r *http.Request)

招待 (POST /v1/auth/invite).

func (*Handler) V1AuthJoin

func (hdl *Handler) V1AuthJoin(w http.ResponseWriter, r *http.Request)

参加 (POST /v1/auth/join).

func (*Handler) V1AuthRefresh

func (hdl *Handler) V1AuthRefresh(w http.ResponseWriter, r *http.Request, params openapi.V1AuthRefreshParams)

リフレッシュ (GET /v1/auth/refresh).

func (*Handler) V1AuthSignIn

func (hdl *Handler) V1AuthSignIn(w http.ResponseWriter, r *http.Request)

サインイン (POST /v1/auth/signin).

func (*Handler) V1AuthSignOut

func (hdl *Handler) V1AuthSignOut(_ http.ResponseWriter, r *http.Request)

サインアウト (GET /v1/auth/signout).

func (*Handler) V1AuthSignOutAll

func (hdl *Handler) V1AuthSignOutAll(_ http.ResponseWriter, req *http.Request)

サインアウトオール (GET /v1/auth/signout/all).

func (*Handler) V1AuthSignUp

func (hdl *Handler) V1AuthSignUp(w http.ResponseWriter, r *http.Request)

サインアップ (POST /v1/auth/signup).

func (*Handler) V1AuthVerify

func (hdl *Handler) V1AuthVerify(w http.ResponseWriter, r *http.Request)

検証 (GET /v1/auth/verify).

func (*Handler) V1HealthAPI

func (hdl *Handler) V1HealthAPI(w http.ResponseWriter, _ *http.Request)

apiヘルスチェック (GET /v1/health/api).

func (*Handler) V1HealthCore

func (hdl *Handler) V1HealthCore(w http.ResponseWriter, r *http.Request)

coreヘルスチェック (GET /v1/health/core).

func (*Handler) V1InternalArticleDelete

func (hdl *Handler) V1InternalArticleDelete(
	w http.ResponseWriter,
	r *http.Request,
	articleID types.UUID,
)

記事削除 (DELETE /v1/internal/articles/{articleId}).

func (*Handler) V1InternalArticleShare

func (hdl *Handler) V1InternalArticleShare(
	w http.ResponseWriter,
	r *http.Request,
)

記事共有 (POST /v1/internal/articles).

type MockCookie

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

MockCookie is a mock of Cookie interface.

func NewMockCookie

func NewMockCookie(ctrl *gomock.Controller) *MockCookie

NewMockCookie creates a new mock instance.

func (*MockCookie) Domain

func (m *MockCookie) Domain() string

Domain mocks base method.

func (*MockCookie) EXPECT

func (m *MockCookie) EXPECT() *MockCookieMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCookie) SameSite

func (m *MockCookie) SameSite() http.SameSite

SameSite mocks base method.

func (*MockCookie) Secure

func (m *MockCookie) Secure() bool

Secure mocks base method.

type MockCookieMockRecorder

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

MockCookieMockRecorder is the mock recorder for MockCookie.

func (*MockCookieMockRecorder) Domain

func (mr *MockCookieMockRecorder) Domain() *gomock.Call

Domain indicates an expected call of Domain.

func (*MockCookieMockRecorder) SameSite

func (mr *MockCookieMockRecorder) SameSite() *gomock.Call

SameSite indicates an expected call of SameSite.

func (*MockCookieMockRecorder) Secure

func (mr *MockCookieMockRecorder) Secure() *gomock.Call

Secure indicates an expected call of Secure.

type Tokens

type Tokens struct {
	SessionToken auth.SessionToken
	AuthToken    auth.AuthToken
}

Jump to

Keyboard shortcuts

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