core

package
v0.0.0-...-082c416 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnCacheExpireAfterAccessMinutes = 20
	ConnCacheStatsPeriodMinutes       = 5
	ConnRetryAttempts                 = 3
	ConnRetryDelay                    = 500
	ConnTimeoutSec                    = 20
)

todo Move constants to config Zk Connection

View Source
const (
	ZkCacheExpireAfterAccessMinutes = 10
	ZkCacheStatsPeriodMinutes       = 5
	ZkOpRetryAttempts               = 3
	ZkOpRetryDelay                  = 500
)

Zk operations

View Source
const (
	NodeColumn   = 0
	NodeRootName = "/"
	NodeDummy    = "__dummy" // Dummy node to be used as real node children placeholder
)

Nodes tree and repository

View Source
const AppAssetsDir = "./assets"

Variables

View Source
var AclWorldAnyone = goZk.WorldACL(goZk.PermAll)
View Source
var Config = ZooverseerConfig{
	AppId:              "com.github.alivesubstance.zooverseer",
	AppTitle:           "Zooverseer",
	ShowFolderFirst:    true,
	ConnConfigFilePath: AppAssetsDir + "/connections.json",
	GladeFilePath:      AppAssetsDir + "/main.glade",
	CssStyleFilePath:   AppAssetsDir + "/style.css",
	LogoFilePath:       AppAssetsDir + "/logo.png",
	ExportDir:          "./export",
	Log: LogConfig{
		Dir:              "./log",
		Level:            log.TraceLevel,
		FilesHistorySize: 5,
	},
}

Functions

func InitLogger

func InitLogger()

Types

type CompositeWriter

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

func (CompositeWriter) Write

func (cw CompositeWriter) Write(p []byte) (n int, err error)

type ConnInfo

type ConnInfo struct {
	Id       int64
	Name     string /*`json:"name"`*/
	Host     string
	Port     int
	User     string
	Password string
	Type     Type
}

func (*ConnInfo) Copy

func (c *ConnInfo) Copy() *ConnInfo

func (*ConnInfo) String

func (c *ConnInfo) String() string

type ConnRepository

type ConnRepository interface {
	Upsert(connInfo *ConnInfo)
	FindById(id int64) *ConnInfo
	FindByName(name string) *ConnInfo
	FindAll() []*ConnInfo
	Delete(connInfo *ConnInfo)
	SaveAll(connInfos []*ConnInfo)
}

type JsonConnRepository

type JsonConnRepository struct {
	ConnRepository
}

func (*JsonConnRepository) Delete

func (c *JsonConnRepository) Delete(connInfo *ConnInfo)

func (*JsonConnRepository) FindAll

func (c *JsonConnRepository) FindAll() []*ConnInfo

func (*JsonConnRepository) FindById

func (c *JsonConnRepository) FindById(id int64) *ConnInfo

func (*JsonConnRepository) FindByName

func (c *JsonConnRepository) FindByName(name string) *ConnInfo

func (*JsonConnRepository) SaveAll

func (c *JsonConnRepository) SaveAll(connInfos []*ConnInfo)

func (*JsonConnRepository) Upsert

func (c *JsonConnRepository) Upsert(connInfo *ConnInfo)

type LogConfig

type LogConfig struct {
	Dir              string
	Level            log.Level
	FilesHistorySize int
}

type PlainFormatter

type PlainFormatter struct{}

func (*PlainFormatter) Format

func (f *PlainFormatter) Format(entry *log.Entry) ([]byte, error)

type Type

type Type string
const (
	ConnManual    Type = "manual"
	ConnGenerated Type = "generated"
)

type ZooverseerConfig

type ZooverseerConfig struct {
	ShowFolderFirst    bool
	ExportDir          string
	AppId              string
	AppTitle           string
	GladeFilePath      string
	ConnConfigFilePath string
	CssStyleFilePath   string
	LogoFilePath       string
	Log                LogConfig
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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