mirror of
https://github.com/niusmallnan/steve.git
synced 2025-09-09 00:50:05 +00:00
Refactor context to be sharable
This commit is contained in:
@@ -27,8 +27,6 @@ type Server struct {
|
||||
RestConfig *rest.Config
|
||||
|
||||
Namespace string
|
||||
HTTPSPort int
|
||||
HTTPPort int
|
||||
BaseSchemas *types.APISchemas
|
||||
SchemaTemplates []schema.Template
|
||||
AuthMiddleware auth.Middleware
|
||||
@@ -47,6 +45,10 @@ type Controllers struct {
|
||||
starters []start.Starter
|
||||
}
|
||||
|
||||
func (c *Controllers) Start(ctx context.Context) error {
|
||||
return start.All(ctx, 5, c.starters...)
|
||||
}
|
||||
|
||||
func NewController(cfg *rest.Config) (*Controllers, error) {
|
||||
c := &Controllers{}
|
||||
|
||||
|
Reference in New Issue
Block a user