ingredient

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 10 Imported by: 0

README

Go Report Card GoDoc GolangCI

xmodules/ingredient for Xamboo - GO

The ingredient package contains a set of tables and structures to manage ingredients for recipes

Version Changes Control

v0.0.1 - 2020-05-08

  • Compatible with xmodule context standard

v0.0.0 - 2020-03-05

  • Support for multithread context implemented

v0.0.0 - 2020-01-23

  • BuildCaches is now on parallel thread

v0.0.0 - 2020-01-03

  • This document added
  • Need xmodules/context to work
  • Need xmodules/translation to work
  • Improvements in creation of modules and tables
  • Some bugs corrected in the dump of the data

v0.0.0 - 2019-12-18

  • First release of module

Manual:

I. Ingredients

Intro


  1. Overview

Example:

import "github.com/webability-go/xmodules/ingredient"


  1. Reference

To use the package:

import "github.com/webability-go/xmodules/ingredient"

Documentation

Overview

Modules dependency: Necesita USDA y METRICS para funcionar

Package user contains the list of administrative user for the system. All users have accesses, into a profile and even extended access based upon table records. It needs base xmodule.

Index

Constants

View Source
const (
	MODULEID              = "ingredient"
	VERSION               = "0.0.1"
	TRANSLATIONTHEME      = "ingredient"
	TRANSLATIONTHEMEAISLE = "ingaisle"
)

Variables

This section is empty.

Functions

func CompositeNameEnglish

func CompositeNameEnglish(ctx *base.Datasource, quantity string, ingredientkey int, metrickey int, extra string, system int) string

func CompositeNameSpanish

func CompositeNameSpanish(ctx *base.Datasource, quantity string, ingredientkey int, metrickey int, extra string, system int) string

func ConvertToSI

func ConvertToSI(ctx *base.Datasource, ingrediente int, scantidad string, medida int, cantidadsi int, medidasi int) (float64, int, string)

func CreateStructureIngredientByData

func CreateStructureIngredientByData(sitecontext applications.Datasource, data xdominion.XRecordDef, lang language.Tag) base.Structure

func CreateStructureIngredientByKey

func CreateStructureIngredientByKey(sitecontext applications.Datasource, key int, lang language.Tag) base.Structure

func CreateStructurePasilloByData

func CreateStructurePasilloByData(sitecontext applications.Datasource, data xdominion.XRecordDef, lang language.Tag) base.Structure

func CreateStructurePasilloByKey

func CreateStructurePasilloByKey(sitecontext applications.Datasource, key int, lang language.Tag) base.Structure

func GetIngredientCompositeName

func GetIngredientCompositeName(ctx *base.Datasource, quantity string, ingredientkey int, metrickey int, extra string, system int, lang language.Tag) string

func Setup

func Setup(ds applications.Datasource, prefix string) ([]string, error)

InitModule is called during the init phase to link the module with the system adds tables and caches to ctx::database

func StartContext

func StartContext(ds applications.Datasource, ctx *context.Context) error

func Synchronize

func Synchronize(ds applications.Datasource, prefix string) ([]string, error)

Types

type StructureIngredient

type StructureIngredient struct {
	Key  int
	Lang language.Tag
	Data *xdominion.XRecord
}

func GetIngredient

func GetIngredient(ctx *base.Datasource, clave int, lang language.Tag) *StructureIngredient

func (*StructureIngredient) Clone

func (sm *StructureIngredient) Clone() base.Structure

Clone the whole structure

func (*StructureIngredient) ComplementData

func (sm *StructureIngredient) ComplementData(sitecontext applications.Datasource)

ComplementData adds all the needed data from other objects /duplicable in the thread since the object will be destroyed at the end

func (*StructureIngredient) GetData

func (sm *StructureIngredient) GetData() *xdominion.XRecord

Returns the raw data

func (*StructureIngredient) IsAuthorized

func (sm *StructureIngredient) IsAuthorized(sitecontext applications.Datasource, site string, language string, device string) bool

IsAuthorized returns true if the structure can be used on this site/language/device

type StructurePasillo

type StructurePasillo struct {
	Key  int
	Lang language.Tag
	Data *xdominion.XRecord
}

func GetPasillo

func GetPasillo(ctx *base.Datasource, clave int, lang language.Tag) *StructurePasillo

func (*StructurePasillo) Clone

func (sm *StructurePasillo) Clone() base.Structure

Clone the whole structure

func (*StructurePasillo) ComplementData

func (sm *StructurePasillo) ComplementData(sitecontext applications.Datasource)

ComplementData adds all the needed data from other objects /duplicable in the thread since the object will be destroyed at the end

func (*StructurePasillo) GetData

func (sm *StructurePasillo) GetData() *xdominion.XRecord

Returns the raw data

func (*StructurePasillo) IsAuthorized

func (sm *StructurePasillo) IsAuthorized(sitecontext applications.Datasource, site string, language string, device string) bool

IsAuthorized returns true if the structure can be used on this site/language/device

Jump to

Keyboard shortcuts

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