Documentation ¶
Index ¶
- func Bietervertrag(domain string, bieterID string, headerImage string, data pdfData) (*bytes.Buffer, error)
- func Run(ctx context.Context, configFile, dbFile string, defaultFiles DefaultFiles) error
- type Config
- type Database
- func (db *Database) Bieter(id string) (json.RawMessage, bool)
- func (db *Database) BieterList() map[string]json.RawMessage
- func (db *Database) ClearOffer(asAdmin bool) error
- func (db *Database) DeleteBieter(id string, asAdmin bool) error
- func (db *Database) NewBieter(payload json.RawMessage, asAdmin bool) (string, error)
- func (db *Database) Offer(id string) int
- func (db *Database) SetState(r io.Reader) error
- func (db *Database) State() ServiceState
- func (db *Database) UpdateBieter(id string, r io.Reader, asAdmin bool) (json.RawMessage, error)
- func (db *Database) UpdateOffer(id string, r io.Reader, asAdmin bool) error
- type DefaultFiles
- type Event
- type MultiFS
- type ServiceState
- type ViewBieter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { AdminPW string `toml:"admin_password"` ListenAddr string `toml:"listen_addr"` Domain string `toml:"domain"` }
Config does what it is named.
func DefaultConfig ¶ added in v0.1.1
func DefaultConfig() Config
DefaultConfig returns a config object with default values.
func LoadConfig ¶
LoadConfig loads the config from a toml file.
type Database ¶
Database holds the data in memory and saves them to disk.
func (*Database) Bieter ¶ added in v0.1.1
func (db *Database) Bieter(id string) (json.RawMessage, bool)
Bieter returns the data for a bieterID.
func (*Database) BieterList ¶ added in v0.1.1
func (db *Database) BieterList() map[string]json.RawMessage
BieterList return all bieters.
func (*Database) ClearOffer ¶ added in v0.2.0
ClearOffer creates an event to remove all offers
func (*Database) DeleteBieter ¶ added in v0.1.1
DeleteBieter removes a bieter.
func (*Database) State ¶ added in v0.1.1
func (db *Database) State() ServiceState
State returns the current state.
func (*Database) UpdateBieter ¶ added in v0.1.1
UpdateBieter updates an existing bieter. The new payload is read from r and is returned (on success).
type DefaultFiles ¶
DefaultFiles that are used, when the folders do not exist in the file system.
type Event ¶
type Event interface { Name() string // contains filtered or unexported methods }
Event is one change of the database.
type MultiFS ¶
type MultiFS struct {
// contains filtered or unexported fields
}
MultiFS implements fs.FS but uses many sources.
type ServiceState ¶ added in v0.1.1
type ServiceState int
ServiceState is the state of the service.
func (ServiceState) String ¶ added in v0.1.1
func (s ServiceState) String() string
type ViewBieter ¶ added in v0.1.1
type ViewBieter struct { ID string `json:"id"` Payload json.RawMessage `json:"payload"` Offer int `json:"offer"` }
ViewBieter is the bieter data returned to the client