gateway

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialOptions

func DialOptions(cfg ProxyConfig) ([]grpc.DialOption, error)

DialOptions of a ProxyConfig, will return all the gRPC client options like timeout, etc...

Types

type Client

type Client struct {
	Spotify    spotify.SpotifyClient
	Collection collection.CollectionClient
}

Client to all the diskr services

func NewClient

func NewClient(config ...Configuration) (*Client, error)

NewClient bootsrap a new client based on environment variables

func NewClientFromEnv

func NewClientFromEnv() (*Client, error)

NewClientFromEnv automatically bootstrap a new gateway client based on env variables

type Config

type Config struct {
	Spotify    ProxyConfig
	Collection ProxyConfig
}

Config for any kind of gateway that proxy requests to Diskr services

type Configuration

type Configuration func(*Client) error

Configuration function for a gateway client

func WithCollection

func WithCollection(config ProxyConfig) Configuration

WithCollection create a new gRPC connection to the collection service

func WithSpotify

func WithSpotify(config ProxyConfig) Configuration

WithSpotify create a new gRPC connection to the collection service

type ProxyConfig

type ProxyConfig struct {
	Target   string `required:"true"`
	Timeout  string `default:"1s"`
	Insecure bool   `default:"true"`
}

ProxyConfig define the options used to contact a gRPC service

func (ProxyConfig) Conn

func (pc ProxyConfig) Conn() (*grpc.ClientConn, error)

Conn create a new gRPC connection to the given proxy

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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