magento

package
v0.0.0-...-02ff1f5 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateResource

func CreateResource(c *Client, observed map[string]interface{}) (map[string]interface{}, *resty.Response, error)

CreateResource creates a new resource at specified api endpoint.

func DeleteResourceByID

func DeleteResourceByID(c *Client, id string) error

DeleteResourceByID deletes a resource by its ID at specified api endpoint.

func IsUpToDate

func IsUpToDate(observed map[string]interface{}, desired *Desired) (bool, error)

IsUpToDate checks if the observed resource is up to date with the desired resource.

func UpdateResourceByID

func UpdateResourceByID(c *Client, id string, observed map[string]interface{}) error

UpdateResourceByID updates a resource by its ID at specified api endpoint.

Types

type Client

type Client struct {
	BaseURL     string
	AccessToken string
	Path        string
}

Client struct to hold the Magento API client configuration

func NewClient

func NewClient(baseURL, accessToken string) *Client

NewClient initializes a new Magento API client configuration

func (*Client) Create

func (c *Client) Create() *resty.Client

CreateRestyClient creates a new resty client with configuration from Client

type Desired

type Desired struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Desired represents the desired state of a resource.

func GetResourceByID

func GetResourceByID(c *Client, id string) (*Desired, error)

GetResourceByID retrieves a resource by its ID at specified api endpoint.

Jump to

Keyboard shortcuts

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