gfm

package module
v0.0.0-...-6851a01 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2016 License: MIT Imports: 4 Imported by: 0

README

FileMaker database adapter for Go

This is WIP

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	// Server returns the Server that this database belongs to.
	Server() Server

	// Name returns the name of the database.
	Name() string

	// Lay returns a Layout struct, which can be queried further.
	Lay(string) Layout

	// Lays returns the layouts of the database.
	Lays() ([]Layout, error)

	// Scripts returns an array of the scripts on this database.
	//
	// TODO: Find out if this is the proper way of representing script. Maybe
	// they need their own type?
	Scripts() ([]string, error)

	// URL returns the url for sending requests to this database.
	URL() string
}

Database is the interface of a FileMaker database

type FMRS

type FMRS struct {
	XMLName   xml.Name     `xml:"resultset"`
	Count     int          `xml:"count,attr"`
	FetchSize int          `xml:"fetch-size,attr"`
	Records   []FMRSRecord `xml:"record"`
}

type FMRSDataSource

type FMRSDataSource struct {
	XMLName         xml.Name `xml:"datasource"`
	Database        string   `xml:"database,attr"`
	DateFormat      string   `xml:"date-format,attr"`
	Layout          string   `xml:"layout,attr"`
	Table           string   `xml:"table,attr"`
	TimeFormat      string   `xml:"time-format,attr"`
	TimeStampFormat string   `xml:"timestamp-format,attr"`
	TotalCount      int      `xml:"total-count,attr"`
}

type FMRSError

type FMRSError struct {
	XMLName xml.Name `xml:"error"`
	Code    int      `xml:"code,attr"`
}

type FMRSField

type FMRSField struct {
	Name string `xml:"name,attr"`
	Data string `xml:"data"`
}

type FMRSFieldDefinition

type FMRSFieldDefinition struct {
	AutoEnter     string `xml:"auto-enter,attr"`
	FourDigitYear string `xml:"four-digit-year,attr"`
	Global        string `xml:"global,attr"`
	MaxRepeat     int    `xml:"max-repeat,attr"`
	Name          string `xml:"name,attr"`
	NotEmpty      string `xml:"not-empty,attr"`
	NumericOnly   string `xml:"numeric-only,attr"`
	Result        string `xml:"result,attr"`
	TimeOfDay     string `xml:"time-of-day,attr"`
	Type          string `xml:"type,attr"`
}

type FMRSMetadata

type FMRSMetadata struct {
	XMLName          xml.Name              `xml:"metadata"`
	FieldDefinitions []FMRSFieldDefinition `xml:"field-definition"`
}

type FMRSProduct

type FMRSProduct struct {
	XMLName xml.Name `xml:"product"`
	Build   string   `xml:"build,attr"`
	Name    string   `xml:"name,attr"`
	Version string   `xml:"version,attr"`
}

type FMRSRecord

type FMRSRecord struct {
	RecordID int         `xml:"record-id,attr"`
	ModID    int         `xml:"mod-id,attr"`
	Fields   []FMRSField `xml:"field"`
}

type FMResultSet

type FMResultSet struct {
	XMLName    xml.Name `xml:"fmresultset"`
	Error      FMRSError
	Product    FMRSProduct
	Metadata   FMRSMetadata
	DataSource FMRSDataSource
	ResultSet  FMRS
}

type Layout

type Layout interface {
	DB() Database
	Name() string
	Delete(id int) error
	Duplicate(id int) (int, error)
}

Layout represents a FileMaker layout

type Server

type Server interface {
	DB(string) Database
	DBs() ([]Database, error)
	URL() string
}

Server is the interface of a FileMaker server

func NewServer

func NewServer(host, user, pass string) Server

NewServer instantiates a new server type from a host, user and a password

Jump to

Keyboard shortcuts

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