Documentation ¶
Index ¶
- func StartServer(ctx context.Context, config Config) error
- type Config
- type DailyTriggerServer
- type DataLifeCycleConfig
- type Server
- func (server *Server) Purge(ctx context.Context, request *api.PurgeRequest) (*api.PurgeResponse, error)
- func (server *Server) TriggerPurge(ctx context.Context, request *api.TriggerPurgeRequest) (*api.TriggerPurgeResponse, error)
- func (server *Server) Version(ctx context.Context, request *api.VersionRequest) (*api.VersionResponse, error)
- type ValidatedTimeOfDay
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { ListenAddress string `toml:"listen_address"` Port uint16 `toml:"port"` LogLevel string `toml:"log_level"` DailyRunAt *ValidatedTimeOfDay `toml:"daily_run_at"` ManagedServices map[string]storage.ServiceConfig `toml:"managed"` DataLifeCycleInfo *DataLifeCycleConfig `toml:"data-lifecycle"` certs.TLSConfig `toml:"tls"` }
Config describes the configuration for the Data Lifecycle Service
func ConfigFromToml ¶
ConfigFromToml loads a configuration file from a toml file
type DailyTriggerServer ¶
type DailyTriggerServer struct {
// contains filtered or unexported fields
}
DailyTriggerServer is a server that runs Data Lifecycle methods once a day
func NewDailyTriggerServer ¶
func NewDailyTriggerServer(dls *Server, atTimeUtc *ValidatedTimeOfDay) *DailyTriggerServer
NewDailyTriggerServer returns a DailyTriggerServer that runs at atTimeUtc daily
type DataLifeCycleConfig ¶
type DataLifeCycleConfig struct { // PurgeOlderThanDays describes how long we keep time series data. Anything // older than this is allowed to be regularly removed. PurgeOlderThanDays int32 `toml:"purge_older_than_days"` }
DataLifeCycleConfig describes the configuration needed to manage this services data
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the Data Lifecycle Server. It is responsible for calling data lifecycle manageable methods such as Purge on other services (and itself).
func NewServer ¶
func NewServer(version string, serviceConfigStore storage.ServiceConfigStore, dataLifecycleConfig *DataLifeCycleConfig, connFactory *secureconn.Factory) *Server
NewServer returns a new Data Lifecycle Server
func (*Server) Purge ¶
func (server *Server) Purge(ctx context.Context, request *api.PurgeRequest) (*api.PurgeResponse, error)
Purge returns success as there is no stored data for this service yet.
func (*Server) TriggerPurge ¶
func (server *Server) TriggerPurge(ctx context.Context, request *api.TriggerPurgeRequest) (*api.TriggerPurgeResponse, error)
TriggerPurge triggers a purge to happen on configured services
func (*Server) Version ¶
func (server *Server) Version(ctx context.Context, request *api.VersionRequest) (*api.VersionResponse, error)
Version returns the Version of the Data Lifecycle Service
type ValidatedTimeOfDay ¶
type ValidatedTimeOfDay struct {
// contains filtered or unexported fields
}
ValidatedTimeOfDay time is a valid time of day
func DefaultTimeOfDay ¶
func DefaultTimeOfDay() *ValidatedTimeOfDay
DefaultTimeOfDay returns a ValidatedTimeOfDay with midnight
func (*ValidatedTimeOfDay) UnmarshalText ¶
func (tod *ValidatedTimeOfDay) UnmarshalText(text []byte) error
UnmarshalText unmarshals a text in the format hh:mm:ss to a ValidatedTimeOfDay. Hour must be less than 24 and greater than 0 Min must be less then 60 and greater than 0 Sec must be less than 60 and greater than 0 Failing any of the above validation criteria returns an error