Documentation ¶
Overview ¶
Package license is a generated protocol buffer package.
It is generated from these files:
license.proto
It has these top-level messages:
License Entitlement
package license provides functions for reading and printing licenses generated by Chef's license generation service.
WARNING WARNING WARNING WARNING WARNING ¶
The code in this package is a copy of code in the chef/license library. chef/license is still proprietary and thus cannot be included in full as a dependency. Please take care that any changes to this file are compatible with the chef/license library.
WARNING WARNING WARNING WARNING WARNING
Index ¶
- func GetKeySha256(jwtLicense string) (string, error)
- type Entitlement
- func (*Entitlement) Descriptor() ([]byte, []int)
- func (m *Entitlement) GetEnd() *google_protobuf.Timestamp
- func (m *Entitlement) GetLimit() int64
- func (m *Entitlement) GetMeasure() string
- func (m *Entitlement) GetName() string
- func (m *Entitlement) GetStart() *google_protobuf.Timestamp
- func (*Entitlement) ProtoMessage()
- func (m *Entitlement) Reset()
- func (m *Entitlement) String() string
- type License
- func (*License) Descriptor() ([]byte, []int)
- func (m *License) GetCustomer() string
- func (m *License) GetCustomerId() string
- func (m *License) GetCustomerIdVersion() string
- func (m *License) GetEntitlements() []*Entitlement
- func (m *License) GetGenerationDate() *google_protobuf.Timestamp
- func (m *License) GetGenerator() string
- func (m *License) GetId() string
- func (m *License) GetKeySha256() string
- func (m *License) GetType() string
- func (m *License) GetVersion() string
- func (l *License) PrettyPrint() string
- func (*License) ProtoMessage()
- func (m *License) Reset()
- func (m *License) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKeySha256 ¶
GetKeySha256 fetches the SHA256 of the public key from the JWT encoded license
Types ¶
type Entitlement ¶
type Entitlement struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Measure string `protobuf:"bytes,2,opt,name=measure" json:"measure,omitempty"` Limit int64 `protobuf:"zigzag64,3,opt,name=limit" json:"limit,omitempty"` Start *google_protobuf.Timestamp `protobuf:"bytes,22,opt,name=start" json:"start,omitempty"` End *google_protobuf.Timestamp `protobuf:"bytes,23,opt,name=end" json:"end,omitempty"` }
func (*Entitlement) Descriptor ¶
func (*Entitlement) Descriptor() ([]byte, []int)
func (*Entitlement) GetEnd ¶
func (m *Entitlement) GetEnd() *google_protobuf.Timestamp
func (*Entitlement) GetLimit ¶
func (m *Entitlement) GetLimit() int64
func (*Entitlement) GetMeasure ¶
func (m *Entitlement) GetMeasure() string
func (*Entitlement) GetName ¶
func (m *Entitlement) GetName() string
func (*Entitlement) GetStart ¶
func (m *Entitlement) GetStart() *google_protobuf.Timestamp
func (*Entitlement) ProtoMessage ¶
func (*Entitlement) ProtoMessage()
func (*Entitlement) Reset ¶
func (m *Entitlement) Reset()
func (*Entitlement) String ¶
func (m *Entitlement) String() string
type License ¶
type License struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Version string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` Type string `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"` Generator string `protobuf:"bytes,20,opt,name=generator" json:"generator,omitempty"` KeySha256 string `protobuf:"bytes,6,opt,name=key_sha256,json=keySha256" json:"key_sha256,omitempty"` GenerationDate *google_protobuf.Timestamp `protobuf:"bytes,21,opt,name=generation_date,json=generationDate" json:"generation_date,omitempty"` Customer string `protobuf:"bytes,24,opt,name=customer" json:"customer,omitempty"` CustomerId string `protobuf:"bytes,4,opt,name=customer_id,json=customerId" json:"customer_id,omitempty"` CustomerIdVersion string `protobuf:"bytes,25,opt,name=customer_id_version,json=customerIdVersion" json:"customer_id_version,omitempty"` Entitlements []*Entitlement `protobuf:"bytes,5,rep,name=entitlements" json:"entitlements,omitempty"` }
func Read ¶
Read and parse a license from a string and return the config Ex: sha, _ := license.GetKeySha256(license)
lic, _ := license.Read(license, publicKeys[sha])
func (*License) Descriptor ¶
func (*License) GetCustomer ¶
func (*License) GetCustomerId ¶
func (*License) GetCustomerIdVersion ¶
func (*License) GetEntitlements ¶
func (m *License) GetEntitlements() []*Entitlement
func (*License) GetGenerationDate ¶
func (m *License) GetGenerationDate() *google_protobuf.Timestamp
func (*License) GetGenerator ¶
func (*License) GetKeySha256 ¶
func (*License) GetVersion ¶
func (*License) PrettyPrint ¶
PrettyPrint a license into a nice string for text output
func (*License) ProtoMessage ¶
func (*License) ProtoMessage()