shopify

package
v0.0.0-...-c35d080 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

Package shopify: go-shopify provides an easy-to-use API for making CRUD request to shopify.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shopify

type Shopify struct {
	// contains filtered or unexported fields
}

Shopify store struct which we use to wrap our request operations.

func New

func New(store, apiKey, pass string) Shopify

Creates a New Shopify Store API object with the store, apiKey and pass of your store. Usage:

shopify.New("mystore", "XXX","YYY")

func (*Shopify) Delete

func (shopify *Shopify) Delete(endpoint string) ([]byte, []error)

Makes a DELETE request to shopify with the given endpoint. Usage: shopify.Delete("products/5.json")

func (*Shopify) Get

func (shopify *Shopify) Get(endpoint string) ([]byte, []error)

Makes a GET request to shopify with the given endpoint. Usage: shopify.Get("products/5.json") shopify.Get("products/5/variants.json")

func (*Shopify) Post

func (shopify *Shopify) Post(endpoint string, data map[string]interface{}) ([]byte, []error)

Makes a POST request to shopify with the given endpoint and data. Usage: shopify.Post("products", map[string]interface{} = product data map)

func (*Shopify) Put

func (shopify *Shopify) Put(endpoint string, data map[string]interface{}) ([]byte, []error)

Makes a PUT request to shopify with the given endpoint and data. Usage: shopify.Put("products", map[string]interface{} = product data map)

func (*Shopify) Request

func (shopify *Shopify) Request(method, endpoint string, data map[string]interface{}) ([]byte, []error)

Creates a new Request to Shopify and returns the response as a map[string]interface{}. method: GET/POST/PUT - string url: target endpoint like "products" - string data: content to be sent with the request Usage: shopify.request("GET","products",nil)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL