func loginIfNeeded() { if session.ReadSessionID() == "" { term.Section() term.Println("Please log in:") login() } }
func addHeaders(req *http.Request) { sessionID := session.ReadSessionID() appKey := config.Read().AppKey if sessionID != "" { req.Header.Add("x-appstax-sessionid", sessionID) } if appKey != "" { req.Header.Add("x-appstax-appkey", appKey) } }