grpcconf

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package grpcconf helps configure gRPC service connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Host string `json:"host"`
	Port string `json:"port"`

	// Insecure is required by gRPC to say when there are no TLS connection
	// details.
	Insecure bool `json:"insecure"`

	// PublicURL defines the base url to use when forwarding the user to
	// public side of the service. Not all services required this.
	PublicURL string `json:"public_url"`
}

Service defines a generic base for dealing with connection details to an internal gRPC service.

func (*Service) Connection

func (s *Service) Connection(ctx context.Context, opts ...grpc.DialOption) (*grpc.ClientConn, error)

Connection provides an instance of the grpc connection.

func (*Service) DialOptions

func (s *Service) DialOptions() []grpc.DialOption

DialOptions provides an array of gRPC DialOptions based on the defined service configuration.

func (*Service) URL

func (s *Service) URL() string

URL provides the result of joining the Host and Port together.

Jump to

Keyboard shortcuts

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