Documentation ¶
Index ¶
- func SaveConnectionInfo(key []byte, database string, connectionString string, appID string) error
- type Application
- type ConfigValue
- type Domain
- type Store
- func (s Store) FindApplicationByID(id string) (*Application, error)
- func (s Store) FindApplicationByName(name string) (*Application, error)
- func (s Store) FindConfigValuesByDomain(d *Domain) (cvs []ConfigValue, err error)
- func (s Store) FindDomainsByNameExact(domainName string) (domain []Domain, err error)
- func (s Store) FindDomainsByNameLike(domainName string) (domain []Domain, err error)
- func (s Store) StoreApplication(app *Application) error
- func (s Store) StoreConfigValue(toStore *ConfigValue) error
- func (s Store) StoreDomain(domain *Domain) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Application ¶
type Application struct { AppID string `gorm:"primary_key"` ApplicationName string `gorm:"index;not null"` HashedSecret string `gorm:"not null"` DeletedAt *time.Time `sql:"index"` }
Application the key value pair
type ConfigValue ¶
type ConfigValue struct { DomainID int64 `gorm:"primary_key;auto_increment:false"` Owner Domain `gorm:"foreignkey:DomainID"` Key string `gorm:"index:configKey;primary_key"` Value string `gorm:"not null"` }
ConfigValue the key value pair
type Domain ¶
type Domain struct { DomainID int64 `gorm:"AUTO_INCREMENT"` Owners []Application `gorm:"many2many:application"` Name string `gorm:"unique_index"` DeletedAt *time.Time `sql:"index"` }
Domain the domain which holds the configuration values
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store contains the connection to the store holding the configuration data.
func CreateStore ¶
CreateStore create a store
func (Store) FindApplicationByID ¶
func (s Store) FindApplicationByID(id string) (*Application, error)
func (Store) FindApplicationByName ¶
func (s Store) FindApplicationByName(name string) (*Application, error)
func (Store) FindConfigValuesByDomain ¶
func (s Store) FindConfigValuesByDomain(d *Domain) (cvs []ConfigValue, err error)
FindConfigValuesByDomain will do exactly what is says.
func (Store) FindDomainsByNameExact ¶
FindDomainsByNameExact - find all domains with a specific name, will return an error if one occurs.
func (Store) FindDomainsByNameLike ¶
FindDomainsByNameLike - find all domains with a specific name, will return an error if one occurs.
func (Store) StoreApplication ¶
func (s Store) StoreApplication(app *Application) error
StoreApplication will put a given application into the store
func (Store) StoreConfigValue ¶
func (s Store) StoreConfigValue(toStore *ConfigValue) error
StoreConfigValue store a new ConfigValue connected to the given domain.
func (Store) StoreDomain ¶
StoreDomain Create a new domain in the store