Documentation ¶
Index ¶
Constants ¶
View Source
const ( DBKindSqlite = "sqlite" DBKindPostgres = "postgres" DBKindMysql = "mysql" )
Supported database kinds
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Version string `yaml:"version" validate:"required"` Database Database `yaml:"database" validate:"required"` DataSources map[string]DataSource `yaml:"datasources"` Contracts map[string]Contract `yaml:"contracts"` Hasura Hasura `yaml:"hasura"` }
Config
type Contract ¶
type Contract struct { Address string `yaml:"address" validate:"required,len=36"` TypeName string `yaml:"typename"` }
Contracts -
type DataSource ¶
type DataSource struct { Kind string `yaml:"kind"` URL string `yaml:"url" validate:"required,url"` }
DataSource -
type Database ¶
type Database struct { Path string `yaml:"path" validate:"required_if=Kind sqlite"` Kind string `yaml:"kind" validate:"required,oneof=sqlite postgres mysql"` Host string `yaml:"host" validate:"required_unless=Kind sqlite"` Port int `yaml:"port" validate:"required_unless=Kind sqlite,gt=0,lt=65535"` User string `yaml:"user" validate:"required_unless=Kind sqlite"` Password string `yaml:"password" validate:"required_unless=Kind sqlite"` Database string `yaml:"database" validate:"required_unless=Kind sqlite"` SchemaName string `yaml:"schema_name"` }
Database
Click to show internal directories.
Click to hide internal directories.