http

package
v0.0.0-...-7c55829 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: Apache-2.0 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 ErrorDecoder

func ErrorDecoder(r *http.Response) error

func ErrorEncoder

func ErrorEncoder(_ context.Context, err error, w http.ResponseWriter)

func MakeAddEndpoint

func MakeAddEndpoint(s registry.Service) endpoint.Endpoint

MakeAddEndpoint returns an endpoint that invokes Add on the service.

func MakeAuthEndpoint

func MakeAuthEndpoint(s registry.Service) endpoint.Endpoint

MakeAuthEndpoint returns an endpoint that invokes Auth on the service.

func MakeDeleteEndpoint

func MakeDeleteEndpoint(s registry.Service) endpoint.Endpoint

MakeDeleteEndpoint returns an endpoint that invokes Delete on the service.

func MakeGetEndpoint

func MakeGetEndpoint(s registry.Service) endpoint.Endpoint

MakeGetEndpoint returns an endpoint that invokes Get on the service.

func MakeHandlers

func MakeHandlers(service registry.Service) http.Handler

func MakeListEndpoint

func MakeListEndpoint(s registry.Service) endpoint.Endpoint

MakeListEndpoint returns an endpoint that invokes List on the service.

func MakeRevokeEndpoint

func MakeRevokeEndpoint(s registry.Service) endpoint.Endpoint

MakeRevokeEndpoint returns an endpoint that invokes Revoke on the service.

func MakeUpdateEndpoint

func MakeUpdateEndpoint(s registry.Service) endpoint.Endpoint

MakeUpdateEndpoint returns an endpoint that invokes Update on the service.

Types

type AddRequest

type AddRequest struct {
	Node registry.Node `json:"node"`
}

AddRequest collects the request parameters for the Add method.

type AddResponse

type AddResponse struct {
	Node registry.Node `json:"node"`
	Err  error         `json:"err"`
}

AddResponse collects the response parameters for the Add method.

func (AddResponse) Failed

func (r AddResponse) Failed() error

Failed implements Failer.

type AuthRequest

type AuthRequest struct {
	Addr  string `json:"addr"`
	Token string `json:"token"`
}

AuthRequest collects the request parameters for the Auth method.

type AuthResponse

type AuthResponse struct {
	Allowed bool  `json:"allowed"`
	Err     error `json:"err"`
}

AuthResponse collects the response parameters for the Auth method.

func (AuthResponse) Failed

func (r AuthResponse) Failed() error

Failed implements Failer.

type DeleteRequest

type DeleteRequest struct {
	Addr string `json:"addr"`
}

DeleteRequest collects the request parameters for the Delete method.

type DeleteResponse

type DeleteResponse struct {
	Err error `json:"err"`
}

DeleteResponse collects the response parameters for the Delete method.

func (DeleteResponse) Failed

func (r DeleteResponse) Failed() error

Failed implements Failer.

type Endpoints

type Endpoints struct {
	AuthEndpoint   endpoint.Endpoint
	AddEndpoint    endpoint.Endpoint
	DeleteEndpoint endpoint.Endpoint
	GetEndpoint    endpoint.Endpoint
	UpdateEndpoint endpoint.Endpoint
	ListEndpoint   endpoint.Endpoint
	RevokeEndpoint 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) Add

func (e Endpoints) Add(ctx context.Context, node registry.Node) (r0 registry.Node, e1 error)

Add implements Service. Primarily useful in a client.

func (Endpoints) Auth

func (e Endpoints) Auth(ctx context.Context, addr string, token string) (b0 bool, e1 error)

Auth implements Service. Primarily useful in a client.

func (Endpoints) Delete

func (e Endpoints) Delete(ctx context.Context, addr string) (e0 error)

Delete implements Service. Primarily useful in a client.

func (Endpoints) Get

func (e Endpoints) Get(ctx context.Context, addr string) (r0 registry.Node, e1 error)

Get implements Service. Primarily useful in a client.

func (Endpoints) List

func (e Endpoints) List(ctx context.Context) (r0 []registry.Node, e1 error)

List implements Service. Primarily useful in a client.

func (Endpoints) Revoke

func (e Endpoints) Revoke(ctx context.Context, addr string, token string) (b0 bool, e1 error)

Revoke implements Service. Primarily useful in a client.

func (Endpoints) Update

func (e Endpoints) Update(ctx context.Context, addr string, node registry.Node) (r0 registry.Node, e1 error)

Update implements Service. Primarily useful in a client.

type Failure

type Failure interface {
	Failed() error
}

Failure is an interface that should be implemented by response types. Response encoders can check if responses are Failer, and if so they've failed, and if so encode them using a separate write path based on the error.

type GetRequest

type GetRequest struct {
	Addr string `json:"addr"`
}

GetRequest collects the request parameters for the Get method.

type GetResponse

type GetResponse struct {
	Node registry.Node `json:"node"`
	Err  error         `json:"err"`
}

GetResponse collects the response parameters for the Get method.

func (GetResponse) Failed

func (r GetResponse) Failed() error

Failed implements Failer.

type ListRequest

type ListRequest struct{}

ListRequest collects the request parameters for the List method.

type ListResponse

type ListResponse struct {
	Nodes []registry.Node `json:"nodes"`
	Err   error           `json:"err"`
}

ListResponse collects the response parameters for the List method.

func (ListResponse) Failed

func (r ListResponse) Failed() error

Failed implements Failer.

type RevokeRequest

type RevokeRequest struct {
	Addr  string `json:"addr"`
	Token string `json:"token"`
}

RevokeRequest collects the request parameters for the Revoke method.

type RevokeResponse

type RevokeResponse struct {
	Revoked bool  `json:"revoked"`
	Err     error `json:"err"`
}

RevokeResponse collects the response parameters for the Revoke method.

func (RevokeResponse) Failed

func (r RevokeResponse) Failed() error

Failed implements Failer.

type UpdateRequest

type UpdateRequest struct {
	Addr string        `json:"addr"`
	Node registry.Node `json:"node"`
}

UpdateRequest collects the request parameters for the Update method.

type UpdateResponse

type UpdateResponse struct {
	Node registry.Node `json:"node"`
	Err  error         `json:"err"`
}

UpdateResponse collects the response parameters for the Update method.

func (UpdateResponse) Failed

func (r UpdateResponse) Failed() error

Failed implements Failer.

Jump to

Keyboard shortcuts

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