Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
sla, meter-status: Added sla and meter status to model description #5
Merged
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
Jump to file or symbol
Failed to load files and symbols.
| @@ -0,0 +1,27 @@ | ||
| +// Copyright 2017 Canonical Ltd. | ||
| +// Licensed under the LGPLv3, see LICENCE file for details. | ||
| + | ||
| +package description | ||
| + | ||
| +// MeterStatus represents the meter status of the model. | ||
| +type MeterStatus interface { | ||
| + // Code returns the traffic light colour code of meter status. | ||
| + Code() string | ||
| + // Info returns extra information corresponding to the traffic light colour. | ||
| + Info() string | ||
| +} | ||
| + | ||
| +type meterStatus struct { | ||
| + Code_ string `yaml:"code"` | ||
| + Info_ string `yaml:"info"` | ||
| +} | ||
| + | ||
| +// Code returns the traffic light colour code of meter status. | ||
| +func (m meterStatus) Code() string { | ||
| + return m.Code_ | ||
| +} | ||
| + | ||
| +// Info returns extra information corresponding to the traffic light colour. | ||
| +func (m meterStatus) Info() string { | ||
| + return m.Info_ | ||
| +} |
| @@ -0,0 +1,27 @@ | ||
| +// Copyright 2017 Canonical Ltd. | ||
| +// Licensed under the LGPLv3, see LICENCE file for details. | ||
| + | ||
| +package description | ||
| + | ||
| +// SLA represents the sla for the model. | ||
| +type SLA interface { | ||
| + // Level returns the level of the sla. | ||
| + Level() string | ||
| + // Credentials returns the credentials of the sla. | ||
| + Credentials() string | ||
| +} | ||
| + | ||
| +type sla struct { | ||
| + Level_ string `yaml:"level"` | ||
| + Credentials_ string `yaml:"credentials"` | ||
| +} | ||
| + | ||
| +// Level returns the level of the sla. | ||
| +func (s sla) Level() string { | ||
| + return s.Level_ | ||
| +} | ||
| + | ||
| +// Credentials returns the Credentials of the sla. | ||
| +func (s sla) Credentials() string { | ||
| + return s.Credentials_ | ||
| +} |