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(_ context.Context, _ string, _ string, _ int32) (chan log.TimeRangeResponse, error)
- func (s *IndexService) Close(ctx context.Context) error
- func (s *IndexService) DeleteLogs(ctx context.Context, query string) (int64, error)
- func (s *IndexService) ListLogs(ctx context.Context, str string, page int32, size int32) (chan log.ListLogResponse, error)
- func (s *IndexService) PutLog(ctx context.Context, 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(_ context.Context, _ string, _ string, _ int32) (chan log.TimeRangeResponse, error)
AggregatedLogs performs a faceted query in the syslog repository. UNIMPLEMENTED.
func (*IndexService) DeleteLogs ¶
DeleteLogs truncate logs based on a search query
func (*IndexService) ListLogs ¶
func (s *IndexService) ListLogs(ctx context.Context, str string, page int32, 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.
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(context.Context, *log.Log) error ListLogs(context.Context, string, int32, int32) (chan log.ListLogResponse, error) DeleteLogs(context.Context, string) (int64, error) AggregatedLogs(context.Context, string, string, int32) (chan log.TimeRangeResponse, error) Close(context.Context) error Resync(context.Context, log2.ZapLogger) error Truncate(context.Context, int64, 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. |