logbase

package module
v0.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 12 Imported by: 0

README

English | Pусский


apisite/logbase

logfiles served via database

GoDoc GoCard GitHub Release GitHub code size in bytes GitHub license

Project status: WIP

License

The MIT License (MIT), see LICENSE.

Copyright (c) 2020 Aleksei Kovrizhkin lekovr+logbase@gmail.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FileBeginProc string `long:"file_begin" default:"logs.file_begin" description:"Before file load func"`
}

type FileConfig

type FileConfig struct {
	ID   int
	Type LogType
	Data []byte
}

FileConfig holds config loaded from DB via key

type LogType

type LogType int
const (
	Nginx LogType = iota + 1
	Pg
	Journal
)

func (LogType) String

func (lt LogType) String() string

type Service

type Service struct {
	Config *Config
	Log    loggers.Contextual
	DB     *pgxpool.Pool
	// contains filtered or unexported fields
}

Service holds service data

func New

func New(cfg Config, log loggers.Contextual, db *pgxpool.Pool) *Service

New creates an LogBase object

func (*Service) Auth

func (srv *Service) Auth(key string) (*FileConfig, error)

func (*Service) LoadFile

func (srv *Service) LoadFile(cfg *FileConfig, path, file, ctype string) (int, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL