log directly to the terminal #170

Merged
Alfred-mk merged 7 commits from terminal-logs into master 2024-11-14 08:02:00 +01:00
2 changed files with 22 additions and 22 deletions
Showing only changes of commit d7232a53ef - Show all commits

View File

@ -19,8 +19,8 @@ const (
var (
custodialURLBase string
dataURLBase string
CustodialAPIKey string
DataAPIKey string
CustodialBearerToken string
DataBearerToken string
)
var (
@ -38,8 +38,8 @@ func setBase() error {
custodialURLBase = initializers.GetEnv("CUSTODIAL_URL_BASE", "http://localhost:5003")
dataURLBase = initializers.GetEnv("DATA_URL_BASE", "http://localhost:5006")
CustodialAPIKey = initializers.GetEnv("CUSTODIAL_API_KEY", "xd")
DataAPIKey = initializers.GetEnv("DATA_API_KEY", "xd")
CustodialBearerToken = initializers.GetEnv("CUSTODIAL_BEARER_TOKEN", "")
DataBearerToken = initializers.GetEnv("DATA_BEARER_TOKEN", "")
_, err = url.JoinPath(custodialURLBase, "/foo")
if err != nil {

View File

@ -209,13 +209,13 @@ func doRequest(ctx context.Context, req *http.Request, rcpt any) (*api.OKRespons
}
func doCustodialRequest(ctx context.Context, req *http.Request, rcpt any) (*api.OKResponse, error) {
req.Header.Set("X-GE-KEY", config.CustodialAPIKey)
req.Header.Set("Authorization", "Bearer "+config.CustodialBearerToken)
logRequestDetails(req)
return doRequest(ctx, req, rcpt)
}
func doDataRequest(ctx context.Context, req *http.Request, rcpt any) (*api.OKResponse, error) {
req.Header.Set("X-GE-KEY", config.DataAPIKey)
req.Header.Set("Authorization", "Bearer "+config.DataBearerToken)
logRequestDetails(req)
return doRequest(ctx, req, rcpt)
}