Documentation
¶
Index ¶
- Constants
- type Option
- func WithCertPool(p *x509.CertPool) Option
- func WithCertificate(c ...tls.Certificate) Option
- func WithClientAuth(a tls.ClientAuthType) Option
- func WithHTTPPassthrough() Option
- func WithHTTPPassthroughInsecure() Option
- func WithInsecureSkipVerify() Option
- func WithLogger(l log.Logger) Option
- func WithPort(p int) Option
- func WithReflectionService() Option
- func WithStreamServerInterceptors(ss ...grpc.StreamServerInterceptor) Option
- func WithTLSCert(s string) Option
- func WithTLSKey(s string) Option
- func WithUnaryServerInterceptors(us ...grpc.UnaryServerInterceptor) Option
- func WithViper(args ...string) Option
- type Server
- func (s *Server) Address() net.Addr
- func (s *Server) Errors() []error
- func (s *Server) HTTPAddress() net.Addr
- func (s *Server) Notify(states ...State) <-chan State
- func (s *Server) RegisterHTTPService(...) error
- func (s *Server) Start()
- func (s *Server) State() State
- func (s *Server) Stop()
- func (s *Server) Transport() *grpc.Server
- type State
Constants ¶
const ( // EnvironmentPrefix sets the prefix to strip from environment variables when resolving keys. Default: "DDL_RPC". EnvironmentPrefix = "env-prefix" // EnvironmentReplace takes a comma separated list of old,new. Default: .,_,-,_ EnvironmentReplace = "env-replace" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*options)
Option provides a function definition to set options
func WithCertPool ¶
WithCertPool overrides the system cert pool.
func WithCertificate ¶
func WithCertificate(c ...tls.Certificate) Option
WithCertificate specifies the certificates that will be appended to the tls.Config.
func WithClientAuth ¶
func WithClientAuth(a tls.ClientAuthType) Option
WithClientAuth sets the tls ClientAuthType to control auth behavior.
func WithHTTPPassthrough ¶
func WithHTTPPassthrough() Option
WithHTTPPassthrough starts an additional HTTP passthrough for rest operations
func WithHTTPPassthroughInsecure ¶
func WithHTTPPassthroughInsecure() Option
WithHTTPPassthroughInsecure enables an insecure http passthrough
func WithInsecureSkipVerify ¶
func WithInsecureSkipVerify() Option
WithInsecureSkipVerify makes connections not that safe to use.
func WithReflectionService ¶
func WithReflectionService() Option
WithReflectionService starts a reflection service capable to describing services
func WithStreamServerInterceptors ¶
func WithStreamServerInterceptors(ss ...grpc.StreamServerInterceptor) Option
WithStreamServerInterceptors sets the streaming middleware.
func WithUnaryServerInterceptors ¶
func WithUnaryServerInterceptors(us ...grpc.UnaryServerInterceptor) Option
WithUnaryServerInterceptors sets the unary middleware.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a server struct
func (*Server) Errors ¶
Errors returns any errors registered during construction, starting, or stopping.
func (*Server) HTTPAddress ¶
HTTPAddress returns the address
func (*Server) Notify ¶
Notify will send requested rpc.State changes over the channel returned by this function.
func (*Server) RegisterHTTPService ¶
func (s *Server) RegisterHTTPService(in []func(context.Context, *grpc_runtime.ServeMux, string, []grpc.DialOption) error) error
RegisterHTTPService accepts a slice of http gateway services to register
type State ¶
type State int
State tracks the state of the connection
const ( // Init is a new connection Init State = iota // Starting means the connection is starting Starting // Ready means the connection is ready Ready // Stopping means the connection is being shut down Stopping // Stopped means the connection is stopping Stopped // Error means the connection is in error Error )