licensing

package
v0.127.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCapacityExceeded = errors.New("licensed capacity limit exceeded")

ErrCapacityExceeded is returned when usage exceeds authorized license limits.

View Source
var ErrFeatureNotEntitled = errors.New("feature not included in active license entitlement")

ErrFeatureNotEntitled is returned when an enterprise feature is not licensed.

View Source
var ErrInvalidLicenseToken = errors.New("invalid or malformed license token")

ErrInvalidLicenseToken is returned when a license signature or format is invalid.

View Source
var ErrLicenseExpired = errors.New("commercial license has expired")

ErrLicenseExpired is returned when a commercial license has expired.

Functions

This section is empty.

Types

type CapacityDescriptor

type CapacityDescriptor interface {
	// MaxNodes returns the maximum allowable active nodes, or -1 if unlimited.
	MaxNodes() int

	// MaxDatasources returns the maximum number of connected databases, or -1 if unlimited.
	MaxDatasources() int

	// MaxTenants returns the maximum number of managed organizational tenants.
	MaxTenants() int

	// MetricLimit returns the licensed limit for a custom named metric.
	MetricLimit(metric string) (int64, bool)
}

CapacityDescriptor defines the metrics and boundaries governing licensed infrastructure.

type CatalogSyncRequest

type CatalogSyncRequest struct {
	NodeID       string
	ProjectID    string
	LocalVersion string
	Checksum     string
}

CatalogSyncRequest contains parameters for synchronizing catalog state with a coordinator.

type CatalogSyncResponse

type CatalogSyncResponse struct {
	UpToDate     bool
	LatestCommit string
	DownloadURL  string
}

CatalogSyncResponse contains the coordinator's sync directive.

type CommunityCapacity

type CommunityCapacity struct{}

CommunityCapacity implements CapacityDescriptor for the standalone community edition.

func (CommunityCapacity) MaxDatasources

func (c CommunityCapacity) MaxDatasources() int

func (CommunityCapacity) MaxNodes

func (c CommunityCapacity) MaxNodes() int

func (CommunityCapacity) MaxTenants

func (c CommunityCapacity) MaxTenants() int

func (CommunityCapacity) MetricLimit

func (c CommunityCapacity) MetricLimit(metric string) (int64, bool)

type CommunityVerifier

type CommunityVerifier struct{}

CommunityVerifier provides a default verifier for community standalone deployments.

func (*CommunityVerifier) CheckCapacity

func (v *CommunityVerifier) CheckCapacity(_ context.Context, _ string, _ int64) error

func (*CommunityVerifier) HasFeature

func (v *CommunityVerifier) HasFeature(_ context.Context, feature Feature) (bool, error)

func (*CommunityVerifier) VerifyEntitlement

func (v *CommunityVerifier) VerifyEntitlement(_ context.Context, _ string) (*EntitlementStatus, error)

type CoordinatorContract

type CoordinatorContract interface {
	// RegisterNode registers a running DataTug instance with the centralized coordinator.
	RegisterNode(ctx context.Context, info NodeInfo) error

	// Heartbeat sends periodic telemetry and health pings to the coordinator.
	Heartbeat(ctx context.Context, nodeID string, stats NodeStats) error

	// FetchEntitlement retrieves the latest authoritative entitlement status from the coordinator.
	FetchEntitlement(ctx context.Context) (*EntitlementStatus, error)

	// SyncCatalog coordinates catalog synchronization with the centralized enterprise registry.
	SyncCatalog(ctx context.Context, req CatalogSyncRequest) (*CatalogSyncResponse, error)
}

CoordinatorContract defines the communication and synchronization boundary between DataTug instances and enterprise fleet coordinators.

type EntitlementStatus

type EntitlementStatus struct {
	Tier         LicenseTier
	CustomerName string
	IssuedAt     time.Time
	ExpiresAt    time.Time
	Features     []Feature
	Capacity     CapacityDescriptor
	Signature    string
}

EntitlementStatus describes the verified license state and granted capabilities.

func (*EntitlementStatus) IsExpired

func (e *EntitlementStatus) IsExpired(now time.Time) bool

IsExpired checks if the entitlement is past its validity expiration.

type EntitlementVerifier

type EntitlementVerifier interface {
	// VerifyEntitlement inspects and validates a raw license token.
	VerifyEntitlement(ctx context.Context, token string) (*EntitlementStatus, error)

	// HasFeature verifies whether a specific enterprise capability is authorized.
	HasFeature(ctx context.Context, feature Feature) (bool, error)

	// CheckCapacity verifies that current usage of a metric does not violate limits.
	CheckCapacity(ctx context.Context, metric string, currentUsage int64) error
}

EntitlementVerifier defines the contract for validating enterprise licenses and verifying feature availability without tight coupling to proprietary license servers.

func NewCommunityVerifier

func NewCommunityVerifier() EntitlementVerifier

NewCommunityVerifier returns an EntitlementVerifier configured for community mode.

type Feature

type Feature string

Feature identifies a commercial or enterprise feature capability.

const (
	FeatureFleetCoordination   Feature = "fleet_coordination"
	FeatureMultiTenant         Feature = "multi_tenant"
	FeatureEnterpriseRBAC      Feature = "enterprise_rbac"
	FeatureAuditLogging        Feature = "audit_logging"
	FeatureDistributedCatalog  Feature = "distributed_catalog"
	FeatureManagedMeaningGraph Feature = "managed_meaning_graph"
)

type LicenseTier

type LicenseTier string

LicenseTier represents the tier level of a DataTug installation.

const (
	TierCommunity  LicenseTier = "community"
	TierEvaluation LicenseTier = "evaluation"
	TierEnterprise LicenseTier = "enterprise"
)

type NodeInfo

type NodeInfo struct {
	NodeID      string
	Hostname    string
	Version     string
	StartedAt   time.Time
	Environment string
	Labels      map[string]string
}

NodeInfo contains metadata describing an active DataTug node registering with a coordinator.

type NodeStats

type NodeStats struct {
	NodeID          string
	ReportedAt      time.Time
	ActiveQueries   int
	ConnectedStores int
	MemoryBytes     uint64
}

NodeStats reports runtime metrics from an active node to the fleet coordinator.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL