Documentation ¶
Index ¶
Constants ¶
const ( // DefaultPollingPeriod is the period at which the license agent will poll for license updates by default. DefaultPollingPeriod = time.Hour * 12 // DefaultInitialPollingPeriod is the period at which the license agent will poll for a license until it retrieves // one. DefaultInitialPollingPeriod = time.Minute // PollingTimeout is the timeout for retrieving a license from upstream. PollingTimeout = time.Minute * 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent handles retrieving a Kong license and providing it to other KIC subsystems.
func NewAgent ¶
func NewAgent( konnectLicenseClient KonnectLicenseClient, logger logr.Logger, opts ...AgentOpt, ) *Agent
NewAgent creates a new license agent that retrieves a license from the given url once every given period.
func (*Agent) GetLicense ¶
GetLicense returns the agent's current license as a go-kong License struct. It omits the origin timestamps, as Kong will auto-populate these when adding the license to its config database. It's optional because we may not have retrieved a license yet.
func (*Agent) NeedLeaderElection ¶
NeedLeaderElection indicates if the Agent requires leadership to run. It always returns true.
type AgentOpt ¶ added in v2.10.1
type AgentOpt func(*Agent)
func WithInitialPollingPeriod ¶ added in v2.10.1
WithInitialPollingPeriod sets the initial polling period for the license agent.
func WithPollingPeriod ¶ added in v2.10.1
WithPollingPeriod sets the regular polling period for the license agent.
func WithTicker ¶ added in v2.10.3
WithTicker sets the ticker in Agent. This is useful for testing. Ticker doesn't define the period, it defines the implementation of ticking.
type KonnectLicense ¶ added in v2.10.1
KonnectLicense is a license retrieved from Konnect.