github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/base/license.go (about) 1 // Copyright 2018 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 package base 12 13 import ( 14 "github.com/cockroachdb/cockroach/pkg/settings/cluster" 15 "github.com/cockroachdb/cockroach/pkg/util/uuid" 16 "github.com/cockroachdb/errors" 17 ) 18 19 // CheckEnterpriseEnabled returns a non-nil error if the requested enterprise 20 // feature is not enabled, including information or a link explaining how to 21 // enable it. 22 // 23 // This function is overridden by an init hook in CCL builds. 24 var CheckEnterpriseEnabled = func(_ *cluster.Settings, _ uuid.UUID, org, feature string) error { 25 return errors.New("OSS binaries do not include enterprise features") 26 } 27 28 // LicenseType returns what type of license the cluster is running with, or 29 // "OSS" if it is an OSS build. 30 // 31 // This function is overridden by an init hook in CCL builds. 32 var LicenseType = func(st *cluster.Settings) (string, error) { 33 return "OSS", nil 34 }