nightwatch

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeAggregateStore

func InitializeAggregateStore(db *gorm.DB) (store.Interface, error)

func InitializeHandler

func InitializeHandler(db *gorm.DB) *handler.Handler

func InitializeStore

func InitializeStore(db *gorm.DB) (store4.IStore, error)

func InstallGenericAPI

func InstallGenericAPI(engine *gin.Engine)

InstallGenericAPI 注册业务无关的路由,例如 pprof、404 处理等.

func InstallJobAPI

func InstallJobAPI(engine *gin.Engine, db *gorm.DB)

Types

type Config

type Config struct {
	HealthOptions     *genericoptions.HealthOptions
	MySQLOptions      *genericoptions.MySQLOptions
	RedisOptions      *genericoptions.RedisOptions
	WatchOptions      *watch.Options
	HTTPOptions       *genericoptions.HTTPOptions
	TLSOptions        *genericoptions.TLSOptions
	DisableRESTServer bool
	// The maximum concurrency event of user watcher.
	UserWatcherMaxWorkers int64
	// The list of watchers that should be disabled.
	Client clientset.Interface
	// Created from MySQLOptions.
	DB *gorm.DB
}

Config contains application-related configurations.

func (*Config) CreateWatcherConfig

func (cfg *Config) CreateWatcherConfig() (*watcher.AggregateConfig, error)

CreateWatcherConfig used to create configuration used by all watcher.

func (*Config) NewServer

func (cfg *Config) NewServer(ctx context.Context) (*Server, error)

NewServer initializes and returns a new Server instance.

type RESTServer

type RESTServer struct {
	// contains filtered or unexported fields
}

RESTServer 定义一个使用 Gin 框架开发的 HTTP 服务器.

func NewRESTServer

func NewRESTServer(httpOptions *genericoptions.HTTPOptions, tlsOptions *genericoptions.TLSOptions, db *gorm.DB) *RESTServer

func (*RESTServer) GracefulStop

func (s *RESTServer) GracefulStop(ctx context.Context)

GracefulStop 优雅停止服务器.

func (*RESTServer) RunOrDie

func (s *RESTServer) RunOrDie()

RunOrDie 启动 Gin 服务器,出错则程序崩溃退出.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents the web server.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts the server and listens for termination signals. It gracefully shuts down the server upon receiving a termination signal.

Directories

Path Synopsis
biz
Package biz is the place where you can implements more complex business logic.
Package biz is the place where you can implements more complex business logic.
pkg
nolint: dupl
nolint: dupl
Package watcher provides functions used by all watchers.
Package watcher provides functions used by all watchers.
all
clean
Package clean is a watcher implement.
Package clean is a watcher implement.
cronjob/cronjob
Package cronjob is a watcher implement.
Package cronjob is a watcher implement.
cronjob/statesync
Package statesync is a watcher implement.
Package statesync is a watcher implement.
secretsclean
Package secretsclean is a watcher implement used to delete expired keys from the database.
Package secretsclean is a watcher implement used to delete expired keys from the database.
user
Package user is a watcher implement.
Package user is a watcher implement.

Jump to

Keyboard shortcuts

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