share action skeletons (#276)

This commit is contained in:
Michael Quigley
2023-03-27 11:34:29 -04:00
parent fdc5154873
commit 662693c2c9
4 changed files with 80 additions and 9 deletions

View File

@ -32,15 +32,23 @@ type Agent struct {
}
func NewAgent(cfg *Config, ifxCfg *metrics.InfluxConfig, zCfg *zrokEdgeSdk.Config, str *store.Store) (*Agent, error) {
return &Agent{
cfg: cfg,
ifx: newInfluxReader(ifxCfg),
zCfg: zCfg,
str: str,
queue: make(chan *metrics.Usage, 1024),
close: make(chan struct{}),
join: make(chan struct{}),
}, nil
edge, err := zrokEdgeSdk.Client(zCfg)
if err != nil {
return nil, err
}
a := &Agent{
cfg: cfg,
ifx: newInfluxReader(ifxCfg),
zCfg: zCfg,
str: str,
queue: make(chan *metrics.Usage, 1024),
shrWarningEnforce: []ShareAction{newShareWarningAction(str, edge)},
shrLimitEnforce: []ShareAction{newShareLimitAction(str, edge)},
shrLimitRelax: []ShareAction{newShareRelaxAction(str, edge)},
close: make(chan struct{}),
join: make(chan struct{}),
}
return a, nil
}
func (a *Agent) Start() {