http

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

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

Proxy proxy a request to the user service

func NewUserProxy

func NewUserProxy(logger logging.Logger, hostname string, port uint16) *Proxy

NewUserProxy creates a proxy to the users service

func (*Proxy) Create

func (p *Proxy) Create(user entities.User) (err error)

Create proxy the http request to user service

func (*Proxy) CreateToken

func (p *Proxy) CreateToken(user entities.User) (string, error)

CreateToken genereates a token for the specified user

type TokenResponse

type TokenResponse struct {
	Token string `json:"token"`
}

TokenResponse represents the creating token response from the users service

type UserProxy

type UserProxy interface {
	Create(user entities.User) (err error)
	CreateToken(user entities.User) (string, error)
}

UserProxy proxy a request to the user service interface

Jump to

Keyboard shortcuts

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