Topics, messages, and message detail in three panes, with filtering, publishing, adding topics, a raw JSON view, history restore, and open-link support.
15 lines
259 B
Go
15 lines
259 B
Go
package tui
|
|
|
|
import (
|
|
"fmt"
|
|
"net/url"
|
|
)
|
|
|
|
func validateURL(raw string) error {
|
|
u, err := url.Parse(raw)
|
|
if err != nil || u.Host == "" || (u.Scheme != "https" && u.Scheme != "http") {
|
|
return fmt.Errorf("only http(s) links can be opened")
|
|
}
|
|
return nil
|
|
}
|