chore: move '/internal/pkg' to '/pkg'
This commit is contained in:
3
pkg/sdk3rd/gcore/endpoint.go
Normal file
3
pkg/sdk3rd/gcore/endpoint.go
Normal file
@@ -0,0 +1,3 @@
|
||||
package common
|
||||
|
||||
const BASE_URL = "https://api.gcore.com"
|
||||
24
pkg/sdk3rd/gcore/signer.go
Normal file
24
pkg/sdk3rd/gcore/signer.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/G-Core/gcorelabscdn-go/gcore"
|
||||
)
|
||||
|
||||
type AuthRequestSigner struct {
|
||||
apiToken string
|
||||
}
|
||||
|
||||
var _ gcore.RequestSigner = (*AuthRequestSigner)(nil)
|
||||
|
||||
func NewAuthRequestSigner(apiToken string) *AuthRequestSigner {
|
||||
return &AuthRequestSigner{
|
||||
apiToken: apiToken,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *AuthRequestSigner) Sign(req *http.Request) error {
|
||||
req.Header.Set("Authorization", "APIKey "+s.apiToken)
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user