client

package
Version: v0.0.0-...-7bce887 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2017 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthClient

type AuthClient interface {
	// LogIn logs in
	LogIn(r *pb.LogInRequest) (*pb.AuthResponse, error)
	// Validate validates
	Validate(r *pb.CredentialsRequest) (*pb.AuthResponse, error)
}

AuthClient abstracts grpc and rest clients

func NewGrpcClient

func NewGrpcClient(endpoint string) AuthClient

NewGrpcClient creates a new grpc client for given endpoint

func NewRestClient

func NewRestClient(endpoint string) AuthClient

NewRestClient creates a new rest client for given endpoint

type GrpcClient

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

GrpcClient is a GRPC implementation of AuthClient

func (GrpcClient) LogIn

func (g GrpcClient) LogIn(r *pb.LogInRequest) (*pb.AuthResponse, error)

LogIn logs in

func (GrpcClient) Validate

func (g GrpcClient) Validate(r *pb.CredentialsRequest) (*pb.AuthResponse, error)

Validate validates

type RestClient

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

RestClient is a REST implementation of AuthClient

func (RestClient) LogIn

func (c RestClient) LogIn(r *pb.LogInRequest) (*pb.AuthResponse, error)

LogIn logs in

func (RestClient) Validate

func (c RestClient) Validate(r *pb.CredentialsRequest) (*pb.AuthResponse, error)

Validate validates

Source Files

Jump to

Keyboard shortcuts

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