replaycli-go/api/cli.go

24 lines
408 B
Go

package api
import (
"go.digitalcircle.com.br/open/httpcli"
"go.digitalcircle.com.br/open/replaycli-go/util"
"os"
)
type ApiCli struct {
cli *httpcli.Cli
}
func (a *ApiCli) HttpCli() *httpcli.Cli {
return a.cli
}
func NewApiCli() *ApiCli {
ret := &ApiCli{cli: httpcli.C()}
ret.cli.SetBasePath(util.Addr())
apikey = os.Getenv("REPLAY_APIKEY")
ret.cli.AddHeader("X-API-KEY", apikey)
return ret
}