infra

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package infra defines dnote structure

Index

Constants

This section is empty.

Variables

View Source
var (
	// DnoteDirName is the name of the directory containing dnote files
	DnoteDirName = ".dnote"

	// SystemSchema is the key for schema in the system table
	SystemSchema = "schema"
	// SystemRemoteSchema is the key for remote schema in the system table
	SystemRemoteSchema = "remote_schema"
	// SystemLastSyncAt is the timestamp of the server at the last sync
	SystemLastSyncAt = "last_sync_time"
	// SystemLastMaxUSN is the user's max_usn from the server at the alst sync
	SystemLastMaxUSN = "last_max_usn"
	// SystemLastUpgrade is the timestamp at which the system more recently checked for an upgrade
	SystemLastUpgrade = "last_upgrade"
)

Functions

func InitDB added in v0.4.5

func InitDB(ctx DnoteCtx) error

InitDB initializes the database. Ideally this process must be a part of migration sequence. But it is performed seaprately because it is a prerequisite for legacy migration.

Types

type Config

type Config struct {
	Editor string
	APIKey string
}

Config holds dnote configuration

type DnoteCtx

type DnoteCtx struct {
	HomeDir     string
	DnoteDir    string
	APIEndpoint string
	Version     string
	DB          *sql.DB
}

DnoteCtx is a context holding the information of the current runtime

func NewCtx added in v0.4.5

func NewCtx(apiEndpoint, versionTag string) (DnoteCtx, error)

NewCtx returns a new dnote context

Jump to

Keyboard shortcuts

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