endpoint

package
v0.0.0-...-e06aa91 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

THIS FILE IS AUTO GENERATED BY GK-CLI DO NOT EDIT!!

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstrumentingMiddleware

func InstrumentingMiddleware(duration metrics.Histogram) endpoint.Middleware

InstrumentingMiddleware returns an endpoint middleware that records the duration of each invocation to the passed histogram. The middleware adds a single field: "success", which is "true" if no error is returned, and "false" otherwise.

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) endpoint.Middleware

LoggingMiddleware returns an endpoint middleware that logs the duration of each invocation, and the resulting error, if any.

func MakeCreateEndpoint

func MakeCreateEndpoint(s service.AccountsService) endpoint.Endpoint

func MakeDepositAccountEndpoint

func MakeDepositAccountEndpoint(s service.AccountsService) endpoint.Endpoint

func MakeDepositEndpoint

func MakeDepositEndpoint(s service.AccountsService) endpoint.Endpoint

func MakeGetAccountEndpoint

func MakeGetAccountEndpoint(s service.AccountsService) endpoint.Endpoint

func MakeWithdrawAccountEndpoint

func MakeWithdrawAccountEndpoint(s service.AccountsService) endpoint.Endpoint

func MakeWithdrawEndpoint

func MakeWithdrawEndpoint(s service.AccountsService) endpoint.Endpoint

Types

type CreateRequest

type CreateRequest struct {
	io.Account
}

type CreateResponse

type CreateResponse struct {
	T     io.Account `json:"t"`
	Error error      `json:"error"`
}

func (CreateResponse) Failed

func (r CreateResponse) Failed() error

type DepositAccountRequest

type DepositAccountRequest struct {
	io.Deposit
}

type DepositAccountResponse

type DepositAccountResponse io.Account

func (DepositAccountResponse) Failed

func (r DepositAccountResponse) Failed() error

type DepositRequest

type DepositRequest struct{}

type DepositResponse

type DepositResponse struct {
	Error error `json:"error"`
}

func (DepositResponse) Failed

func (r DepositResponse) Failed() error

type DropRequest

type DropRequest struct{}

type DropResponse

type DropResponse struct {
	Error error `json:"error"`
}

func (DropResponse) Failed

func (r DropResponse) Failed() error

type Endpoints

type Endpoints struct {
	DepositEndpoint         endpoint.Endpoint
	WithdrawEndpoint        endpoint.Endpoint
	DropEndpoint            endpoint.Endpoint
	CreateEndpoint          endpoint.Endpoint
	GetAccountEndpoint      endpoint.Endpoint
	DepositAccountEndpoint  endpoint.Endpoint
	WithdrawAccountEndpoint endpoint.Endpoint
}

Endpoints collects all of the endpoints that compose a profile service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.

func New

New returns a Endpoints struct that wraps the provided service, and wires in all of the expected endpoint middlewares

func (Endpoints) Create

func (e Endpoints) Create(ctx context.Context, account io.Account) (t io.Account, error error)

func (Endpoints) Deposit

func (e Endpoints) Deposit(ctx context.Context) (error error)

func (Endpoints) DepositAccount

func (e Endpoints) DepositAccount(ctx context.Context, deposit io.Deposit) (t io.Account, error error)

func (Endpoints) Drop

func (e Endpoints) Drop(ctx context.Context) (error error)

func (Endpoints) GetAccount

func (e Endpoints) GetAccount(ctx context.Context, uuid string) (t []io.Account, error error)

func (Endpoints) Withdraw

func (e Endpoints) Withdraw(ctx context.Context) (error error)

func (Endpoints) WithdrawAccount

func (e Endpoints) WithdrawAccount(ctx context.Context, deposit io.Deposit) (t io.Account, error error)

type Failure

type Failure interface {
	Failed() error
}

type GetAccountRequest

type GetAccountRequest struct {
	Uuid string `json:"uuid"`
}

type GetAccountResponse

type GetAccountResponse []io.Account

func (GetAccountResponse) Failed

func (r GetAccountResponse) Failed() error

type WithdrawAccountRequest

type WithdrawAccountRequest struct {
	io.Deposit
}

type WithdrawAccountResponse

type WithdrawAccountResponse struct {
	io.Account
}

func (WithdrawAccountResponse) Failed

func (r WithdrawAccountResponse) Failed() error

type WithdrawRequest

type WithdrawRequest struct{}

type WithdrawResponse

type WithdrawResponse struct {
	Error error `json:"error"`
}

func (WithdrawResponse) Failed

func (r WithdrawResponse) Failed() error

Jump to

Keyboard shortcuts

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