Documentation ¶
Overview ¶
* @Date: 2022-04-30 10:34:56 * @LastEditTime: 2022-04-30 16:26:27 * @FilePath: \go-frame\pkgs\options\gin_option.go
* @Date: 2022-04-30 16:11:43 * @LastEditTime: 2022-04-30 16:11:44 * @FilePath: \go-frame\pkgs\options\tasks_option.go
Index ¶
- func GrpcOptionEtcd() grpcOption
- type Option
- func WithConfigFile(configFile string) Option
- func WithEtcd() Option
- func WithFxOption(fxOptions ...fx.Option) Option
- func WithFxOptions(fxOptions ...[]fx.Option) Option
- func WithGRPCClient(options ...grpcOption) Option
- func WithGRPCServer(options ...grpcOption) Option
- func WithGoutConfig() Option
- func WithGraceRestart() Option
- func WithHttp(_ *swag.Spec) Option
- func WithHwOBS() Option
- func WithInvokes(Invokes ...any) Option
- func WithKafka() Option
- func WithLogNotice() Option
- func WithMysql(mysqlNames ...string) Option
- func WithProviders(providers ...any) Option
- func WithRedis() Option
- func WithStart() Option
- func WithTasks() Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*Options) // 选项函数类型
func WithGRPCClient ¶
func WithGRPCClient(options ...grpcOption) Option
GRPC client,使用etcd作为服务发现时,需要先调用options.WithEtcd(),初始化一个etcd客户端
func WithGRPCServer ¶
func WithGRPCServer(options ...grpcOption) Option
GRPC server,使用etcd作为服务发现时,需要先调用options.WithEtcd(),初始化一个etcd客户端
func WithGoutConfig ¶
func WithGoutConfig() Option
指定github.com/guonaihong/gout这个库的全局配置: 是否全局开启调试,设置全局的超时
func WithGraceRestart ¶
func WithGraceRestart() Option
func WithHttp ¶
使用gin框架,这里传递的文档参数主要用来注册文档,如果不传,在配置文件开启或者关闭文档,那么文档也不起作用 即使传了生成的文档对象,如果配置文件关闭了,那么也不起作用,所以在代码中就直接传递参数,使用配置文件来控制文档的关闭
func WithKafka ¶
func WithKafka() Option
使用kafka的底层sarama.Client, sarama.AsyncProducer, sarama.SyncProducer, sarama.Consumer 依赖
Click to show internal directories.
Click to hide internal directories.