conf

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_protos_http_server_grpc_client_bootstrap_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Bootstrap

type Bootstrap struct {

	// Server configuration list
	// Typically, this would configure an HTTP server to provide APIs
	// For example:
	// - Port number
	// - Middleware configuration
	// - Timeout settings
	Servers []*v1.Server `protobuf:"bytes,1,rep,name=servers,proto3" json:"servers,omitempty"`
	// Downstream gRPC client configuration mapping
	// The key is the logical name of the client, used to reference specific clients in code
	// For example:
	// - "user-service-client"
	// - "order-service-client"
	Clients map[string]*ClientConfig `` /* 141-byte string literal not displayed */
	// contains filtered or unexported fields
}

Bootstrap is the top-level configuration for a microservice with HTTP server and gRPC client This architecture pattern is suitable for scenarios that need to provide RESTful APIs while calling other gRPC services

func (*Bootstrap) Descriptor deprecated

func (*Bootstrap) Descriptor() ([]byte, []int)

Deprecated: Use Bootstrap.ProtoReflect.Descriptor instead.

func (*Bootstrap) GetClients

func (x *Bootstrap) GetClients() map[string]*ClientConfig

func (*Bootstrap) GetServers

func (x *Bootstrap) GetServers() []*v1.Server

func (*Bootstrap) ProtoMessage

func (*Bootstrap) ProtoMessage()

func (*Bootstrap) ProtoReflect

func (x *Bootstrap) ProtoReflect() protoreflect.Message

func (*Bootstrap) Reset

func (x *Bootstrap) Reset()

func (*Bootstrap) String

func (x *Bootstrap) String() string

type ClientConfig

type ClientConfig struct {

	// Business-level client configuration
	// Mainly configures how to discover and select gRPC service instances, for example:
	// - Service discovery method (direct, DNS, Consul, etc.)
	// - Load balancing strategy
	// - Circuit breaking and fallback configuration
	Endpoint *v11.Endpoint `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	// Transport-level client configuration
	// Mainly configures how to communicate with gRPC service instances, for example:
	// - Connection pool configuration
	// - Timeout settings
	// - Retry policy
	// - TLS configuration
	Transport *v1.Client `protobuf:"bytes,2,opt,name=transport,proto3" json:"transport,omitempty"`
	// contains filtered or unexported fields
}

ClientConfig combines all configurations needed for a gRPC client It includes service discovery and transport layer configurations

func (*ClientConfig) Descriptor deprecated

func (*ClientConfig) Descriptor() ([]byte, []int)

Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead.

func (*ClientConfig) GetEndpoint

func (x *ClientConfig) GetEndpoint() *v11.Endpoint

func (*ClientConfig) GetTransport

func (x *ClientConfig) GetTransport() *v1.Client

func (*ClientConfig) ProtoMessage

func (*ClientConfig) ProtoMessage()

func (*ClientConfig) ProtoReflect

func (x *ClientConfig) ProtoReflect() protoreflect.Message

func (*ClientConfig) Reset

func (x *ClientConfig) Reset()

func (*ClientConfig) String

func (x *ClientConfig) String() string

Jump to

Keyboard shortcuts

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