api

package
v0.0.0-...-201036b Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeLoginRequest

func DecodeLoginRequest(_ context.Context, r *http.Request) (interface{}, error)

func EncodeResponse

func EncodeResponse(_ context.Context, w http.ResponseWriter, response interface{}) error

func MakeLoginEndpoint

func MakeLoginEndpoint(api Api) endpoint.Endpoint

Types

type Api

type Api interface {
	Login(login ReqLogin) (ResLogin, error)
}

type ApiSvr

type ApiSvr struct {
	UserClient    pro.UserServer
	AccountClient pro.AccountServer
}

func (ApiSvr) Login

func (api ApiSvr) Login(login ReqLogin) (ResLogin, error)

type ReqLogin

type ReqLogin struct {
	Username string `json:"username"`
	Pwd      string `json:"pwd"`
}

type ResLogin

type ResLogin struct {
	Code    int    `json:"code"`
	Msg     string `json:"msg"`
	UID     string `json:"uid"`
	SID     string `json:"sid"`
	Balance int64  `json:"balance"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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