Documentation ¶
Index ¶
- Constants
- func DefaultHTTPClient() *http.Client
- func Int64Str(v int64) string
- func MakeRequest(ctx context.Context, baseURL url.URL, method, path string, params interface{}, ...) (req *http.Request, err error)
- func Send(ctx context.Context, sender Sender, method, path string, req, resp interface{}, ...) (err error)
- func ShopBaseUrl(name string) string
- func ShopDomain(name string) string
- func ShopShortName(name string) string
- type AuthSetter
- type Call
- type Credentials
- type Endpoint
- type Option
- type Sender
Constants ¶
View Source
const ( HeaderContentType = "Content-Type" ApplicationJSON = "application/json" HeaderAccept = "Accept" HeaderXShopifyAccessToken = "X-Shopify-Access-Token" )
Variables ¶
This section is empty.
Functions ¶
func DefaultHTTPClient ¶
func Int64Str ¶
Int64Str use to convert int64 to string it is more efficient than we do fmt.Sprintf("%d",v)
func MakeRequest ¶
func MakeRequest(ctx context.Context, baseURL url.URL, method, path string, params interface{}, options ...Option) (req *http.Request, err error)
MakeRequest construct the http request for api call
func Send ¶
func Send(ctx context.Context, sender Sender, method, path string, req, resp interface{}, authSetter AuthSetter) (err error)
Send use to send HTTP request to shopify
func ShopDomain ¶
ShopDomain input shop name and get the shopDomain like <shop>.myshopify.com
func ShopShortName ¶
ShopShortName return the short shop name without .myshopify.com
Types ¶
type AuthSetter ¶
type Credentials ¶
type Option ¶
func WithAdminAuthHeader ¶
WithAdminAuthHeader optionally sets the api-version if the passed string is valid
func WithCredentials ¶
func WithCredentials(credentials Credentials) Option
WithCredentials is a function to set shopify credentials
Click to show internal directories.
Click to hide internal directories.