api

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID            string   `json:"id"`
	Email         string   `json:"email,omitempty"`
	Organizations []string `json:"organizations,omitempty"`
	Roles         []string `json:"roles,omitempty"`
	Active        bool     `json:"active"`
	Namespaces    []string `json:"namespaces"`
}

User holds the user data retrieved from the User API.

type UserAPI

type UserAPI interface {
	// FindUser performs a lookup for a user by its email and password.
	FindUser(email, password string) (*User, error)
}

UserAPI defines operations for interacting with the User service API.

func NewUserAPI

func NewUserAPI(config *config.Config, keyStore store.KeyStore) (UserAPI, error)

NewUserAPI creates a UserAPI with a given configuration and a store.KeyStore.

type UserAPIClient

type UserAPIClient struct {
	// UserServiceURL is the base URL of the user microservice. This should be the API gateway exposed URL.
	UserServiceURL string

	// KeyStore is a reference to the store.KeyStore used for loading private keys
	store.KeyStore

	// Config is the microservice configuration
	*config.Config

	// Client is a HTTP clien implementation used for access to the user microservice
	*http.Client
}

UserAPIClient holds the data for the user microservice client

func (*UserAPIClient) FindUser

func (userAPI *UserAPIClient) FindUser(email, password string) (*User, error)

FindUser looks up a user by its email and password by calling the ```find``` action of the user microservice.

Jump to

Keyboard shortcuts

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