Documentation ¶
Index ¶
- type LicenseBuilder
- func (instance *LicenseBuilder) EncodeLicenseToBytes(license *license_commons.License) (bytes []byte, err error)
- func (instance *LicenseBuilder) EncodeLicenseToText(license *license_commons.License) (text string, err error)
- func (instance *LicenseBuilder) EncodeToBytes(uid, name, email, lang string, durationDays int64, ...) (bytes []byte, err error)
- func (instance *LicenseBuilder) EncodeToText(uid, name, email, lang string, durationDays int64, ...) (text string, err error)
- func (instance *LicenseBuilder) NewLicense(uid string) (license *license_commons.License)
- func (instance *LicenseBuilder) SaveLicenseToFile(license *license_commons.License, dir string) (filename string, err error)
- func (instance *LicenseBuilder) SaveLicenseToFileName(license *license_commons.License, filename string) (err error)
- func (instance *LicenseBuilder) SaveLicenseToTempFile(license *license_commons.License) (filename string, err error)
- func (instance *LicenseBuilder) SaveToFile(uid, name, email, lang string, durationDays int64, ...) error
- func (instance *LicenseBuilder) SaveToTempFile(uid, name, email, lang string, durationDays int64, ...) (string, error)
- func (instance *LicenseBuilder) ToText(uid, name, email, lang string, durationDays int64, ...) (text string)
- type LicenseClient
- type LicenseErrorCallback
- type LicenseHelper
- func (instance *LicenseHelper) AddErrorListener(callback LicenseErrorCallback) *LicenseHelper
- func (instance *LicenseHelper) Builder() (*LicenseBuilder, error)
- func (instance *LicenseHelper) Check() (err error)
- func (instance *LicenseHelper) SetConfigFile(filename string)
- func (instance *LicenseHelper) SetRoot(root string)
- func (instance *LicenseHelper) SetSecret(key string)
- func (instance *LicenseHelper) SetTolerance(duration time.Duration)
- func (instance *LicenseHelper) Start(interval time.Duration) (err error)
- func (instance *LicenseHelper) StartWithCallback(interval time.Duration, onFail LicenseErrorCallback) (err error)
- type LicenseTicker
- type LicenseTickerCallback
- type LicenseTickerContext
- type LicenseTickerEmail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LicenseBuilder ¶
type LicenseBuilder struct { }
func NewLicenseBuilder ¶
func NewLicenseBuilder() (instance *LicenseBuilder)
func (*LicenseBuilder) EncodeLicenseToBytes ¶
func (instance *LicenseBuilder) EncodeLicenseToBytes(license *license_commons.License) (bytes []byte, err error)
func (*LicenseBuilder) EncodeLicenseToText ¶
func (instance *LicenseBuilder) EncodeLicenseToText(license *license_commons.License) (text string, err error)
func (*LicenseBuilder) EncodeToBytes ¶
func (*LicenseBuilder) EncodeToText ¶
func (*LicenseBuilder) NewLicense ¶
func (instance *LicenseBuilder) NewLicense(uid string) (license *license_commons.License)
func (*LicenseBuilder) SaveLicenseToFile ¶
func (instance *LicenseBuilder) SaveLicenseToFile(license *license_commons.License, dir string) (filename string, err error)
func (*LicenseBuilder) SaveLicenseToFileName ¶
func (instance *LicenseBuilder) SaveLicenseToFileName(license *license_commons.License, filename string) (err error)
func (*LicenseBuilder) SaveLicenseToTempFile ¶
func (instance *LicenseBuilder) SaveLicenseToTempFile(license *license_commons.License) (filename string, err error)
func (*LicenseBuilder) SaveToFile ¶
func (*LicenseBuilder) SaveToTempFile ¶
type LicenseClient ¶
type LicenseClient struct { Config *license_commons.LicenseConfig // contains filtered or unexported fields }
func NewLicenseClient ¶
func NewLicenseClient(config *license_commons.LicenseConfig) *LicenseClient
func (*LicenseClient) GetUrl ¶
func (instance *LicenseClient) GetUrl() string
func (*LicenseClient) RequestLicense ¶
func (instance *LicenseClient) RequestLicense(path string) (license *license_commons.License, err error)
type LicenseErrorCallback ¶
type LicenseErrorCallback func(license *license_commons.License, err error)
type LicenseHelper ¶
type LicenseHelper struct { OnFail LicenseErrorCallback // contains filtered or unexported fields }
var License *LicenseHelper
func (*LicenseHelper) AddErrorListener ¶
func (instance *LicenseHelper) AddErrorListener(callback LicenseErrorCallback) *LicenseHelper
func (*LicenseHelper) Builder ¶
func (instance *LicenseHelper) Builder() (*LicenseBuilder, error)
func (*LicenseHelper) Check ¶
func (instance *LicenseHelper) Check() (err error)
func (*LicenseHelper) SetConfigFile ¶
func (instance *LicenseHelper) SetConfigFile(filename string)
func (*LicenseHelper) SetRoot ¶
func (instance *LicenseHelper) SetRoot(root string)
func (*LicenseHelper) SetSecret ¶
func (instance *LicenseHelper) SetSecret(key string)
func (*LicenseHelper) SetTolerance ¶
func (instance *LicenseHelper) SetTolerance(duration time.Duration)
func (*LicenseHelper) Start ¶
func (instance *LicenseHelper) Start(interval time.Duration) (err error)
func (*LicenseHelper) StartWithCallback ¶
func (instance *LicenseHelper) StartWithCallback(interval time.Duration, onFail LicenseErrorCallback) (err error)
type LicenseTicker ¶
type LicenseTicker struct { // ticker interval Interval time.Duration // optional path for license (usually is defined in configuration) LicensePath string // [run only if expired] override default action (send email if expired) ExpiredLicenseHook LicenseTickerCallback // [run always] notify action on license RequestLicenseHook LicenseTickerCallback ErrorLicenseHook LicenseTickerCallback Email *LicenseTickerEmail // count number of time the license expire email was sent CountWarnings int // internal utility data storage Data map[string]interface{} // contains filtered or unexported fields }
func NewLicenseTicker ¶
func NewLicenseTicker(config *license_commons.LicenseConfig) *LicenseTicker
NewLicenseTicker
- Creates new License Ticker.
- @param config
- @param callback Pass is want override default (send email to license owner)
func (*LicenseTicker) IsRunning ¶
func (instance *LicenseTicker) IsRunning() bool
func (*LicenseTicker) Join ¶
func (instance *LicenseTicker) Join()
func (*LicenseTicker) Start ¶
func (instance *LicenseTicker) Start()
func (*LicenseTicker) Stop ¶
func (instance *LicenseTicker) Stop()
type LicenseTickerCallback ¶
type LicenseTickerCallback func(*LicenseTickerContext)
type LicenseTickerContext ¶
type LicenseTickerContext struct { Error error License *license_commons.License Ticker *LicenseTicker }
func NewLicenseTickerContext ¶
func NewLicenseTickerContext() *LicenseTickerContext
func (*LicenseTickerContext) HasError404 ¶
func (instance *LicenseTickerContext) HasError404() bool
type LicenseTickerEmail ¶
type LicenseTickerEmail struct { Enabled bool SmtpHost string // smtp.gmail.com SmtpPort int // 587 SmtpUser string SmtpPassword string From string Subject string Message string Target []string Errors []error // contains filtered or unexported fields }
func (*LicenseTickerEmail) CanSend ¶
func (instance *LicenseTickerEmail) CanSend() bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.