cncdb

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CNCMySQLHandler

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

func NewCNCMySQLHandler

func NewCNCMySQLHandler(cnf DatabaseSetup) (*CNCMySQLHandler, error)

func (*CNCMySQLHandler) GetFirstDate

func (c *CNCMySQLHandler) GetFirstDate() (time.Time, error)

func (*CNCMySQLHandler) GetRecordInfo

func (c *CNCMySQLHandler) GetRecordInfo(identifier string) (*DBData, error)

func (*CNCMySQLHandler) IdentifierExists

func (c *CNCMySQLHandler) IdentifierExists(identifier string) (bool, error)

func (*CNCMySQLHandler) ListRecordInfo

func (c *CNCMySQLHandler) ListRecordInfo(from *time.Time, until *time.Time) ([]DBData, error)

type ContactPersonData

type ContactPersonData struct {
	Firstname   string
	Lastname    string
	Email       string
	Affiliation sql.NullString
}

type CorpusData

type CorpusData struct {
	Size     sql.NullInt64
	Locale   *language.Tag
	Keywords sql.NullString
}

type DBData

type DBData struct {
	ID            int
	Date          time.Time
	Hosted        bool
	Type          string
	Name          string
	DescEN        sql.NullString
	DescCS        sql.NullString
	DateIssued    string
	TitleEN       string
	TitleCS       string
	Link          sql.NullString
	License       string
	Authors       string
	ContactPerson ContactPersonData
	CorpusData    CorpusData
}

type DBOverrides

type DBOverrides struct {
	CorporaTableName      string `json:"corporaTableName"`
	UserTableName         string `json:"userTableName"`
	UserTableFirstNameCol string `json:"userTableFirstNameCol"`
	UserTableLastNameCol  string `json:"userTableLastNameCol"`
}

DBOverrides handles differences between KonText default database schema and the CNC-one which is slightly different

type DatabaseSetup

type DatabaseSetup struct {
	Host             string      `json:"host"`
	User             string      `json:"user"`
	Passwd           string      `json:"passwd"`
	Name             string      `json:"db"`
	Overrides        DBOverrides `json:"overrides"`
	PublicCorplistID int         `json:"publicCorplistId"`
}

Jump to

Keyboard shortcuts

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