core

package
v0.20.6 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Checkout     string = "checkout"
	Admin        string = "admin"
	PostPurchase string = "post-purchase"
	POS          string = "pos"
)

Variables

This section is empty.

Functions

func CreateAssetsEntries added in v0.17.1

func CreateAssetsEntries(extension *Extension) map[string]Asset

func GetSurface added in v0.2.0

func GetSurface(extension *Extension) string

func NewBoolPointer added in v0.17.1

func NewBoolPointer(boolState bool) *bool

func NewStringPointer added in v0.19.0

func NewStringPointer(value string) *string

Types

type App

type App map[string]interface{}

type Asset

type Asset struct {
	Name        string `json:"name" yaml:"name"`
	Url         string `json:"url" yaml:"url"`
	LastUpdated int64  `json:"lastUpdated" yaml:"lastUpdated"`
}

type Capabilities added in v0.3.1

type Capabilities struct {
	NetworkAccess *bool `json:"networkAccess" yaml:"network_access"`
}

type Config

type Config struct {
	App        appYaml     `yaml:"app"`
	Extensions []Extension `yaml:"extensions"`
	Port       int
	PublicUrl  string `yaml:"public_url"`
	Store      string `yaml:"store"`
}

func LoadConfig

func LoadConfig(r io.Reader) (config *Config, err error)

type Development

type Development struct {
	Build              commandConfig     `json:"-" yaml:"build,omitempty"`
	BuildDir           string            `json:"-" yaml:"build_dir,omitempty"`
	Develop            commandConfig     `json:"-" yaml:"develop,omitempty"`
	Entries            map[string]string `json:"-" yaml:"entries,omitempty"`
	Resource           Url               `json:"resource" yaml:"resource,omitempty"`
	Renderer           Renderer          `json:"-" yaml:"renderer,omitempty"`
	Root               Url               `json:"root" yaml:"root,omitempty"`
	RootDir            string            `json:"-" yaml:"root_dir,omitempty"`
	Hidden             *bool             `json:"hidden" yaml:"-"`
	Status             string            `json:"status" yaml:"-"`
	LocalizationStatus string            `json:"localizationStatus" yaml:"-"`
	Template           string            `json:"-" yaml:"template,omitempty"`
}

func (Development) UsesReact added in v0.3.0

func (d Development) UsesReact() bool

func (Development) UsesTypeScript added in v0.3.0

func (d Development) UsesTypeScript() bool

type Extension

type Extension struct {
	Assets          map[string]Asset `json:"assets" yaml:"-"`
	Capabilities    Capabilities     `json:"capabilities" yaml:"capabilities,omitempty"`
	Development     Development      `json:"development" yaml:"development,omitempty"`
	ExtensionPoints []string         `json:"extensionPoints" yaml:"extension_points,omitempty"`
	Localization    *Localization    `json:"localization" yaml:"-"`
	Metafields      []Metafield      `json:"metafields" yaml:"metafields,omitempty"`
	Type            string           `json:"type" yaml:"type,omitempty"`
	ExternalType    string           `json:"externalType" yaml:"external_type"`
	UUID            string           `json:"uuid" yaml:"uuid,omitempty"`
	Version         string           `json:"version" yaml:"version,omitempty"`
	Surface         string           `json:"surface" yaml:"surface"`
	Title           string           `json:"title,omitempty" yaml:"title,omitempty"`
	Name            string           `json:"name,omitempty" yaml:"name,omitempty"`
	NodeExecutable  string           `json:"-" yaml:"node_executable,omitempty"`
}

func (Extension) BuildDir added in v0.2.0

func (e Extension) BuildDir() string

func (Extension) NormalizedType added in v0.5.0

func (e Extension) NormalizedType() string

func (Extension) String added in v0.2.0

func (e Extension) String() string

func (Extension) Transformer added in v0.2.0

func (t Extension) Transformer(typ reflect.Type) func(dst, src reflect.Value) error

*

  • A custom transformer for mergo with the following rules: *
  • 1. Allow booleans with false values to override true values. There is a weird quirk in the library where false is treated as empty.
  • We need to use a custom transformer to fix this issue because universally allowing
  • overwriting with empty values leads to unexpected results overriding arrays and maps
  • see here for more info: https://github.com/imdario/mergo/issues/89#issuecomment-562954181 *
  • 2. Allow overwriting Localization data completely if it has been set

type ExtensionService

type ExtensionService struct {
	App            App
	Extensions     []Extension
	Port           int
	Store          string
	Version        string
	ApiRootUrl     string
	ApiRoot        string `json:"-" yaml:"-"`
	DevConsolePath string `json:"-" yaml:"-"`
}

func NewExtensionService

func NewExtensionService(config *Config) *ExtensionService

type Fragment added in v0.3.0

type Fragment map[string]interface{}

type JsonFragment added in v0.3.0

type JsonFragment struct {
	Fragment `json:"-"`
}

type Localization added in v0.3.0

type Localization struct {
	DefaultLocale string                 `json:"defaultLocale" yaml:"default_locale"`
	Translations  map[string]interface{} `json:"translations" yaml:"translations"`
	LastUpdated   int64                  `json:"lastUpdated" yaml:"lastUpdated"`
}

type Metafield

type Metafield struct {
	Namespace string `json:"namespace" yaml:"namespace"`
	Key       string `json:"key" yaml:"key"`
}

type Renderer

type Renderer struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type Url

type Url struct {
	Url string `json:"url" yaml:"url"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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