MCPcopy Index your code
hub / github.com/rilldata/rill / New

Function New

runtime/runtime.go:56–94  ·  view source on GitHub ↗
(ctx context.Context, opts *Options, logger *zap.Logger, st *storage.Client, ac *activity.Client, emailClient *email.Client)

Source from the content-addressed store, hash-verified

54}
55
56func New(ctx context.Context, opts *Options, logger *zap.Logger, st *storage.Client, ac *activity.Client, emailClient *email.Client) (*Runtime, error) {
57 if emailClient == nil {
58 emailClient = email.New(email.NewNoopSender())
59 }
60
61 rt := &Runtime{
62 Email: emailClient,
63 opts: opts,
64 Logger: logger,
65 storage: st,
66 activity: ac,
67 queryCache: newQueryCache(opts.QueryCacheSizeBytes),
68 }
69 rt.securityEngine = newSecurityEngine(opts.SecurityEngineCacheSize, logger, rt)
70
71 rt.connCache = rt.newConnectionCache()
72
73 store, _, err := rt.AcquireSystemHandle(ctx, opts.MetastoreConnector)
74 if err != nil {
75 return nil, err
76 }
77 rt.metastore = store
78 reg, ok := rt.metastore.AsRegistry()
79 if !ok {
80 return nil, fmt.Errorf("metastore must be a valid registry")
81 }
82
83 rt.registryCache = newRegistryCache(rt, reg, logger, ac)
84 err = rt.registryCache.init(ctx)
85 if err != nil {
86 return nil, err
87 }
88
89 if opts.EnableConfigReloader {
90 rt.configReloader = newConfigReloader(rt)
91 }
92
93 return rt, nil
94}
95
96func (r *Runtime) AllowHostAccess() bool {
97 return r.opts.AllowHostAccess

Callers 4

NewAppFunction · 0.92
StartCmdFunction · 0.92
NewFunction · 0.92
newTestRuntimeFunction · 0.70

Calls 11

newConnectionCacheMethod · 0.95
AcquireSystemHandleMethod · 0.95
NewFunction · 0.92
NewNoopSenderFunction · 0.92
newQueryCacheFunction · 0.85
newSecurityEngineFunction · 0.85
newRegistryCacheFunction · 0.85
newConfigReloaderFunction · 0.85
AsRegistryMethod · 0.65
ErrorfMethod · 0.65
initMethod · 0.45

Tested by 1

newTestRuntimeFunction · 0.56