utils

package
v0.0.0-...-67066b3 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GRPCServerPort is the port used in the gRPC server
	GRPCServerPort = "8080"
	// ProxyPort is the port used in the proxy gateway server
	ProxyPort = "8000"
	// Network is the network type, which must be "tcp", "tcp4", "tcp6", "unix" or "unixpacket".
	Network = "tcp"
)

Variables

This section is empty.

Functions

func CertOption

func CertOption(tlsEnabled string) credentials.TransportCredentials

func GenerateTestData

func GenerateTestData()

GenerateTestData generates json array & stores it to testdata/testdata.json file

func GetCertPool

func GetCertPool() *x509.CertPool

func GetDialOption

func GetDialOption(tlsEnabled string) grpc.DialOption

func GetServerCerts

func GetServerCerts() *tls.Certificate

func RandomBookWithID

func RandomBookWithID(id string) *pb.Book

RandomBookWithID returns a random book item with the given ID

func RandomInt

func RandomInt(min int, max int) int

RandomInt returns a random integer in a given range [min-max]

func RandomName

func RandomName() string

RandomName returns a random name from the provided list

Types

This section is empty.

Jump to

Keyboard shortcuts

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