MCPcopy Index your code
hub / github.com/coder/coder / New

Function New

coderd/entitlements/entitlements.go:27–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25}
26
27func New() *Set {
28 s := &Set{
29 // Some defaults for an unlicensed instance.
30 // These will be updated when coderd is initialized.
31 entitlements: codersdk.Entitlements{
32 Features: map[codersdk.FeatureName]codersdk.Feature{},
33 Warnings: []string{},
34 Errors: []string{},
35 HasLicense: false,
36 Trial: false,
37 RequireTelemetry: false,
38 RefreshedAt: time.Time{},
39 },
40 right2Update: make(chan struct{}, 1),
41 }
42 // Ensure all features are present in the entitlements. Our frontend
43 // expects this.
44 for _, featureName := range codersdk.FeatureNames {
45 s.entitlements.AddFeature(featureName, codersdk.Feature{
46 Entitlement: codersdk.EntitlementNotEntitled,
47 Enabled: false,
48 })
49 }
50 s.right2Update <- struct{}{} // one token, serialized updates
51 return s
52}
53
54// ErrLicenseRequiresTelemetry is an error returned by a fetch passed to Update to indicate that the
55// fetched license cannot be used because it requires telemetry.

Callers 14

NewFunction · 0.92
TestModifyFunction · 0.92
TestAllowRefreshFunction · 0.92
TestUpdateFunction · 0.92
ServerMethod · 0.92
NewFunction · 0.92

Calls 1

AddFeatureMethod · 0.80