github.com/hernad/nomad@v1.6.112/nomad/license_config.go (about)

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: MPL-2.0
     3  
     4  package nomad
     5  
     6  import (
     7  	"time"
     8  
     9  	"golang.org/x/exp/slices"
    10  )
    11  
    12  // LicenseConfig allows for tunable licensing config
    13  // primarily used for enterprise testing
    14  type LicenseConfig struct {
    15  	// BuildDate is the time of the git commit used to build the program.
    16  	BuildDate time.Time
    17  
    18  	// LicenseEnvBytes is the license bytes to use for the server's license
    19  	LicenseEnvBytes string
    20  
    21  	// LicensePath is the path to use for the server's license
    22  	LicensePath string
    23  
    24  	// AdditionalPubKeys is a set of public keys to
    25  	AdditionalPubKeys []string
    26  }
    27  
    28  func (c *LicenseConfig) Copy() *LicenseConfig {
    29  	if c == nil {
    30  		return nil
    31  	}
    32  
    33  	nc := *c
    34  	nc.AdditionalPubKeys = slices.Clone(c.AdditionalPubKeys)
    35  	return &nc
    36  }