Documentation ¶
Index ¶
- type Client
- type GrpcRegisterHandler
- type Option
- func Build(build string) Option
- func Config(config *viper.Viper) Option
- func Description(description string) Option
- func Name(name string) Option
- func Version(version string) Option
- func WithDbConfigureFn(fn gormx.ConfigureFn) Option
- func WithEchoTracingSkipper(skipper middleware.Skipper) Option
- func WithGrpcClientDialOptions(options ...grpc.DialOption) Option
- func WithGrpcClientDialTimeout(timeout time.Duration) Option
- func WithGrpcServerEnableReflection(enable bool) Option
- func WithGrpcServerOptions(options ...grpc.ServerOption) Option
- func WithSentry(options sentry.ClientOptions) Option
- type Options
- type Server
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // GrpcClientConn returns a grpc client connection GrpcClientConn(ctx context.Context, service string, desc *grpc.ServiceDesc, endpoint ...string) (grpc.ClientConnInterface, error) }
Client is the client for xservice
type GrpcRegisterHandler ¶
GrpcRegisterHandler is the interface for gRPC service register handler
type Option ¶
type Option func(*Options)
Option for option config
func Config ¶
Config set custom viper instance for xservice configuration
Note: default configuration enabled watch feature, if set custom viper, watch feature should implements by you self
func Description ¶
Description set description for service
func WithDbConfigureFn ¶ added in v1.0.17
func WithDbConfigureFn(fn gormx.ConfigureFn) Option
WithDbConfigureFn set db configure function
func WithEchoTracingSkipper ¶
func WithEchoTracingSkipper(skipper middleware.Skipper) Option
WithEchoTracingSkipper set tracing skipper
func WithGrpcClientDialOptions ¶ added in v1.0.11
func WithGrpcClientDialOptions(options ...grpc.DialOption) Option
WithGrpcClientDialOptions add additional grpc client dial options
func WithGrpcClientDialTimeout ¶ added in v1.0.12
WithGrpcClientDialTimeout set client dial timeout default 2 seconds
func WithGrpcServerEnableReflection ¶ added in v1.2.0
WithGrpcServerEnableReflection enable reflection for grpc server
func WithGrpcServerOptions ¶ added in v1.0.11
func WithGrpcServerOptions(options ...grpc.ServerOption) Option
WithGrpcServerOptions add additional grpc server options
func WithSentry ¶
func WithSentry(options sentry.ClientOptions) Option
WithSentry set sentry option for enable sentry
type Options ¶
type Options struct { Name string Version string Build string Description string Config *viper.Viper DbConfigureFn gormx.ConfigureFn GrpcServerOptions []grpc.ServerOption GrpcServerEnableReflection bool GrpcClientDialOptions []grpc.DialOption GrpcClientDialTimeout time.Duration SentryOptions sentry.ClientOptions EchoTracingSkipper middleware.Skipper }
Options for xservice core option
type Server ¶
type Server interface { // Echo returns the echo instance Echo() *echo.Echo // Serve start and listen server Serve() error // GrpcRegister registers a gRPC service GrpcRegister(desc *grpc.ServiceDesc, impl interface{}, handler ...GrpcRegisterHandler) }
Server is the interface for xservice server