LicenseOptions is used to generate a license for testing. It supports the builder pattern for easy customization.
| 164 | // LicenseOptions is used to generate a license for testing. |
| 165 | // It supports the builder pattern for easy customization. |
| 166 | type LicenseOptions struct { |
| 167 | AccountType string |
| 168 | AccountID string |
| 169 | DeploymentIDs []string |
| 170 | Trial bool |
| 171 | FeatureSet codersdk.FeatureSet |
| 172 | AllFeatures bool |
| 173 | PublishUsageData bool |
| 174 | // GraceAt is the time at which the license will enter the grace period. |
| 175 | GraceAt time.Time |
| 176 | // ExpiresAt is the time at which the license will hard expire. |
| 177 | // ExpiresAt should always be greater then GraceAt. |
| 178 | ExpiresAt time.Time |
| 179 | // NotBefore is the time at which the license becomes valid. If set to the |
| 180 | // zero value, the `nbf` claim on the license is set to 1 minute in the |
| 181 | // past. |
| 182 | NotBefore time.Time |
| 183 | // IssuedAt is the time at which the license was issued. If set to the |
| 184 | // zero value, the `iat` claim on the license is set to 1 minute in the |
| 185 | // past. |
| 186 | IssuedAt time.Time |
| 187 | Features license.Features |
| 188 | Addons []codersdk.Addon |
| 189 | |
| 190 | AllowEmpty bool |
| 191 | } |
| 192 | |
| 193 | func (opts *LicenseOptions) WithIssuedAt(now time.Time) *LicenseOptions { |
| 194 | opts.IssuedAt = now |
nothing calls this directly
no outgoing calls
no test coverage detected