user

package
v0.0.0-...-2d83a6a Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmpty = errors.New("empty inputs")

ErrEmpty is returned when an input string is empty.

Functions

func DecodeAddUserResponse

func DecodeAddUserResponse(_ context.Context, r *http.Response) (interface{}, error)

func DecodeAdduserRequest

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

func EncodeRequest

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

func EncodeResponse

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

func MakeAdduserEndpoint

func MakeAdduserEndpoint(svc Service) endpoint.Endpoint

Types

type AddUserRequest

type AddUserRequest struct {
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
}

type AddUserResponse

type AddUserResponse struct {
	UserId int    `json:"userId"`
	Err    string `json:"err,omitempty"`
}

type Proxymw

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

Proxymw implements StringService, forwarding Uppercase requests to the provided endpoint, and serving all other (i.e. Count) requests via the next StringService.

func (Proxymw) AddUser

func (mw Proxymw) AddUser(firstName, lastName string) (int, error)

type Service

type Service interface {
	AddUser(string, string) (int, error)
}

type ServiceMiddleware

type ServiceMiddleware func(Service) Service

ServiceMiddleware is a chainable behavior modifier for Service.

func InstrumentingMiddleware

func InstrumentingMiddleware(
	requestCount metrics.Counter,
	requestLatency metrics.Histogram,
	countResult metrics.Histogram,
) ServiceMiddleware

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) ServiceMiddleware

func ProxyingMiddleware

func ProxyingMiddleware(ctx context.Context, instances string, logger log.Logger) ServiceMiddleware

type User

type User struct{}

func (User) AddUser

func (User) AddUser(firstName, lastName string) (int, error)

Jump to

Keyboard shortcuts

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