🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

github.com/micro/go-plugins/config/source/grpc/v2

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/micro/go-plugins/config/source/grpc/v2

v2.9.1
Source
Go
Version published
Created
Source

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)

FAQs

Package last updated on 06 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts