MCPcopy
hub / github.com/tailscale/golink / Delete

Method Delete

db.go:137–153  ·  view source on GitHub ↗

Delete removes a Link using its short name.

(short string)

Source from the content-addressed store, hash-verified

135
136// Delete removes a Link using its short name.
137func (s *SQLiteDB) Delete(short string) error {
138 s.mu.Lock()
139 defer s.mu.Unlock()
140
141 result, err := s.db.Exec("DELETE FROM Links WHERE ID = ?", linkID(short))
142 if err != nil {
143 return err
144 }
145 rows, err := result.RowsAffected()
146 if err != nil {
147 return err
148 }
149 if rows != 1 {
150 return fmt.Errorf("expected to affect 1 row, affected %d", rows)
151 }
152 return nil
153}
154
155// LoadStats returns click stats for links.
156func (s *SQLiteDB) LoadStats() (ClickStats, error) {

Callers 2

serveDeleteFunction · 0.80

Calls 1

linkIDFunction · 0.85

Tested by 1