github.com/juju/juju@v0.0.0-20240327075706-a90865de2538/worker/caasfirewaller/client.go (about) 1 // Copyright 2017 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package caasfirewaller 5 6 import ( 7 "github.com/juju/juju/api/common/charms" 8 "github.com/juju/juju/core/config" 9 "github.com/juju/juju/core/life" 10 "github.com/juju/juju/core/watcher" 11 ) 12 13 // Client provides an interface for interacting with the 14 // CAASFirewaller API. Subsets of this should be passed 15 // to the CAASFirewaller worker. 16 type Client interface { 17 ApplicationGetter 18 LifeGetter 19 CharmGetter 20 } 21 22 // ApplicationGetter provides an interface for 23 // watching for the lifecycle state changes 24 // (including addition) of applications in the 25 // model, and fetching their details. 26 type ApplicationGetter interface { 27 WatchApplications() (watcher.StringsWatcher, error) 28 WatchApplication(string) (watcher.NotifyWatcher, error) 29 IsExposed(string) (bool, error) 30 ApplicationConfig(string) (config.ConfigAttributes, error) 31 } 32 33 // LifeGetter provides an interface for getting the 34 // lifecycle state value for an application. 35 type LifeGetter interface { 36 Life(string) (life.Value, error) 37 } 38 39 type CharmGetter interface { 40 ApplicationCharmInfo(string) (*charms.CharmInfo, error) 41 }