endpoint

package
v0.0.0-...-681e4f9 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRequestType = errors.New("invalid username, password")
)

Functions

func MakeHealthCheckEndpoint

func MakeHealthCheckEndpoint(svc service.Service) endpoint.Endpoint

MakeHealthCheckEndpoint 创建健康检查Endpoint

func MakeUserEndpoint

func MakeUserEndpoint(svc service.Service) endpoint.Endpoint

make endpoint

Types

type HealthRequest

type HealthRequest struct{}

HealthRequest 健康检查请求结构

type HealthResponse

type HealthResponse struct {
	Status bool `json:"status"`
}

HealthResponse 健康检查响应结构

type UserEndpoints

type UserEndpoints struct {
	UserEndpoint        endpoint.Endpoint
	HealthCheckEndpoint endpoint.Endpoint
}

func (*UserEndpoints) Check

func (u *UserEndpoints) Check(ctx context.Context, username string, password string) (int64, error)

UserEndpoint define endpoint

func (*UserEndpoints) HealthCheck

func (ue *UserEndpoints) HealthCheck() bool

type UserRequest

type UserRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

UserRequest define request struct

type UserResponse

type UserResponse struct {
	Result bool  `json:"result"`
	UserId int64 `json:"user_id"`
	Error  error `json:"error"`
}

UserResponse define response struct

Jump to

Keyboard shortcuts

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