Categorygithub.com/go-micro/plugins/v4/config/source/grpc
modulepackage
1.2.0
Repository: https://github.com/go-micro/plugins.git
Documentation: pkg.go.dev

# README

gRPC Source

The gRPC source reads from a gRPC server

Server

A gRPC source server should implement the Source proto interface.

service Source {
	rpc Read(ReadRequest) returns (ReadResponse) {};
	rpc Watch(WatchRequest) returns (stream WatchResponse) {};
}

New Source

Specify source with address and path

source := grpc.NewSource(
	// optionally specify server address; default to localhost:8080
	grpc.WithAddress("10.0.0.10:8500"),
	// optionally specify a path; defaults to /micro/config
	grpc.WithPath("/my/config/path"),
)

Load Source

Load the source into config

// Create new config
conf := config.NewConfig()

// Load file source
conf.Load(grpcSource)

# Packages

Package grpc is a generated protocol buffer package.

# Functions

No description provided by the author
WithAddress sets the consul address.
WithPath sets the key prefix to use.
WithTLS sets the TLS config for the service.

# Variables

No description provided by the author
No description provided by the author