-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor; separate jfapi and ombi into modules
- Loading branch information
Showing
12 changed files
with
331 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package common | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
) | ||
|
||
// TimeoutHandler recovers from an http timeout. | ||
type TimeoutHandler func() | ||
|
||
// NewTimeoutHandler returns a new Timeout handler. | ||
func NewTimeoutHandler(name, addr string, noFail bool) TimeoutHandler { | ||
return func() { | ||
out := fmt.Sprintf("Failed to authenticate with %s @ %s: Timed out", name, addr) | ||
if noFail { | ||
log.Print(out) | ||
} else { | ||
log.Fatalf(out) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/hrfee/jfa-go/common | ||
|
||
go 1.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module github.com/hrfee/jfa-go/jfapi | ||
|
||
go 1.15 | ||
|
||
replace github.com/hrfee/jfa-go/common => ../common | ||
|
||
require github.com/hrfee/jfa-go/common v0.0.0-00010101000000-000000000000 |
Oops, something went wrong.