diff options
Diffstat (limited to 'db/endpoint.go')
-rw-r--r-- | db/endpoint.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/db/endpoint.go b/db/endpoint.go index f22d77b..cb59de5 100644 --- a/db/endpoint.go +++ b/db/endpoint.go @@ -23,7 +23,7 @@ func (p *Phlox) CreateEndpoint(name, path, address string) (Endpoint, error) { Path: path, Address: address, } - + return endpoint, nil } @@ -46,6 +46,17 @@ func extractEndpoint(s Scanner) (Endpoint, error) { } +func (p *Phlox) SetEndpointPath(endpoint Endpoint, path string) error { + _, err := p.db.Exec("update endpoints set path=? where endpointid=?", path, endpoint.Id) + return err +} + +func (p *Phlox) SetEndpointAddress(endpoint Endpoint, address string) error { + _, err := p.db.Exec("update endpoints set address=? where endpointid=?", address, endpoint.Id) + return err +} + + func queryEndpoint(p *Phlox, query, param string) (Endpoint, error) { row := p.db.QueryRow(query, param) endpoint, err := extractEndpoint(row) |