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: 9 modules, 144 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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