auth

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: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "Auth"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [2]string{"Login", "Logout"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func NewLoginEndpoint

func NewLoginEndpoint(s Service) goa.Endpoint

NewLoginEndpoint returns an endpoint function that calls the method "Login" of service "Auth".

func NewLogoutEndpoint

func NewLogoutEndpoint(s Service) goa.Endpoint

NewLogoutEndpoint returns an endpoint function that calls the method "Logout" of service "Auth".

Types

type Client

type Client struct {
	LoginEndpoint  goa.Endpoint
	LogoutEndpoint goa.Endpoint
}

Client is the "Auth" service client.

func NewClient

func NewClient(login, logout goa.Endpoint) *Client

NewClient initializes a "Auth" service client given the endpoints.

func (*Client) Login

func (c *Client) Login(ctx context.Context, p *LoginPayload) (err error)

Login calls the "Login" endpoint of the "Auth" service.

func (*Client) Logout

func (c *Client) Logout(ctx context.Context) (err error)

Logout calls the "Logout" endpoint of the "Auth" service.

type Endpoints

type Endpoints struct {
	Login  goa.Endpoint
	Logout goa.Endpoint
}

Endpoints wraps the "Auth" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "Auth" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "Auth" service endpoints.

type LoginPayload

type LoginPayload struct {
	// email
	Email string
	// password
	Password string
}

LoginPayload is the payload type of the Auth service Login method.

type Service

type Service interface {
	// Login implements Login.
	Login(context.Context, *LoginPayload) (err error)
	// Logout implements Logout.
	Logout(context.Context) (err error)
}

Authentication operatinos.

Jump to

Keyboard shortcuts

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