Changeset 77 in code for trunk/config


Ignore:
Timestamp:
Mar 4, 2020, 5:22:58 PM (5 years ago)
Author:
contact
Message:

Add SQLite database

Closes: https://todo.sr.ht/~emersion/jounce/9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/config/config.go

    r62 r77  
    1515
    1616type Server struct {
    17         Addr     string
    18         Hostname string
    19         TLS      *TLS
     17        Addr      string
     18        Hostname  string
     19        TLS       *TLS
     20        SQLDriver string
     21        SQLSource string
    2022}
    2123
     
    2628        }
    2729        return &Server{
    28                 Addr:     ":6667",
    29                 Hostname: hostname,
     30                Addr:      ":6667",
     31                Hostname:  hostname,
     32                SQLDriver: "sqlite3",
     33                SQLSource: "jounce.db",
    3034        }
    3135}
     
    6569                        }
    6670                        srv.TLS = tls
     71                case "sql":
     72                        if err := d.parseParams(&srv.SQLDriver, &srv.SQLSource); err != nil {
     73                                return nil, err
     74                        }
    6775                default:
    6876                        return nil, fmt.Errorf("unknown directive %q", d.Name)
Note: See TracChangeset for help on using the changeset viewer.