tiarraview

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 24 Imported by: 0

README

tirraview

tiarraview is a simple viewer for tiarra logs.

Usage

tiarraview

Usage: tiarraview <command> [flags]

Flags:
  -h, --help                            Show context-sensitive help.
      --dbfile="./db/database.sqlite3"

      --schemafile="./db/schema.sql"

Commands:
  server [flags]
    run web view server

  import --src-dir=STRING [flags]
    import log files to database

  init [flags]
    initialize database

Run "tiarraview <command> --help" for more information on a command.
Initialize database
$ tiarraview init

tiarraview initializes sqlite3 database. (default: ./db/database.sqlite3)

Import tiarra logs
$ tiarraview import --src-dir=/path/to/tiarra/logs

tiarraview imports tiarra logs from the specified directory to sqlite3 database.

The directory structure should be like this:

tiarra/log
├── channel_name
│   ├── 2024.10.01.txt
│   ├── 2024.10.02.txt
Start server
$ tiarraview server

tiarraview starts a web server to view tiarra logs. You can access the server at http://localhost:8080.

LICENSE

MIT

Author

Fujiwara Shunichiro

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context) error

Types

type Config

type Config struct {
	DBFile     string `name:"dbfile" default:"./db/database.sqlite3"`
	SchemaFile string `name:"schemafile"`
	Server     struct {
		Addr string `name:"addr" default:":8080" env:"TIARRAVIEW_SERVER_ADDR"`
		Root string `name:"root" default:"" env:"TIARRAVIEW_SERVER_ROOT"`
	} `cmd:"" help:"run web view server"`
	Import struct {
		SrcDir string `name:"src-dir" required:""`
	} `cmd:"" help:"import log files to database"`
	Init struct {
	} `cmd:"" help:"initialize database"`
}

type Template

type Template struct {
	// contains filtered or unexported fields
}

func (*Template) Render

func (t *Template) Render(w io.Writer, name string, data interface{}, c echo.Context) error

type TiarraLog

type TiarraLog struct {
	ID      int    `db:"rowid"`
	Channel string `db:"channel"`
	LogDate string `db:"log_date"`
	Content string `db:"content"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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