Refactor context to be sharable

This commit is contained in:
Darren Shepherd
2020-01-31 15:10:47 -07:00
parent 707b87671b
commit 91dde5ead6
4 changed files with 26 additions and 43 deletions

View File

@@ -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{}