Documentation
¶
Overview ¶
Package tool implements the admin tool subdomain of the platform module: the system log tail, the version, IP geolocation and the process restart. Only the module facade may reach it.
Index ¶
- type Deps
- type Service
- func (s *Service) GetSystemLog(ctx context.Context) (*dto.LogResponse, error)
- func (s *Service) GetVersion(_ context.Context) (*dto.VersionResponse, error)
- func (s *Service) QueryIPLocation(ctx context.Context, req *dto.QueryIPLocationRequest) (*dto.QueryIPLocationResponse, error)
- func (s *Service) RestartSystem(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
// LogPath is the logger output file read by the system-log tail.
LogPath string
// GeoIP returns the GeoIP database reader; nil (or a nil result) means
// no database is configured.
GeoIP func() *geoip2.Reader
// Restart restarts the transport server.
Restart func() error
}
Deps declares the subdomain's dependencies; the module facade forwards them from the composition root.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the tool entry point used by the platform facade.
func (*Service) GetSystemLog ¶
GetSystemLog returns the latest system log entries, newest first. A line that is not a JSON entry is skipped, but a tail in which no line is one is an error: the log is not written in the format the tail shows.
func (*Service) GetVersion ¶
GetVersion reports the version the server was built as.
func (*Service) QueryIPLocation ¶
func (s *Service) QueryIPLocation(ctx context.Context, req *dto.QueryIPLocationRequest) (*dto.QueryIPLocationResponse, error)
QueryIPLocation looks an IP address up in the local GeoIP database.