clients

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 License: MIT Imports: 7 Imported by: 3

README

Clients

High Level Clients To All Microservices

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTClient

type JWTClient struct {
	// contains filtered or unexported fields
}

JWTClient is jwt service client

func NewJWTClient added in v0.1.0

func NewJWTClient(service micro.Service) JWTClient

NewJWTClient is used to make a JWT Client

func (JWTClient) AccessAndRefreshTokens added in v0.1.0

func (jwtClient JWTClient) AccessAndRefreshTokens(
	userIdentity string, scopes []string) (string, string, string, error)

AccessAndRefreshTokens is used create access and refresh tokens

func (JWTClient) FreshToken added in v0.1.0

func (jwtClient JWTClient) FreshToken(userIdentity string) (string, error)

FreshToken is used to create a fresh access token

func (*JWTClient) Init

func (jwtClient *JWTClient) Init(service micro.Service)

Init initalizes cliet

func (JWTClient) RefreshTokens added in v0.1.0

func (jwtClient JWTClient) RefreshTokens(
	refreshToken string) (string, string, string, error)

RefreshTokens is used to create access and refresh token based on previous refresh token

func (JWTClient) ValidateToken

func (jwtClient JWTClient) ValidateToken(
	token, tokenType string) (bool, string, []string, error)

ValidateToken is used to validate a token

type UsersClient added in v0.1.0

type UsersClient struct {
	// contains filtered or unexported fields
}

UsersClient is used to communicate with users service

func NewUsersClient added in v0.1.0

func NewUsersClient(service micro.Service) UsersClient

NewUsersClient is used to get users client struct

func (UsersClient) Add added in v0.1.0

func (usersClient UsersClient) Add(
	mainData config.UserMain, extraData config.UserExtra) (string, string, error)

Add is used to add a user

func (UsersClient) Auth added in v0.1.0

func (usersClient UsersClient) Auth(username, password string) (string, string, error)

Auth is used to authenticate a user

func (UsersClient) Get added in v0.1.0

func (usersClient UsersClient) Get(userID string) (config.UserMain, string, error)

Get is used to get user main data

func (*UsersClient) Init added in v0.1.0

func (usersClient *UsersClient) Init(service micro.Service)

Init is used to initialise client

func (UsersClient) Update added in v0.1.0

func (usersClient UsersClient) Update(userID string, update config.UserMain) error

Update is used to update user data

Jump to

Keyboard shortcuts

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