endpoint

package
v1.0.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttemptSecured

func AttemptSecured(url string, allowInSecure bool) bool

AttemptSecured is a utility function which verifies URL and returns if secured connections needs to established for protocol 'grpcs' in URL returns true for protocol 'grpc' in URL returns false for no protocol mentioned, returns !allowInSecure

func IsTLSEnabled

func IsTLSEnabled(url string) bool

IsTLSEnabled is a generic function that expects a URL and verifies if it has a prefix HTTPS or GRPCS to return true for TLS Enabled URLs or false otherwise

func ToAddress

func ToAddress(url string) string

ToAddress is a utility function to trim the GRPC protocol prefix as it is not needed by GO if the GRPC protocol is not found, the url is returned unchanged

Types

type TLSConfig

type TLSConfig struct {
	// the following two fields are interchangeable.
	// If Path is available, then it will be used to load the cert
	// if Pem is available, then it has the raw data of the cert it will be used as-is
	// Certificate root certificate path
	Path string
	// Certificate actual content
	Pem string
}

TLSConfig TLS configuration used in the sdk's configs.

func (TLSConfig) Bytes

func (cfg TLSConfig) Bytes() ([]byte, error)

Bytes returns the tls certificate as a byte array by loading it either from the embedded Pem or Path

func (TLSConfig) TLSCert

func (cfg TLSConfig) TLSCert() (*x509.Certificate, error)

TLSCert returns the tls certificate as a *x509.Certificate by loading it either from the embedded Pem or Path

Jump to

Keyboard shortcuts

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