Documentation ¶
Overview ¶
Package log provides a persistence layer for json-formatted logs generated by the application.
It is intended to provide an out-of-the-box solution for storing and querying the logs, but should be replaced by more scalable solutions like ELK.
Index ¶
- func Migrate(f, t dao.DAO, dryRun bool, status chan dao.MigratorStatus) (map[string]int, error)
- func NewDAO(ctx context.Context, d dao.DAO) (dao.DAO, error)
- type BleveCodec
- func (b *BleveCodec) BuildQuery(qu interface{}, offset, limit int32) (interface{}, interface{}, error)
- func (b *BleveCodec) GetModel(_ configx.Values) (interface{}, bool)
- func (b *BleveCodec) Marshal(input interface{}) (interface{}, error)
- func (b *BleveCodec) Unmarshal(indexed interface{}) (interface{}, error)
- type IndexService
- func (s *IndexService) AggregatedLogs(_ string, _ string, _ int32) (chan log.TimeRangeResponse, error)
- func (s *IndexService) Close(ctx context.Context) error
- func (s *IndexService) DeleteLogs(query string) (int64, error)
- func (s *IndexService) ListLogs(str string, page, size int32) (chan log.ListLogResponse, error)
- func (s *IndexService) PutLog(line *log.Log) error
- func (s *IndexService) Resync(ctx context.Context, logger log2.ZapLogger) error
- func (s *IndexService) Truncate(ctx context.Context, max int64, logger log2.ZapLogger) error
- type IndexableLog
- type MessageRepository
- type MongoCodec
- func (m *MongoCodec) BuildQuery(query interface{}, offset, limit int32) (interface{}, interface{}, error)
- func (m *MongoCodec) BuildQueryOptions(query interface{}, offset, limit int32) (interface{}, error)
- func (m *MongoCodec) GetModel(sc configx.Values) (interface{}, bool)
- func (b *MongoCodec) Marshal(input interface{}) (interface{}, error)
- func (m *MongoCodec) Unmarshal(indexed interface{}) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BleveCodec ¶
type BleveCodec struct {
// contains filtered or unexported fields
}
func (*BleveCodec) BuildQuery ¶
func (b *BleveCodec) BuildQuery(qu interface{}, offset, limit int32) (interface{}, interface{}, error)
func (*BleveCodec) Unmarshal ¶
func (b *BleveCodec) Unmarshal(indexed interface{}) (interface{}, error)
type IndexService ¶
type IndexService struct {
// contains filtered or unexported fields
}
func (*IndexService) AggregatedLogs ¶
func (s *IndexService) AggregatedLogs(_ string, _ string, _ int32) (chan log.TimeRangeResponse, error)
AggregatedLogs performs a faceted query in the syslog repository. UNIMPLEMENTED.
func (*IndexService) DeleteLogs ¶
func (s *IndexService) DeleteLogs(query string) (int64, error)
DeleteLogs truncate logs based on a search query
func (*IndexService) ListLogs ¶
func (s *IndexService) ListLogs(str string, page, size int32) (chan log.ListLogResponse, error)
ListLogs performs a query in the bleve index, based on the passed query string. It returns results as a stream of log.ListLogResponse for each corresponding hit. Results are ordered by descending timestamp rather than by score.
func (*IndexService) PutLog ¶
func (s *IndexService) PutLog(line *log.Log) error
PutLog adds a new LogMessage in the syslog index.
type IndexableLog ¶
type IndexableLog struct { Nano int `bson:"nano"` *log.LogMessage `bson:"inline"` }
IndexableLog extends default log.LogMessage struct to add index specific methods
func (*IndexableLog) BleveType ¶
func (*IndexableLog) BleveType() string
BleveType is interpreted by bleve indexer as the mapping name
type MessageRepository ¶
type MessageRepository interface { PutLog(log2 *log.Log) error ListLogs(string, int32, int32) (chan log.ListLogResponse, error) DeleteLogs(string) (int64, error) AggregatedLogs(string, string, int32) (chan log.TimeRangeResponse, error) Close(ctx context.Context) error Resync(ctx context.Context, logger log2.ZapLogger) error Truncate(ctx context.Context, max int64, logger log2.ZapLogger) error }
MessageRepository exposes interface methods to manage the log messages provided by Pydio.
func NewIndexService ¶
func NewIndexService(dao dao.IndexDAO) (MessageRepository, error)
type MongoCodec ¶
type MongoCodec struct {
// contains filtered or unexported fields
}
func (*MongoCodec) BuildQuery ¶
func (m *MongoCodec) BuildQuery(query interface{}, offset, limit int32) (interface{}, interface{}, error)
func (*MongoCodec) BuildQueryOptions ¶
func (m *MongoCodec) BuildQueryOptions(query interface{}, offset, limit int32) (interface{}, error)
func (*MongoCodec) Unmarshal ¶
func (m *MongoCodec) Unmarshal(indexed interface{}) (interface{}, error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package grpc provides a Pydio GRPC service for querying the logs
|
Package grpc provides a Pydio GRPC service for querying the logs |
Package rest exposes a simple REST API for communicating with the GRPC package.
|
Package rest exposes a simple REST API for communicating with the GRPC package. |