common

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: AGPL-3.0 Imports: 43 Imported by: 1

README

dbhub-common

Golang code in common between the various DBHub projects

Documentation

Overview

These functions extract (and validate) user provided form data.

Useful utility functions

Index

Constants

View Source
const (
	ACTION_ADD    DiffType = "add"
	ACTION_DELETE          = "delete"
	ACTION_MODIFY          = "modify"
)
View Source
const (
	TODAY      ActivityRange = "today"
	THIS_WEEK                = "week"
	THIS_MONTH               = "month"
	ALL_TIME                 = "all"
)
View Source
const (
	TREE     DBTreeEntryType = "tree"
	DATABASE                 = "db"
	LICENCE                  = "licence"
)
View Source
const (
	TEXT   DiscussionCommentType = "txt"
	CLOSE                        = "cls"
	REOPEN                       = "rop"
)
View Source
const (
	EVENT_NEW_DISCUSSION    EventType = 0 // These are not iota, as it would be seriously bad for these numbers to change
	EVENT_NEW_MERGE_REQUEST           = 1
	EVENT_NEW_COMMENT                 = 2
	EVENT_NEW_RELEASE                 = 3
)
View Source
const (
	OPEN                 MergeRequestState = 0 // These are not iota, as it would be seriously bad for these numbers to change
	CLOSED_WITH_MERGE                      = 1
	CLOSED_WITHOUT_MERGE                   = 2
)
View Source
const DefaultNumDisplayRows = 25

Number of rows to display by default on the database page

View Source
const MaxDatabaseSize = 512

The maximum database size accepted for upload (in MB)

View Source
const MaxLicenceSize = 1

The maximum licence size accepted for upload (in MB)

View Source
const MinioFolderChars = 6

The number of leading characters of a files' sha256 used as the Minio folder name eg: When set to 6, then "34f4255a737156147fbd0a44323a895d18ade79d4db521564d1b0dbb8764cbbc"

-> Minio folder: "34f425"
-> Minio filename: "5a737156147fbd0a44323a895d18ade79d4db521564d1b0dbb8764cbbc"

Variables

View Source
var SQLiteFunctions = []function{
	fnAbs,
	fnChanges,
	fnChar,
	fnCoalesce,
	fnGlob,
	fnHex,
	fnIfNull,
	fnInstr,
	fnLastInsertRowID,
	fnLength,
	fnLike,
	fnLikelihood,
	fnLikely,
	fnLower,
	fnLTrim,
	fnMax,
	fnMin,
	fnNullIf,
	fnPrintF,
	fnQuot,
	fnRandom,
	fnRandomBlob,
	fnReplace,
	fnRound,
	fnRTrim,
	fnSoundEx,
	fnSQLiteCompileOptionGet,
	fnSQLiteCompileOptionUsed,
	fnSQLiteOffset,
	fnSQLiteSourceID,
	fnSQLiteVersion,
	fnSubstr,
	fnTotalChanges,
	fnTrim,
	fnTypeOf,
	fnUnlikely,
	fnUpper,
	fnZeroBlob,
	fnDate,
	fnTime,
	fnDateTime,
	fnJulianDay,
	fnStrfTime,
	fnAvg,
	fnCount,
	fnGroupConcat,
	fnSum,
	fnTotal,
	fnRowNumber,
	fnRank,
	fnDenseRank,
	fnPercentRank,
	fnCumeDist,
	fnNTile,
	fnLag,
	fnLead,
	fnFirstValue,
	fnLastValue,
	fnNthValue,
	fnJson,
	fnJsonArray,
	fnJsonArrayLength,
	fnJsonExtract,
	fnJsonInsert,
	fnJsonObject,
	fnJsonPatch,
	fnJsonRemove,
	fnJsonReplace,
	fnJsonSet,
	fnJsonType,
	fnJsonValid,
	fnJsonQuote,
	fnJsonGroupArray,
	fnJsonGroupObject,
	fnJsonEach,
	fnJsonTree,
	fnVersion,
}
View Source
var (

	// For input validation
	Validate *valid.Validate
)

Functions

func APIKeySave added in v0.0.6

func APIKeySave(key string, loggedInUser string, dateCreated time.Time) error

Saves a new API key to the PostgreSQL database.

func AddDatabase

func AddDatabase(r *http.Request, loggedInUser string, dbOwner string, dbFolder string, dbName string,
	createBranch bool, branchName string, commitID string, public bool, licenceName string, commitMsg string,
	sourceURL string, newDB io.Reader, serverSw string, lastModified time.Time, commitTime time.Time,
	authorName string, authorEmail string, committerName string, committerEmail string, otherParents []string,
	dbSha string) (numBytes int64, newCommitID string, err error)

The main function which handles database upload processing for both the webUI and DB4S end points

func AddDefaultLicences

func AddDefaultLicences() (err error)

Add the default licences

func AddDefaultUser

func AddDefaultUser() error

Add the default user to the system, used so the referential integrity of licence user_id 0 works.

func AddUser

func AddUser(auth0ID string, userName string, password string, email string, displayName string, avatarURL string) error

Add a user to the system.

func AuthorizerSelect added in v0.0.6

func AuthorizerSelect(d interface{}, action sqlite.Action, tableName, funcName, dbName, triggerName string) sqlite.Auth

AuthorizerSelect is a SQLite authorizer callback which only allows SELECT queries and their needed sub-operations to run.

func CacheData

func CacheData(cacheKey string, cacheData interface{}, cacheSeconds int) error

Caches data in Memcached

func CheckDBExists

func CheckDBExists(loggedInUser string, dbOwner string, dbFolder string, dbName string) (bool, error)

Check if a database exists If an error occurred, the true/false value should be ignored, as only the error value is valid.

func CheckDBID

func CheckDBID(loggedInUser string, dbOwner string, dbID int64) (avail bool, dbFolder string, dbName string, err error)

Check if a given database ID is available, and return it's folder/name so the caller can determine if it has been renamed. If an error occurs, the true/false value should be ignored, as only the error value is valid.

func CheckDBStarred

func CheckDBStarred(loggedInUser string, dbOwner string, dbFolder string, dbName string) (bool, error)

Check if a database has been starred by a given user. The boolean return value is only valid when err is nil.

func CheckDBWatched

func CheckDBWatched(loggedInUser string, dbOwner string, dbFolder string, dbName string) (bool, error)

Check if a database is being watched by a given user. The boolean return value is only valid when err is nil.

func CheckEmailExists

func CheckEmailExists(email string) (bool, error)

Check if an email address already exists in our system. Returns true if the email is already in the system, false if not. If an error occurred, the true/false value should be ignored, as only the error value is valid.

func CheckLicenceExists added in v0.0.5

func CheckLicenceExists(userName string, licenceName string) (exists bool, err error)

Checks if a licence exists in our system.

func CheckUnicode added in v0.0.6

func CheckUnicode(rawInput string) (str string, err error)

Checks if a given string is unicode, and safe for using in SQLite queries (eg no SQLite control characters)

func CheckUserExists

func CheckUserExists(userName string) (bool, error)

Check if a username already exists in our system. Returns true if the username is already taken, false if not. If an error occurred, the true/false value should be ignored, and only the error return code used.

func ClientCert

func ClientCert(userName string) ([]byte, error)

Returns the certificate for a given user.

func CommitLicenceSHA

func CommitLicenceSHA(dbOwner string, dbFolder string, dbName string, commitID string) (licenceSHA string, err error)

Returns the licence used by the database in a given commit

func ConnectCache

func ConnectCache() error

func ConnectMinio

func ConnectMinio() (err error)

Parse the Minio configuration, to ensure it seems workable. Note - this doesn't actually open a connection to the Minio server.

func ConnectPostgreSQL

func ConnectPostgreSQL() (err error)

Creates a connection pool to the PostgreSQL server.

func CreateCommitID

func CreateCommitID(c CommitEntry) string

Generate a stable SHA256 for a commit.

func CreateDBTreeID

func CreateDBTreeID(entries []DBTreeEntry) string

Generate the SHA256 for a tree. Tree entry structure is: * [ entry type ] [ licence sha256] [ file sha256 ] [ file name ] [ last modified (timestamp) ] [ file size (bytes) ]

func DBDetails

func DBDetails(DB *SQLiteDBinfo, loggedInUser string, dbOwner string, dbFolder string, dbName string, commitID string) error

Retrieve the details for a specific database

func DBStars

func DBStars(dbOwner string, dbFolder string, dbName string) (starCount int, err error)

Returns the star count for a given database.

func DBWatchers

func DBWatchers(dbOwner string, dbFolder string, dbName string) (watcherCount int, err error)

Returns the watchers count for a given database.

func DefaultCommit

func DefaultCommit(dbOwner string, dbFolder string, dbName string) (string, error)

Retrieve the default commit ID for a specific database

func DeleteBranchHistory

func DeleteBranchHistory(dbOwner string, dbFolder string, dbName string, branchName string, commitID string) (isolatedTags []string, isolatedRels []string, err error)

Safely removes the commit history for a branch, from the head of the branch back to (but not including) the specified commit. The new branch head will be at the commit ID specified

func DeleteComment

func DeleteComment(dbOwner string, dbFolder string, dbName string, discID int, comID int) error

Delete a specific comment from a discussion

func DeleteDatabase

func DeleteDatabase(dbOwner string, dbFolder string, dbName string) error

Deletes a database from PostgreSQL.

func DeleteLicence added in v0.0.5

func DeleteLicence(userName string, licenceName string) (err error)

Removes a (user supplied) database licence from the system.

func DisconnectPostgreSQL

func DisconnectPostgreSQL()

Disconnects the PostgreSQL database connection.

func EscapeId added in v0.0.6

func EscapeId(id string) string

Escape an identifier for safe use in SQL queries

func EscapeValue added in v0.0.6

func EscapeValue(val DataValue) string

Format and escape a string value for use in SQL queries

func FlushViewCount

func FlushViewCount()

Periodically flushes the database view count from memcache to PostgreSQL

func ForkDatabase

func ForkDatabase(srcOwner string, dbFolder string, dbName string, dstOwner string) (newForkCount int, err error)

Fork the PostgreSQL entry for a SQLite database from one user to another

func ForkParent

func ForkParent(loggedInUser string, dbOwner string, dbFolder string, dbName string) (parentOwner string,
	parentFolder string, parentDBName string, err error)

Return the parent of a database, if there is one (and it's accessible to the logged in user). If no parent was found, the returned Owner/Folder/DBName values will be empty strings

func ForkedFrom

func ForkedFrom(dbOwner string, dbFolder string, dbName string) (forkOwn string, forkFol string, forkDB string,
	forkDel bool, err error)

Checks if the given database was forked from another, and if so returns that one's owner, folder and database name

func GenerateClientCert

func GenerateClientCert(userName string) (_ []byte, err error)

func GetAPIKeyUser added in v0.0.6

func GetAPIKeyUser(key string) (user string, err error)

Returns the owner of a given API key. Returns an empty string if the key has no known owner.

func GetBranches

func GetBranches(dbOwner string, dbFolder string, dbName string) (branches map[string]BranchEntry, err error)

Load the branch heads for a database. TODO: It might be better to have the default branch name be returned as part of this list, by indicating in the list TODO which of the branches is the default.

func GetCachedData

func GetCachedData(cacheKey string, cacheData interface{}) (bool, error)

Retrieves cached data from Memcached

func GetCommitList

func GetCommitList(dbOwner string, dbFolder string, dbName string) (map[string]CommitEntry, error)

Retrieves the full commit list for a database.

func GetCurrentFunctionName

func GetCurrentFunctionName() (FuncName string)

Returns the name of the function this was called from

func GetDatabase

func GetDatabase(r *http.Request, allowGet bool) (string, error)

Extracts a database name from GET or POST/PUT data.

func GetDefaultBranchName

func GetDefaultBranchName(dbOwner string, dbFolder string, dbName string) (branchName string, err error)

Returns the default branch name for a database.

func GetDefaultTableName

func GetDefaultTableName(dbOwner string, dbFolder string, dbName string) (tableName string, err error)

Returns the default table name for a database.

func GetDiscussionAndMRCount

func GetDiscussionAndMRCount(dbOwner string, dbFolder string, dbName string) (discCount int, mrCount int, err error)

Returns the discussion and merge request counts for a database TODO: The only reason this function exists atm, is because we're incorrectly caching the discussion and MR data in TODO a way that makes invalidating it correctly hard/impossible. We should redo our memcached approach to solve the TODO issue properly

func GetFolder

func GetFolder(r *http.Request, allowGet bool) (string, error)

Returns the folder name (if any) present in GET or POST/PUT data.

func GetFormBranch

func GetFormBranch(r *http.Request) (string, error)

Return the requested branch name, from get or post data.

func GetFormCommit

func GetFormCommit(r *http.Request) (string, error)

Return the requested database commit, from form data.

func GetFormLicence

func GetFormLicence(r *http.Request) (licenceName string, err error)

Returns the licence name (if any) present in the form data

func GetFormODC added in v0.0.6

func GetFormODC(r *http.Request) (string, string, string, error)

Return the database owner, database name, and commit (if any) present in the form data.

func GetFormOwner added in v0.0.6

func GetFormOwner(r *http.Request, allowGet bool) (string, error)

Return the database owner present in the GET or POST/PUT data.

func GetFormRelease

func GetFormRelease(r *http.Request) (release string, err error)

Return the requested release name, from get or post data.

func GetFormSourceURL

func GetFormSourceURL(r *http.Request) (sourceURL string, err error)

Returns the source URL (if any) present in the form data

func GetFormTable added in v0.0.6

func GetFormTable(r *http.Request, allowGet bool) (string, error)

Return the table name present in the GET or POST/PUT data.

func GetFormTag

func GetFormTag(r *http.Request) (tag string, err error)

Return the requested tag name, from get or post data.

func GetFormUDC

func GetFormUDC(r *http.Request) (string, string, string, error)

Return the username, database, and commit (if any) present in the form data.

func GetLicence

func GetLicence(userName string, licenceName string) (txt string, format string, err error)

Returns the text for a given licence.

func GetLicenceInfoFromSha256

func GetLicenceInfoFromSha256(userName string, sha256 string) (lName string, lURL string, err error)

Returns the friendly name + licence URL for the licence matching a given sha256. Note - When user defined licence has the same sha256 as a default one we return the user defined licences' friendly name.

func GetLicenceSha256FromName

func GetLicenceSha256FromName(userName string, licenceName string) (sha256 string, err error)

Returns the sha256 for a given licence.

func GetLicences

func GetLicences(user string) (map[string]LicenceEntry, error)

Returns the list of licences available to a user.

func GetOD

func GetOD(ignore_leading int, r *http.Request) (string, string, error)

Returns the requested database owner and database name.

func GetODC

func GetODC(ignore_leading int, r *http.Request) (string, string, string, error)

Returns the requested database owner, database name, and commit revision.

func GetODT

func GetODT(ignore_leading int, r *http.Request) (string, string, string, error)

Returns the requested database owner, database name, and table name.

func GetODTC

func GetODTC(ignore_leading int, r *http.Request) (string, string, string, string, error)

Returns the requested database owner, database name, table name, and commit string.

func GetPrimaryKeyColumns added in v0.0.6

func GetPrimaryKeyColumns(sdb *sqlite.Conn, schema string, table string) (pks []string, err error)

Figure out the primary key columns of a table. The schema and table parameters specify the schema and table names to use.

func GetPub

func GetPub(r *http.Request) (bool, error)

Returns the requested "public" variable, if present in the form data. If something goes wrong, it defaults to "false".

func GetReleases

func GetReleases(dbOwner string, dbFolder string, dbName string) (releases map[string]ReleaseEntry, err error)

Retrieve the list of releases for a database.

func GetSQLiteRowCount

func GetSQLiteRowCount(sdb *sqlite.Conn, dbTable string) (int, error)

GetSQLiteRowCount returns the number of rows in a SQLite table.

func GetTable

func GetTable(r *http.Request) (string, error)

Returns the requested table name (if any).

func GetTags

func GetTags(dbOwner string, dbFolder string, dbName string) (tags map[string]TagEntry, err error)

Retrieve the tags for a database.

func GetUFD

func GetUFD(r *http.Request, allowGet bool) (string, string, string, error)

Return the username, folder, and database name (if any) present in the form data.

func GetUsername

func GetUsername(r *http.Request, allowGet bool) (string, error)

Return the username (if any) present in the GET or POST/PUT data.

func GetUsernameFromEmail

func GetUsernameFromEmail(email string) (userName string, avatarURL string, err error)

Returns the username associated with an email address.

func GetViewCount

func GetViewCount(dbOwner string, dbFolder string, dbName string) (count int, err error)

Retrieves the view count in memcached for a database

func GetVisualisations added in v0.0.6

func GetVisualisations(dbOwner, dbFolder, dbName string) (visNames []string, err error)

Returns the list of saved visualisations for a given database

func IncrementDownloadCount

func IncrementDownloadCount(dbOwner string, dbFolder string, dbName string) error

Increments the download count for a database

func IncrementViewCount

func IncrementViewCount(dbOwner string, dbFolder string, dbName string) error

Increments the view counter in memcached for a database

func InvalidateCacheEntry

func InvalidateCacheEntry(loggedInUser string, dbOwner string, dbFolder string, dbName string, commitID string) error

Invalidate memcache data for a database entry or entries

func IsCommitInBranchHistory

func IsCommitInBranchHistory(dbOwner string, dbFolder string, dbName string, branchName string, commitID string) (bool, error)

Checks if a given commit ID is in the history of the given branch

func LogDB4SConnect added in v0.0.6

func LogDB4SConnect(userAcc string, ipAddr string, userAgent string, downloadDate time.Time) error

Create a DB4S default browse list entry

func LogDownload

func LogDownload(dbOwner string, dbFolder string, dbName string, loggedInUser string, ipAddr string, serverSw string,
	userAgent string, downloadDate time.Time, sha string) error

Create a download log entry

func LogSQLiteQueryAfter added in v0.0.6

func LogSQLiteQueryAfter(insertID, memUsed, memHighWater int64) (err error)

Add memory allocation stats for the execution run of a user supplied SQLite query

func LogSQLiteQueryBefore added in v0.0.6

func LogSQLiteQueryBefore(source, dbOwner, dbFolder, dbName, loggedInUser, ipAddr, userAgent, query string) (int64, error)

Log the basic info for a user supplied SQLite query

func LogUpload

func LogUpload(dbOwner string, dbFolder string, dbName string, loggedInUser string, ipAddr string, serverSw string,
	userAgent string, uploadDate time.Time, sha string) error

Create an upload log entry

func MemcacheHandle

func MemcacheHandle() *memcache.Client

Returns the Memcached handle

func MetadataCacheKey

func MetadataCacheKey(prefix string, loggedInUser string, dbOwner string, dbFolder string, dbName string, commitID string) string

Generate a predictable cache key for metadata information

func MinioHandle

func MinioHandle(bucket string, id string) (*minio.Object, error)

Get a handle from Minio for a SQLite database object.

func MinioHandleClose

func MinioHandleClose(userDB *minio.Object) (err error)

Close a Minio object handle. Probably most useful for calling with defer().

func MinioLocation

func MinioLocation(dbOwner string, dbFolder string, dbName string, commitID string, loggedInUser string) (minioBucket string,
	minioID string, lastModified time.Time, err error)

Return the Minio bucket and ID for a given database. dbOwner, dbFolder, & dbName are from owner/folder/database URL fragment, loggedInUser is the name for the currently logged in user, for access permission check. Use an empty string ("") as the loggedInUser parameter if the true value isn't set or known. If the requested database doesn't exist, or the loggedInUser doesn't have access to it, then an error will be returned.

func NewEvent

func NewEvent(details EventDetails) (err error)

Adds an event entry to PostgreSQL

func OpenSQLiteDatabase added in v0.0.6

func OpenSQLiteDatabase(bucket, id string) (*sqlite.Conn, error)

OpenSQLiteDatabase retrieves a SQLite database from Minio, opens it, then returns the connection handle.

func OpenSQLiteDatabaseDefensive added in v0.0.6

func OpenSQLiteDatabaseDefensive(w http.ResponseWriter, r *http.Request, dbOwner, dbFolder, dbName, commitID, loggedInUser string) (sdb *sqlite.Conn, err error)

OpenSQLiteDatabaseDefensive is similar to OpenSQLiteDatabase(), but opens the database Read Only and implements the recommended defensive precautions for potentially malicious user provided SQL queries: https://www.sqlite.org/security.html

func PrefUserMaxRows

func PrefUserMaxRows(loggedInUser string) int

Return the user's preference for maximum number of SQLite rows to display.

func RandomString

func RandomString(length int) string

Generate a random string

func ReadConfig

func ReadConfig() error

Read the server configuration file.

func ReadSQLiteDBCSV

func ReadSQLiteDBCSV(sdb *sqlite.Conn, dbTable string) ([][]string, error)

ReadSQLiteDBCSV is a specialised variation of the ReadSQLiteDB() function, just for our CSV exporting code. It may be merged with that in future.

func RenameDatabase

func RenameDatabase(userName string, dbFolder string, dbName string, newName string) error

Rename a SQLite database.

func ReservedUsernamesCheck

func ReservedUsernamesCheck(userName string) error

Checks a username against the list of reserved ones.

func RetrieveDatabaseFile added in v0.0.6

func RetrieveDatabaseFile(bucket string, id string) (newDB string, err error)

Retrieves a SQLite database file from Minio. If there's a locally cached version already available though, use that

func SQLiteVersionNumber added in v0.0.6

func SQLiteVersionNumber() int32

SQLiteVersionNumber returns the version number of the available SQLite library, in 300X00Y format.

func SanityCheck

func SanityCheck(fileName string) (tables []string, err error)

SanityCheck performs basic sanity checks of an uploaded database.

func SaveDBSettings

func SaveDBSettings(userName string, dbFolder string, dbName string, oneLineDesc string, fullDesc string,
	defaultTable string, public bool, sourceURL string, defaultBranch string) error

Saves updated database settings to PostgreSQL.

func SendEmails

func SendEmails()

Sends status update emails to people watching databases

func SetClientCert

func SetClientCert(newCert []byte, userName string) error

Stores a certificate for a given client.

func SetUserPreferences

func SetUserPreferences(userName string, maxRows int, displayName string, email string) error

Sets the user's preference for maximum number of SQLite rows to display.

func SetUserStatusUpdates

func SetUserStatusUpdates(userName string, numUpdates int) error

Increments the view counter in memcached for a database

func SocialStats

func SocialStats(dbOwner string, dbFolder string, dbName string) (wa int, st int, fo int, err error)

Retrieve the latest social stats for a given database.

func StatusUpdateCheck

func StatusUpdateCheck(dbOwner string, dbFolder string, dbName string, thisID int, userName string) (numStatusUpdates int, err error)

Checks if a status update for the user exists for a given discussion or MR, and if so then removes it

func StatusUpdates

func StatusUpdates(loggedInUser string) (statusUpdates map[string][]StatusUpdateEntry, err error)

Retrieve the list of outstanding status updates for a user

func StatusUpdatesLoop

func StatusUpdatesLoop()

Periodically generates status updates (alert emails TBD) from the event queue

func StoreBranches

func StoreBranches(dbOwner string, dbFolder string, dbName string, branches map[string]BranchEntry) error

Updates the branches list for a database.

func StoreComment

func StoreComment(dbOwner string, dbFolder string, dbName string, commenter string, discID int, comText string,
	discClose bool, mrState MergeRequestState) error

Adds a comment to a discussion.

func StoreCommits

func StoreCommits(dbOwner string, dbFolder string, dbName string, commitList map[string]CommitEntry) error

Updates the commit list for a database.

func StoreDatabase

func StoreDatabase(dbOwner string, dbFolder string, dbName string, branches map[string]BranchEntry, c CommitEntry,
	pub bool, buf *os.File, sha string, dbSize int64, oneLineDesc string, fullDesc string, createDefBranch bool,
	branchName string, sourceURL string) error

Stores database details in PostgreSQL, and the database data itself in Minio.

func StoreDatabaseFile

func StoreDatabaseFile(db *os.File, sha string, dbSize int64) error

Store a database file in Minio.

func StoreDefaultBranchName

func StoreDefaultBranchName(dbOwner string, folder string, dbName string, branchName string) error

Stores the default branch name for a database.

func StoreDefaultTableName

func StoreDefaultTableName(dbOwner string, folder string, dbName string, tableName string) error

Stores the default table name for a database.

func StoreDiscussion

func StoreDiscussion(dbOwner string, dbFolder string, dbName string, loggedInUser string, title string, text string,
	discType DiscussionType, mr MergeRequestEntry) (newID int, err error)

Stores a new discussion for a database.

func StoreLicence

func StoreLicence(userName string, licenceName string, txt []byte, url string, orderNum int, fullName string,
	fileFormat string) error

Store a licence.

func StoreReleases

func StoreReleases(dbOwner string, dbFolder string, dbName string, releases map[string]ReleaseEntry) error

Store the releases for a database.

func StoreStatusUpdates

func StoreStatusUpdates(userName string, statusUpdates map[string][]StatusUpdateEntry) error

Store the status updates list for a user

func StoreTags

func StoreTags(dbOwner string, dbFolder string, dbName string, tags map[string]TagEntry) error

Store the tags for a database.

func TableRowsCacheKey

func TableRowsCacheKey(prefix string, loggedInUser string, dbOwner string, dbFolder string, dbName string, commitID string, dbTable string, rows int) string

Generate a predictable cache key for SQLite row data

func Tables

func Tables(sdb *sqlite.Conn) (tbl []string, err error)

Tables returns the list of tables in the SQLite database.

func TablesAndViews added in v0.0.6

func TablesAndViews(sdb *sqlite.Conn, dbName string) (list []string, err error)

TablesAndViews returns the list of tables and views in the SQLite database.

func ToggleDBStar

func ToggleDBStar(loggedInUser string, dbOwner string, dbFolder string, dbName string) error

Toggle on or off the starring of a database by a user.

func ToggleDBWatch

func ToggleDBWatch(loggedInUser string, dbOwner string, dbFolder string, dbName string) error

Toggle on or off the watching of a database by a user.

func UpdateAvatarURL

func UpdateAvatarURL(userName string, avatarURL string) error

Updates the Avatar URL for a user.

func UpdateComment

func UpdateComment(dbOwner string, dbFolder string, dbName string, loggedInUser string, discID int, comID int, newText string) error

Updates the text for a comment

func UpdateContributorsCount

func UpdateContributorsCount(dbOwner string, dbFolder, dbName string) error

Updates the contributors count for a database.

func UpdateDiscussion

func UpdateDiscussion(dbOwner string, dbFolder string, dbName string, loggedInUser string, discID int, newTitle string, newText string) error

Updates the text for a discussion

func UpdateMergeRequestCommits

func UpdateMergeRequestCommits(dbOwner string, dbFolder string, dbName string, discID int, mrCommits []CommitEntry) (err error)

Updates the commit list for a Merge Request

func UserNameFromAuth0ID

func UserNameFromAuth0ID(auth0id string) (string, error)

Returns the username for a given Auth0 ID.

func UserStatusUpdates

func UserStatusUpdates(userName string) (numUpdates int, err error)

Returns the number of status updates outstanding for a user

func ValidateBranchName

func ValidateBranchName(fieldName string) error

Validate the provided branch, release, or tag name.

func ValidateCommitID added in v0.0.5

func ValidateCommitID(fieldName string) error

Validate the provided commit ID.

func ValidateDB

func ValidateDB(dbName string) error

Validate the database name.

func ValidateDiscussionTitle

func ValidateDiscussionTitle(fieldName string) error

Validate the provided discussion or merge request title.

func ValidateDisplayName added in v0.0.5

func ValidateDisplayName(dbName string) error

Validate a provided full name.

func ValidateEmail

func ValidateEmail(email string) error

Validate the provided email address.

func ValidateFieldName

func ValidateFieldName(fieldName string) error

Validate the SQLite field name.

func ValidateFolder

func ValidateFolder(folder string) error

Validate the provided folder name.

func ValidateLicence

func ValidateLicence(licence string) error

Validate the provided licence name (ID).

func ValidateLicenceFullName added in v0.0.5

func ValidateLicenceFullName(licence string) error

Validate the provided licence full name.

func ValidateMarkdown

func ValidateMarkdown(fieldName string) error

Validate the provided markdown.

func ValidatePGTable

func ValidatePGTable(table string) error

Validate the provided PostgreSQL table name.

func ValidateUser

func ValidateUser(user string) error

Validate the provided username.

func ValidateUserDB

func ValidateUserDB(user string, db string) error

Validate the provided user and database name.

func ValidateUserDBTable

func ValidateUserDBTable(user string, db string, table string) error

Validate the provided user, database, and table name.

func ValidateUserEmail

func ValidateUserEmail(user string, email string) error

Validate the provided username and email address.

func ViewCount

func ViewCount(dbOwner string, dbFolder string, dbName string) (viewCount int, err error)

Returns the view counter for a specific database

func Views added in v0.0.6

func Views(sdb *sqlite.Conn) (vw []string, err error)

Views returns the list of views in the SQLite database.

func VisualisationDeleteParams added in v0.0.6

func VisualisationDeleteParams(dbOwner string, dbFolder string, dbName string, visName string) (err error)

Deletes a set of visualisation parameters

func VisualisationSaveData added in v0.0.6

func VisualisationSaveData(dbOwner string, dbFolder string, dbName string, commitID string, hash string, visData []VisRowV1) (err error)

Saves visualisation result data for later retrieval

func VisualisationSaveParams added in v0.0.6

func VisualisationSaveParams(dbOwner string, dbFolder string, dbName string, visName string, visParams VisParamsV2) (err error)

Saves a set of visualisation parameters for later retrieval

Types

type APIJSONColumn added in v0.0.6

type APIJSONColumn struct {
	Cid       int    `json:"column_id"`
	Name      string `json:"name"`
	DataType  string `json:"data_type"`
	NotNull   bool   `json:"not_null"`
	DfltValue string `json:"default_value"`
	Pk        int    `json:"primary_key"`
	Autoinc   bool   `json:"autoinc"`
	CollSeq   string `json:"collation_seq"`
}

APIJSONColumn is a copy of the Column type from github.com/gwenn/gosqlite, but including JSON field name info

type APIKey added in v0.0.6

type APIKey struct {
	Key         string    `json:"key"`
	DateCreated time.Time `json:"date_created"`
}

func GetAPIKeys added in v0.0.6

func GetAPIKeys(user string) ([]APIKey, error)

Returns the list of API keys for a user.

type AccessType

type AccessType int
const (
	DB_BOTH AccessType = iota
	DB_PRIVATE
	DB_PUBLIC
)

type ActivityRange

type ActivityRange string

type ActivityRow

type ActivityRow struct {
	Count  int    `json:"count"`
	DBName string `json:"dbname"`
	Owner  string `json:"owner"`
}

type ActivityStats

type ActivityStats struct {
	Downloads []ActivityRow
	Forked    []ActivityRow
	Starred   []ActivityRow
	Uploads   []UploadRow
	Viewed    []ActivityRow
}

func GetActivityStats

func GetActivityStats() (stats ActivityStats, err error)

type ApiInfo added in v0.0.6

type ApiInfo struct {
	BaseDir        string `toml:"base_dir"`
	BindAddress    string `toml:"bind_address"`
	Certificate    string `toml:"certificate"`
	CertificateKey string `toml:"certificate_key"`
	RequestLog     string `toml:"request_log"`
	ServerName     string `toml:"server_name"`
}

Config info for the API server

type Auth0Info

type Auth0Info struct {
	ClientID     string
	ClientSecret string
	Domain       string
}

Auth0 connection parameters

type Auth0Set

type Auth0Set struct {
	CallbackURL string
	ClientID    string
	Domain      string
}

type BranchEntry

type BranchEntry struct {
	Commit      string `json:"commit"`
	CommitCount int    `json:"commit_count"`
	Description string `json:"description"`
}

type CommitData

type CommitData struct {
	AuthorAvatar   string    `json:"author_avatar"`
	AuthorEmail    string    `json:"author_email"`
	AuthorName     string    `json:"author_name"`
	AuthorUsername string    `json:"author_username"`
	ID             string    `json:"id"`
	LicenceChange  string    `json:"licence_change"`
	Message        string    `json:"message"`
	Timestamp      time.Time `json:"timestamp"`
}

type CommitEntry

type CommitEntry struct {
	AuthorEmail    string    `json:"author_email"`
	AuthorName     string    `json:"author_name"`
	CommitterEmail string    `json:"committer_email"`
	CommitterName  string    `json:"committer_name"`
	ID             string    `json:"id"`
	Message        string    `json:"message"`
	OtherParents   []string  `json:"other_parents"`
	Parent         string    `json:"parent"`
	Timestamp      time.Time `json:"timestamp"`
	Tree           DBTree    `json:"tree"`
}

func GetCommonAncestorCommits

func GetCommonAncestorCommits(srcOwner string, srcFolder string, srcDBName string, srcBranch string, destOwner string,
	destFolder string, destName string, destBranch string) (ancestorID string, commitList []CommitEntry, err error, errType int)

Determines the common ancestor commit (if any) between a source and destination branch. Returns the commit ID of the ancestor and a slice of the commits between them. If no common ancestor exists, the returned ancestorID will be an empty string. Created for use by our Merge Request functions.

type DB4SInfo

type DB4SInfo struct {
	CAChain        string `toml:"ca_chain"`
	Certificate    string
	CertificateKey string `toml:"certificate_key"`
	Debug          bool
	Port           int
	Server         string
}

Configuration info for the DB4S end point

type DBEntry

type DBEntry struct {
	Folder           string
	DateEntry        time.Time
	DBName           string
	Owner            string
	OwnerDisplayName string `json:"display_name"`
}

func UserStarredDBs

func UserStarredDBs(userName string) (list []DBEntry, err error)

Returns the list of databases starred by a user.

func UserWatchingDBs

func UserWatchingDBs(userName string) (list []DBEntry, err error)

Returns the list of databases watched by a user.

func UsersStarredDB

func UsersStarredDB(dbOwner string, dbFolder string, dbName string) (list []DBEntry, err error)

Returns the list of users who starred a database.

func UsersWatchingDB

func UsersWatchingDB(dbOwner string, dbFolder string, dbName string) (list []DBEntry, err error)

Returns the list of users watching a database.

type DBInfo

type DBInfo struct {
	Branch        string
	Branches      int
	BranchList    []string
	Commits       int
	CommitID      string
	Contributors  int
	Database      string
	DateCreated   time.Time
	DBEntry       DBTreeEntry
	DefaultBranch string
	DefaultTable  string
	Discussions   int
	Downloads     int
	Folder        string
	Forks         int
	FullDesc      string
	LastModified  time.Time
	Licence       string
	LicenceURL    string
	MRs           int
	OneLineDesc   string
	Public        bool
	RepoModified  time.Time
	Releases      int
	SHA256        string
	Size          int64
	SourceURL     string
	Stars         int
	Tables        []string
	Tags          int
	Views         int
	Watchers      int
}

func UserDBs

func UserDBs(userName string, public AccessType) (list []DBInfo, err error)

Returns the list of databases for a user.

type DBTree

type DBTree struct {
	ID      string        `json:"id"`
	Entries []DBTreeEntry `json:"entries"`
}

type DBTreeEntry

type DBTreeEntry struct {
	EntryType    DBTreeEntryType `json:"entry_type"`
	LastModified time.Time       `json:"last_modified"`
	LicenceSHA   string          `json:"licence"`
	Name         string          `json:"name"`
	Sha256       string          `json:"sha256"`
	Size         int64           `json:"size"`
}

type DBTreeEntryType

type DBTreeEntryType string

type DataDiff added in v0.0.6

type DataDiff struct {
	ActionType DiffType    `json:"action_type"`
	Sql        string      `json:"sql"`
	Pk         []DataValue `json:"pk"`
}

type DataRow

type DataRow []DataValue

type DataValue

type DataValue struct {
	Name  string
	Type  ValType
	Value interface{}
}

type DiffObjectChangeset added in v0.0.6

type DiffObjectChangeset struct {
	ObjectName string     `json:"object_name"`
	ObjectType string     `json:"object_type"`
	Schema     SchemaDiff `json:"schema"`
	Data       []DataDiff `json:"data"`
}

type DiffType added in v0.0.6

type DiffType string

type Diffs added in v0.0.6

type Diffs struct {
	Diff []DiffObjectChangeset `json:"diff"`
}

func Diff added in v0.0.6

func Diff(ownerA string, folderA string, nameA string, commitA string, ownerB string, folderB string, nameB string, commitB string, loggedInUser string) (Diffs, error)

Diff generates the differences between the two commits commitA and commitB of the two databases specified in the other parameters

type DiscussionCommentEntry

type DiscussionCommentEntry struct {
	AvatarURL    string                `json:"avatar_url"`
	Body         string                `json:"body"`
	BodyRendered string                `json:"body_rendered"`
	Commenter    string                `json:"commenter"`
	DateCreated  time.Time             `json:"creation_date"`
	EntryType    DiscussionCommentType `json:"entry_type"`
	ID           int                   `json:"com_id"`
}

func DiscussionComments

func DiscussionComments(dbOwner string, dbFolder string, dbName string, discID int, comID int) (list []DiscussionCommentEntry, err error)

Returns the list of comments for a given discussion. If a non-0 comID value is passed, it will only return the details for that specific comment in the discussion. Otherwise it will return a list of all comments for a given discussion Note - This returns a slice instead of a map. We use a slice because it lets us use an ORDER BY clause in the SQL

and preserve the returned order (maps don't preserve order).  If in future we no longer need to preserve the
order, it might be useful to switch to using a map instead since they're often simpler to work with.

type DiscussionCommentType

type DiscussionCommentType string

type DiscussionEntry

type DiscussionEntry struct {
	AvatarURL    string            `json:"avatar_url"`
	Body         string            `json:"body"`
	BodyRendered string            `json:"body_rendered"`
	CommentCount int               `json:"comment_count"`
	Creator      string            `json:"creator"`
	DateCreated  time.Time         `json:"creation_date"`
	ID           int               `json:"disc_id"`
	LastModified time.Time         `json:"last_modified"`
	MRDetails    MergeRequestEntry `json:"mr_details"`
	Open         bool              `json:"open"`
	Title        string            `json:"title"`
	Type         DiscussionType    `json:"discussion_type"`
}

func Discussions

func Discussions(dbOwner string, dbFolder string, dbName string, discType DiscussionType, discID int) (list []DiscussionEntry, err error)

Returns the list of discussions or MRs for a given database. If a non-0 discID value is passed, it will only return the details for that specific discussion/MR. Otherwise it will return a list of all discussions or MRs for a given database Note - This returns a slice of DiscussionEntry, instead of a map. We use a slice because it lets us use an ORDER

BY clause in the SQL and preserve the returned order (maps don't preserve order).  If in future we no longer
need to preserve the order, it might be useful to switch to using a map instead since they're often simpler
to work with.

type DiscussionType

type DiscussionType int
const (
	DISCUSSION    DiscussionType = 0 // These are not iota, as it would be seriously bad for these numbers to change
	MERGE_REQUEST                = 1
)

type DiskCacheInfo

type DiskCacheInfo struct {
	Directory string
}

Disk cache info

type EnvInfo

type EnvInfo struct {
	Environment  string
	UserOverride string `toml:"user_override"`
}

Environment info

type EventDetails

type EventDetails struct {
	DBName    string    `json:"database_name"`
	DiscID    int       `json:"discussion_id"`
	Folder    string    `json:"database_folder"`
	ID        string    `json:"event_id"`
	Message   string    `json:"message"`
	Owner     string    `json:"database_owner"`
	Timestamp time.Time `json:"event_timestamp"`
	Title     string    `json:"title"`
	Type      EventType `json:"event_type"`
	URL       string    `json:"event_url"`
	UserName  string    `json:"username"`
}

type EventProcessingInfo

type EventProcessingInfo struct {
	Delay                     time.Duration `toml:"delay"`
	EmailQueueDir             string        `toml:"email_queue_dir"`
	EmailQueueProcessingDelay time.Duration `toml:"email_queue_processing_delay"`
}

Event processing loop

type EventType

type EventType int

type ForkEntry

type ForkEntry struct {
	DBName     string     `json:"database_name"`
	Folder     string     `json:"database_folder"`
	ForkedFrom int        `json:"forked_from"`
	IconList   []ForkType `json:"icon_list"`
	ID         int        `json:"id"`
	Owner      string     `json:"database_owner"`
	Processed  bool       `json:"processed"`
	Public     bool       `json:"public"`
	Deleted    bool       `json:"deleted"`
}

func ForkTree

func ForkTree(loggedInUser string, dbOwner string, dbFolder string, dbName string) (outputList []ForkEntry, err error)

Return the complete fork tree for a given database

type ForkType

type ForkType int
const (
	SPACE ForkType = iota
	ROOT
	STEM
	BRANCH
	END
)

type JsonError added in v0.0.6

type JsonError struct {
	Error string `json:"error"`
}

type LicenceEntry

type LicenceEntry struct {
	FileFormat string `json:"file_format"`
	FullName   string `json:"full_name"`
	Order      int    `json:"order"`
	Sha256     string `json:"sha256"`
	URL        string `json:"url"`
}

type LicenceInfo added in v0.0.5

type LicenceInfo struct {
	LicenceDir string `toml:"licence_dir"`
}

Path to the licence files

type MemcacheInfo

type MemcacheInfo struct {
	DefaultCacheTime    int           `toml:"default_cache_time"`
	Server              string        `toml:"server"`
	ViewCountFlushDelay time.Duration `toml:"view_count_flush_delay"`
}

Memcached connection parameters

type MergeRequestEntry

type MergeRequestEntry struct {
	Commits      []CommitEntry     `json:"commits"`
	DestBranch   string            `json:"destination_branch"`
	SourceBranch string            `json:"source_branch"`
	SourceDBID   int64             `json:"source_database_id"`
	SourceDBName string            `json:"source_database_name"`
	SourceFolder string            `json:"source_folder"`
	SourceOwner  string            `json:"source_owner"`
	State        MergeRequestState `json:"state"`
}

type MergeRequestState

type MergeRequestState int

type MetaInfo

type MetaInfo struct {
	AvatarURL        string
	Database         string
	ForkDatabase     string
	ForkDeleted      bool
	ForkFolder       string
	ForkOwner        string
	LoggedInUser     string
	NumStatusUpdates int
	Owner            string
	Protocol         string
	Server           string
	Title            string
}

type MinioInfo

type MinioInfo struct {
	AccessKey string `toml:"access_key"`
	HTTPS     bool
	Secret    string
	Server    string
}

Minio connection parameters

type PGInfo

type PGInfo struct {
	Database       string
	NumConnections int `toml:"num_connections"`
	Port           int
	Password       string
	Server         string
	SSL            bool
	Username       string
}

PostgreSQL connection parameters

type QuerySource added in v0.0.6

type QuerySource int
const (
	WebUI QuerySource = iota
	DB4S
	Visualisation
	API
	Internal
)

type RedashColumnMeta added in v0.0.5

type RedashColumnMeta struct {
	Name         string `json:"name"`
	Type         string `json:"type"`
	FriendlyName string `json:"friendly_name"`
}

When SQLite data is prepared for sending to Redash (as JSON), the RedashColumnMeta and RedashTableData structures are used to hold it

type RedashTableData added in v0.0.5

type RedashTableData struct {
	Columns []RedashColumnMeta       `json:"columns"`
	Rows    []map[string]interface{} `json:"rows"`
}

type ReleaseEntry

type ReleaseEntry struct {
	Commit        string    `json:"commit"`
	Date          time.Time `json:"date"`
	Description   string    `json:"description"`
	ReleaserEmail string    `json:"email"`
	ReleaserName  string    `json:"name"`
	Size          int64     `json:"size"`
}

type SQLiteDBinfo

type SQLiteDBinfo struct {
	Info     DBInfo
	MaxRows  int
	MinioBkt string
	MinioId  string
}

type SQLiteRecordSet

type SQLiteRecordSet struct {
	ColCount  int
	ColNames  []string
	Offset    int
	Records   []DataRow
	RowCount  int
	SortCol   string
	SortDir   string
	Tablename string
	TotalRows int
}

func ReadSQLiteDB

func ReadSQLiteDB(sdb *sqlite.Conn, dbTable, sortCol, sortDir string, maxRows, rowOffset int) (SQLiteRecordSet, error)

ReadSQLiteDB reads up to maxRows number of rows from a given SQLite database table. If maxRows < 0 (eg -1), then read all rows.

func ReadSQLiteDBCols

func ReadSQLiteDBCols(sdb *sqlite.Conn, dbTable, sortCol, sortDir string, ignoreBinary, ignoreNull bool, maxRows, rowOffset int) (SQLiteRecordSet, error)

ReadSQLiteDBCols reads up to maxRows # of rows from a SQLite database. Only returns the requested columns.

func SQLiteRunQuery added in v0.0.6

func SQLiteRunQuery(sdb *sqlite.Conn, querySource QuerySource, dbQuery string, ignoreBinary, ignoreNull bool) (memUsed, memHighWater int64, dataRows SQLiteRecordSet, err error)

SQLiteRunQuery runs a SQLite query. DO NOT use this for user provided SQL queries. For those, use SQLiteRunQueryDefensive().

func SQLiteRunQueryDefensive added in v0.0.6

func SQLiteRunQueryDefensive(w http.ResponseWriter, r *http.Request, querySource QuerySource, dbOwner, dbFolder, dbName, commitID, loggedInUser, query string) (SQLiteRecordSet, error)

SQLiteRunQueryDefensive runs a user provided SQLite query, using our "defensive" mode. eg with limits placed on what it's allowed to do.

type SchemaDiff added in v0.0.6

type SchemaDiff struct {
	ActionType DiffType `json:"action_type"`
	Sql        string   `json:"sql"`
}

type SigningInfo

type SigningInfo struct {
	CertDaysValid    int    `toml:"cert_days_valid"`
	Enabled          bool   `toml:"enabled"`
	IntermediateCert string `toml:"intermediate_cert"`
	IntermediateKey  string `toml:"intermediate_key"`
}

Used for signing DB4S client certificates

type StatusUpdateEntry

type StatusUpdateEntry struct {
	DiscID int    `json:"discussion_id"`
	Title  string `json:"title"`
	URL    string `json:"event_url"`
}

type TagEntry

type TagEntry struct {
	Commit      string    `json:"commit"`
	Date        time.Time `json:"date"`
	Description string    `json:"description"`
	TaggerEmail string    `json:"email"`
	TaggerName  string    `json:"name"`
}

type TomlConfig

type TomlConfig struct {
	Api         ApiInfo
	Auth0       Auth0Info
	DB4S        DB4SInfo
	Environment EnvInfo
	DiskCache   DiskCacheInfo
	Event       EventProcessingInfo
	Licence     LicenceInfo
	Memcache    MemcacheInfo
	Minio       MinioInfo
	Pg          PGInfo
	Sign        SigningInfo
	Web         WebInfo
}

Configuration file

var (
	// Our configuration info
	Conf TomlConfig
)

type UploadRow

type UploadRow struct {
	DBName     string    `json:"dbname"`
	Owner      string    `json:"owner"`
	UploadDate time.Time `json:"upload_date"`
}

type UserDetails

type UserDetails struct {
	AvatarURL   string
	ClientCert  []byte
	DateJoined  time.Time
	DisplayName string
	Email       string
	Password    string
	PHash       []byte
	PVerify     string
	Username    string
}

func User

func User(userName string) (user UserDetails, err error)

Returns details for a user.

type UserInfo

type UserInfo struct {
	FullName     string `json:"full_name"`
	LastModified time.Time
	Username     string
}

type UserInfoSlice added in v0.0.6

type UserInfoSlice []UserInfo

For sorting a UserInfo list by Last Modified date descending

func DB4SDefaultList

func DB4SDefaultList(loggedInUser string) (UserInfoSlice, error)

Return a list of 1) users with public databases, 2) along with the logged in users' most recently modified database (including their private one(s)).

func (UserInfoSlice) Len added in v0.0.6

func (u UserInfoSlice) Len() int

func (UserInfoSlice) Less added in v0.0.6

func (u UserInfoSlice) Less(i, j int) bool

func (UserInfoSlice) Swap added in v0.0.6

func (u UserInfoSlice) Swap(i, j int)

type ValType

type ValType int
const (
	Binary ValType = iota
	Image
	Null
	Text
	Integer
	Float
)

type VisGetFields added in v0.0.6

type VisGetFields struct {
	VisName string `validate:"required,visname,min=1,max=63"` // 63 char limit seems reasonable
}

type VisParamsV2 added in v0.0.6

type VisParamsV2 struct {
	ChartType   string `json:"chart_type"`
	ShowXLabel  bool   `json:"show_x_label"`
	ShowYLabel  bool   `json:"show_y_label"`
	SQL         string `json:"sql"`
	XAXisColumn string `json:"x_axis_label"`
	YAXisColumn string `json:"y_axis_label"`
}

func GetVisualisationParams added in v0.0.6

func GetVisualisationParams(dbOwner string, dbFolder string, dbName string, visName string) (params VisParamsV2, ok bool, err error)

Retrieves a saved set of visualisation parameters

type VisRowV1 added in v0.0.6

type VisRowV1 struct {
	Name  string
	Value int
}

func GetVisualisationData added in v0.0.6

func GetVisualisationData(dbOwner string, dbFolder string, dbName string, commitID string, hash string) (data []VisRowV1, ok bool, err error)

Retrieves a saved set of visualisation query results

type WebInfo

type WebInfo struct {
	BaseDir              string `toml:"base_dir"`
	BindAddress          string `toml:"bind_address"`
	Certificate          string `toml:"certificate"`
	CertificateKey       string `toml:"certificate_key"`
	RequestLog           string `toml:"request_log"`
	ServerName           string `toml:"server_name"`
	SessionStorePassword string `toml:"session_store_password"`
}

type WhereClause

type WhereClause struct {
	Column string
	Type   string
	Value  string
}

Jump to

Keyboard shortcuts

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