mirror of
https://github.com/rancher/steve.git
synced 2025-09-16 23:39:16 +00:00
SQLite backed cache (#223)
This uses SQLite-backed informers provided by Lasso with https://github.com/rancher/lasso/pull/65 to implement Steve API (/v1/) functionality. This new functionality is available behind a feature flag to be specified at Steve startup See https://confluence.suse.com/pages/viewpage.action?pageId=1359086083 Co-authored-by: Ricardo Weir <ricardo.weir@suse.com> Co-authored-by: Michael Bolot <michael.bolot@suse.com> Co-authored-by: Silvio Moioli <silvio@moioli.net> Signed-off-by: Silvio Moioli <silvio@moioli.net>
This commit is contained in:
@@ -23,14 +23,14 @@ type Config struct {
|
||||
}
|
||||
|
||||
func (c *Config) MustServer(ctx context.Context) *server.Server {
|
||||
cc, err := c.ToServer(ctx)
|
||||
cc, err := c.ToServer(ctx, false)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return cc
|
||||
}
|
||||
|
||||
func (c *Config) ToServer(ctx context.Context) (*server.Server, error) {
|
||||
func (c *Config) ToServer(ctx context.Context, sqlCache bool) (*server.Server, error) {
|
||||
var (
|
||||
auth steveauth.Middleware
|
||||
)
|
||||
@@ -51,6 +51,7 @@ func (c *Config) ToServer(ctx context.Context) (*server.Server, error) {
|
||||
return server.New(ctx, restConfig, &server.Options{
|
||||
AuthMiddleware: auth,
|
||||
Next: ui.New(c.UIPath),
|
||||
SQLCache: sqlCache,
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user