Documentation
¶
Index ¶
Constants ¶
View Source
const ( // name of the file which stores the source credentials CredentialsFile = "credentials.json" // name of the file which stores the current inventory InventoryFile = "inventory.json" // DefaultUpdateInterval is the default interval between two status updates DefaultUpdateInterval = time.Duration(60 * time.Second) // DefaultConfigDir is the default directory where the device's configuration is stored DefaultConfigDir = "/etc/planner" // DefaultConfigFile is the default path to the agent's configuration file DefaultConfigFile = DefaultConfigDir + "/config.yaml" // DefaultDataDir is the default directory where the agent's data is stored DefaultDataDir = ".migration-planner/data" // DefaultPersistentDataDir is the default directory where the agent's data is stored DefaultPersistentDataDir = ".migration-planner/persistent-data" // DefaultWwwDir is the default directory from which the agent serves static files DefaultWwwDir = "/app/www" // DefaultOpaPoliciesDir is the default directory where the OPA policies are stored DefaultOpaPoliciesDir = "./policies" // DefaultPlannerEndpoint is the default address of the migration planner server DefaultPlannerEndpoint = "https://localhost:7443" // DefaultHealthCheck is the default value for health check interval in seconds. // default value set 10s health check should be faster than the update period in order to block it // if the console is unreachable DefaultHealthCheck = 10 )
Variables ¶
View Source
var (
DefaultSourceId = uuid.Nil.String()
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// ConfigDir is the directory where the agent's configuration is stored
ConfigDir string `json:"config-dir"`
// DataDir is the directory where the agent's data is stored
DataDir string `json:"data-dir"`
// PersistentDataDir is the directory where persistent data is stored
PersistentDataDir string `json:"persistent-data-dir"`
// WwwDir is the directory from which the agent serves static files
WwwDir string `json:"www-dir"`
// OpaPoliciesDir is the path to the directory containing OPA policy files
OpaPoliciesDir string `json:"policies-dir"`
// SourceID is the ID of this source in the planner
SourceID string `json:"source-id"`
// PlannerService is the client configuration for connecting to the migration planner server
PlannerService PlannerService `json:"planner-service,omitempty"`
// UpdateInterval is the interval between two status updates
UpdateInterval util.Duration `json:"update-interval,omitempty"`
// LogLevel is the level of logging. can be: "panic", "fatal", "error", "warn"/"warning",
// "info", "debug" or "trace", any other will be treated as "info"
LogLevel string `json:"log-level,omitempty"`
// LogPrefix is the log prefix used for testing
LogPrefix string `json:"log-prefix,omitempty"`
// contains filtered or unexported fields
}
func NewDefault ¶
func NewDefault() *Config
func (*Config) CreateDefaultDirs ¶
func (*Config) ParseConfigFile ¶
ParseConfigFile reads the config file and unmarshals it into the Config struct
type Credentials ¶
type PlannerService ¶
func (*PlannerService) Equal ¶
func (s *PlannerService) Equal(s2 *PlannerService) bool
Click to show internal directories.
Click to hide internal directories.