2021-09-30 00:00:49 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
2021-10-11 14:53:44 +00:00
|
|
|
"go.digitalcircle.com.br/open/httpcli"
|
|
|
|
"go.digitalcircle.com.br/open/replaycli-go/util"
|
2021-09-30 00:00:49 +00:00
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
2021-10-11 14:53:44 +00:00
|
|
|
type ApiCli struct {
|
|
|
|
cli *httpcli.Cli
|
2021-09-30 00:00:49 +00:00
|
|
|
}
|
|
|
|
|
2021-10-11 14:53:44 +00:00
|
|
|
func (a *ApiCli) HttpCli() *httpcli.Cli {
|
|
|
|
return a.cli
|
2021-09-30 00:00:49 +00:00
|
|
|
}
|
|
|
|
|
2021-10-11 14:53:44 +00:00
|
|
|
func NewApiCli() *ApiCli {
|
|
|
|
ret := &ApiCli{cli: httpcli.C()}
|
|
|
|
ret.cli.SetBasePath(util.Addr())
|
2021-09-30 00:00:49 +00:00
|
|
|
apikey = os.Getenv("REPLAY_APIKEY")
|
2021-10-11 14:53:44 +00:00
|
|
|
ret.cli.AddHeader("X-API-KEY", apikey)
|
2021-09-30 00:00:49 +00:00
|
|
|
return ret
|
|
|
|
}
|