client

package
v0.0.0-...-047630e Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildLoginPayload

func BuildLoginPayload(authLoginBody string) (*auth.LoginPayload, error)

BuildLoginPayload builds the payload for the Auth Login endpoint from CLI flags.

func DecodeLoginResponse

func DecodeLoginResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeLoginResponse returns a decoder for responses returned by the Auth Login endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeLogoutResponse

func DecodeLogoutResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeLogoutResponse returns a decoder for responses returned by the Auth Logout endpoint. restoreBody controls whether the response body should be restored after having been read.

func EncodeLoginRequest

func EncodeLoginRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeLoginRequest returns an encoder for requests sent to the Auth Login server.

func LoginAuthPath

func LoginAuthPath() string

LoginAuthPath returns the URL path to the Auth service Login HTTP endpoint.

func LogoutAuthPath

func LogoutAuthPath() string

LogoutAuthPath returns the URL path to the Auth service Logout HTTP endpoint.

Types

type Client

type Client struct {
	// Login Doer is the HTTP client used to make requests to the Login endpoint.
	LoginDoer goahttp.Doer

	// Logout Doer is the HTTP client used to make requests to the Logout endpoint.
	LogoutDoer goahttp.Doer

	// RestoreResponseBody controls whether the response bodies are reset after
	// decoding so they can be read again.
	RestoreResponseBody bool
	// contains filtered or unexported fields
}

Client lists the Auth service endpoint HTTP clients.

func NewClient

func NewClient(
	scheme string,
	host string,
	doer goahttp.Doer,
	enc func(*http.Request) goahttp.Encoder,
	dec func(*http.Response) goahttp.Decoder,
	restoreBody bool,
) *Client

NewClient instantiates HTTP clients for all the Auth service servers.

func (*Client) BuildLoginRequest

func (c *Client) BuildLoginRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildLoginRequest instantiates a HTTP request object with method and path set to call the "Auth" service "Login" endpoint

func (*Client) BuildLogoutRequest

func (c *Client) BuildLogoutRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildLogoutRequest instantiates a HTTP request object with method and path set to call the "Auth" service "Logout" endpoint

func (*Client) Login

func (c *Client) Login() goa.Endpoint

Login returns an endpoint that makes HTTP requests to the Auth service Login server.

func (*Client) Logout

func (c *Client) Logout() goa.Endpoint

Logout returns an endpoint that makes HTTP requests to the Auth service Logout server.

type LoginRequestBody

type LoginRequestBody struct {
	// email
	Email string `form:"email" json:"email" xml:"email"`
	// password
	Password string `form:"password" json:"password" xml:"password"`
}

LoginRequestBody is the type of the "Auth" service "Login" endpoint HTTP request body.

func NewLoginRequestBody

func NewLoginRequestBody(p *auth.LoginPayload) *LoginRequestBody

NewLoginRequestBody builds the HTTP request body from the payload of the "Login" endpoint of the "Auth" service.

Jump to

Keyboard shortcuts

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