golcas

package module
v0.0.0-...-97028fb Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 5 Imported by: 0

README

golcas

golcas is a Go package for writing reading and writing data in the openLCA schema. Here is a small example:

w, err := golcas.NewZipWriter("path/to/file.zip")

// write a flow
err := w.WriteFlow(&golcas.Flow{
  ID: "123abc",
  Name: "Carbon dioxide",
  // ...
})

r, err := golcas.NewZipReader("path/to/file.zip")

// read a single flow
flow, err := r.ReadFlow("123abc")

// read all flows
err := r.EachFlow(func(flow *golcas.Flow) bool {
  // do something with the flwo
  return true
})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	ID          string   `json:"@id,omitempty"`
	Address     string   `json:"address,omitempty"`
	Category    string   `json:"category,omitempty"`
	City        string   `json:"city,omitempty"`
	Country     string   `json:"country,omitempty"`
	Description string   `json:"description,omitempty"`
	Email       string   `json:"email,omitempty"`
	LastChange  string   `json:"lastChange,omitempty"`
	Name        string   `json:"name,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Telefax     string   `json:"telefax,omitempty"`
	Telephone   string   `json:"telephone,omitempty"`
	Version     string   `json:"version,omitempty"`
	Website     string   `json:"website,omitempty"`
	ZipCode     string   `json:"zipCode,omitempty"`
}

func ReadActor

func ReadActor(data []byte) (*Actor, error)

type AllocationFactor

type AllocationFactor struct {
	AllocationType AllocationType `json:"allocationType,omitempty"`
	Exchange       *ExchangeRef   `json:"exchange,omitempty"`
	Formula        string         `json:"formula,omitempty"`
	Product        *Ref           `json:"product,omitempty"`
	Value          float64        `json:"value"`
}

type AllocationType

type AllocationType string
const (
	PHYSICAL_ALLOCATION    AllocationType = "PHYSICAL_ALLOCATION"
	ECONOMIC_ALLOCATION    AllocationType = "ECONOMIC_ALLOCATION"
	CAUSAL_ALLOCATION      AllocationType = "CAUSAL_ALLOCATION"
	USE_DEFAULT_ALLOCATION AllocationType = "USE_DEFAULT_ALLOCATION"
	NO_ALLOCATION          AllocationType = "NO_ALLOCATION"
)

type CalculationSetup

type CalculationSetup struct {
	Allocation          AllocationType   `json:"allocation,omitempty"`
	Amount              float64          `json:"amount"`
	FlowProperty        *Ref             `json:"flowProperty,omitempty"`
	ImpactMethod        *Ref             `json:"impactMethod,omitempty"`
	NwSet               *Ref             `json:"nwSet,omitempty"`
	Parameters          []ParameterRedef `json:"parameters,omitempty"`
	Target              *Ref             `json:"target,omitempty"`
	Unit                *Ref             `json:"unit,omitempty"`
	WithCosts           bool             `json:"withCosts"`
	WithRegionalization bool             `json:"withRegionalization"`
}

type CostValue

type CostValue struct {
	Amount   float64 `json:"amount"`
	Currency *Ref    `json:"currency,omitempty"`
}

type Currency

type Currency struct {
	ID               string   `json:"@id,omitempty"`
	Category         string   `json:"category,omitempty"`
	Code             string   `json:"code,omitempty"`
	ConversionFactor float64  `json:"conversionFactor"`
	Description      string   `json:"description,omitempty"`
	LastChange       string   `json:"lastChange,omitempty"`
	Name             string   `json:"name,omitempty"`
	RefCurrency      *Ref     `json:"refCurrency,omitempty"`
	Tags             []string `json:"tags,omitempty"`
	Version          string   `json:"version,omitempty"`
}

func ReadCurrency

func ReadCurrency(data []byte) (*Currency, error)

type DQIndicator

type DQIndicator struct {
	Name     string    `json:"name,omitempty"`
	Position int       `json:"position"`
	Scores   []DQScore `json:"scores,omitempty"`
}

type DQScore

type DQScore struct {
	Description string   `json:"description,omitempty"`
	Label       string   `json:"label,omitempty"`
	Position    int      `json:"position"`
	Uncertainty *float64 `json:"uncertainty,omitempty"`
}

type DQSystem

type DQSystem struct {
	ID               string        `json:"@id,omitempty"`
	Category         string        `json:"category,omitempty"`
	Description      string        `json:"description,omitempty"`
	HasUncertainties bool          `json:"hasUncertainties"`
	Indicators       []DQIndicator `json:"indicators,omitempty"`
	LastChange       string        `json:"lastChange,omitempty"`
	Name             string        `json:"name,omitempty"`
	Source           *Ref          `json:"source,omitempty"`
	Tags             []string      `json:"tags,omitempty"`
	Version          string        `json:"version,omitempty"`
}

func ReadDQSystem

func ReadDQSystem(data []byte) (*DQSystem, error)

type Direction

type Direction string
const (
	INPUT  Direction = "INPUT"
	OUTPUT Direction = "OUTPUT"
)

type EnviFlow

type EnviFlow struct {
	Flow     *Ref `json:"flow,omitempty"`
	IsInput  bool `json:"isInput"`
	Location *Ref `json:"location,omitempty"`
}

type EnviFlowValue

type EnviFlowValue struct {
	Amount   float64   `json:"amount"`
	EnviFlow *EnviFlow `json:"enviFlow,omitempty"`
}

type Epd

type Epd struct {
	ID              string      `json:"@id,omitempty"`
	Category        string      `json:"category,omitempty"`
	Description     string      `json:"description,omitempty"`
	LastChange      string      `json:"lastChange,omitempty"`
	Manufacturer    *Ref        `json:"manufacturer,omitempty"`
	Modules         []EpdModule `json:"modules,omitempty"`
	Name            string      `json:"name,omitempty"`
	Pcr             *Ref        `json:"pcr,omitempty"`
	Product         *EpdProduct `json:"product,omitempty"`
	ProgramOperator *Ref        `json:"programOperator,omitempty"`
	Tags            []string    `json:"tags,omitempty"`
	Urn             string      `json:"urn,omitempty"`
	Verifier        *Ref        `json:"verifier,omitempty"`
	Version         string      `json:"version,omitempty"`
}

func ReadEpd

func ReadEpd(data []byte) (*Epd, error)

type EpdModule

type EpdModule struct {
	Multiplier float64 `json:"multiplier"`
	Name       string  `json:"name,omitempty"`
	Result     *Ref    `json:"result,omitempty"`
}

type EpdProduct

type EpdProduct struct {
	Amount       float64 `json:"amount"`
	Flow         *Ref    `json:"flow,omitempty"`
	FlowProperty *Ref    `json:"flowProperty,omitempty"`
	Unit         *Ref    `json:"unit,omitempty"`
}

type Exchange

type Exchange struct {
	Amount                  float64      `json:"amount"`
	AmountFormula           string       `json:"amountFormula,omitempty"`
	BaseUncertainty         *float64     `json:"baseUncertainty,omitempty"`
	CostFormula             string       `json:"costFormula,omitempty"`
	CostValue               *float64     `json:"costValue,omitempty"`
	Currency                *Ref         `json:"currency,omitempty"`
	DefaultProvider         *Ref         `json:"defaultProvider,omitempty"`
	Description             string       `json:"description,omitempty"`
	DqEntry                 string       `json:"dqEntry,omitempty"`
	Flow                    *Ref         `json:"flow,omitempty"`
	FlowProperty            *Ref         `json:"flowProperty,omitempty"`
	InternalId              int          `json:"internalId"`
	IsAvoidedProduct        bool         `json:"isAvoidedProduct"`
	IsInput                 bool         `json:"isInput"`
	IsQuantitativeReference bool         `json:"isQuantitativeReference"`
	Location                *Ref         `json:"location,omitempty"`
	Uncertainty             *Uncertainty `json:"uncertainty,omitempty"`
	Unit                    *Ref         `json:"unit,omitempty"`
}

type ExchangeRef

type ExchangeRef struct {
	InternalId int `json:"internalId"`
}

type Flow

type Flow struct {
	ID                   string               `json:"@id,omitempty"`
	Cas                  string               `json:"cas,omitempty"`
	Category             string               `json:"category,omitempty"`
	Description          string               `json:"description,omitempty"`
	FlowProperties       []FlowPropertyFactor `json:"flowProperties,omitempty"`
	FlowType             FlowType             `json:"flowType,omitempty"`
	Formula              string               `json:"formula,omitempty"`
	IsInfrastructureFlow bool                 `json:"isInfrastructureFlow"`
	LastChange           string               `json:"lastChange,omitempty"`
	Location             *Ref                 `json:"location,omitempty"`
	Name                 string               `json:"name,omitempty"`
	Synonyms             string               `json:"synonyms,omitempty"`
	Tags                 []string             `json:"tags,omitempty"`
	Version              string               `json:"version,omitempty"`
}

func ReadFlow

func ReadFlow(data []byte) (*Flow, error)

type FlowMap

type FlowMap struct {
	ID          string         `json:"@id,omitempty"`
	Category    string         `json:"category,omitempty"`
	Description string         `json:"description,omitempty"`
	LastChange  string         `json:"lastChange,omitempty"`
	Mappings    []FlowMapEntry `json:"mappings,omitempty"`
	Name        string         `json:"name,omitempty"`
	Source      *Ref           `json:"source,omitempty"`
	Tags        []string       `json:"tags,omitempty"`
	Target      *Ref           `json:"target,omitempty"`
	Version     string         `json:"version,omitempty"`
}

type FlowMapEntry

type FlowMapEntry struct {
	ConversionFactor float64     `json:"conversionFactor"`
	From             *FlowMapRef `json:"from,omitempty"`
	To               *FlowMapRef `json:"to,omitempty"`
}

type FlowMapRef

type FlowMapRef struct {
	Flow         *Ref `json:"flow,omitempty"`
	FlowProperty *Ref `json:"flowProperty,omitempty"`
	Provider     *Ref `json:"provider,omitempty"`
	Unit         *Ref `json:"unit,omitempty"`
}

type FlowProperty

type FlowProperty struct {
	ID               string           `json:"@id,omitempty"`
	Category         string           `json:"category,omitempty"`
	Description      string           `json:"description,omitempty"`
	FlowPropertyType FlowPropertyType `json:"flowPropertyType,omitempty"`
	LastChange       string           `json:"lastChange,omitempty"`
	Name             string           `json:"name,omitempty"`
	Tags             []string         `json:"tags,omitempty"`
	UnitGroup        *Ref             `json:"unitGroup,omitempty"`
	Version          string           `json:"version,omitempty"`
}

func ReadFlowProperty

func ReadFlowProperty(data []byte) (*FlowProperty, error)

type FlowPropertyFactor

type FlowPropertyFactor struct {
	ConversionFactor  float64 `json:"conversionFactor"`
	FlowProperty      *Ref    `json:"flowProperty,omitempty"`
	IsRefFlowProperty bool    `json:"isRefFlowProperty"`
}

type FlowPropertyType

type FlowPropertyType string
const (
	ECONOMIC_QUANTITY FlowPropertyType = "ECONOMIC_QUANTITY"
	PHYSICAL_QUANTITY FlowPropertyType = "PHYSICAL_QUANTITY"
)

type FlowResult

type FlowResult struct {
	Amount       float64 `json:"amount"`
	Description  string  `json:"description,omitempty"`
	Flow         *Ref    `json:"flow,omitempty"`
	FlowProperty *Ref    `json:"flowProperty,omitempty"`
	IsInput      bool    `json:"isInput"`
	IsRefFlow    bool    `json:"isRefFlow"`
	Location     *Ref    `json:"location,omitempty"`
	Unit         *Ref    `json:"unit,omitempty"`
}

type FlowType

type FlowType string
const (
	ELEMENTARY_FLOW FlowType = "ELEMENTARY_FLOW"
	PRODUCT_FLOW    FlowType = "PRODUCT_FLOW"
	WASTE_FLOW      FlowType = "WASTE_FLOW"
)

type ImpactCategory

type ImpactCategory struct {
	ID            string         `json:"@id,omitempty"`
	Category      string         `json:"category,omitempty"`
	Code          string         `json:"code,omitempty"`
	Description   string         `json:"description,omitempty"`
	Direction     Direction      `json:"direction,omitempty"`
	ImpactFactors []ImpactFactor `json:"impactFactors,omitempty"`
	LastChange    string         `json:"lastChange,omitempty"`
	Name          string         `json:"name,omitempty"`
	Parameters    []Parameter    `json:"parameters,omitempty"`
	RefUnit       string         `json:"refUnit,omitempty"`
	Source        *Ref           `json:"source,omitempty"`
	Tags          []string       `json:"tags,omitempty"`
	Version       string         `json:"version,omitempty"`
}

func ReadImpactCategory

func ReadImpactCategory(data []byte) (*ImpactCategory, error)

type ImpactFactor

type ImpactFactor struct {
	Flow         *Ref         `json:"flow,omitempty"`
	FlowProperty *Ref         `json:"flowProperty,omitempty"`
	Formula      string       `json:"formula,omitempty"`
	Location     *Ref         `json:"location,omitempty"`
	Uncertainty  *Uncertainty `json:"uncertainty,omitempty"`
	Unit         *Ref         `json:"unit,omitempty"`
	Value        float64      `json:"value"`
}

type ImpactMethod

type ImpactMethod struct {
	ID               string   `json:"@id,omitempty"`
	Category         string   `json:"category,omitempty"`
	Code             string   `json:"code,omitempty"`
	Description      string   `json:"description,omitempty"`
	ImpactCategories []Ref    `json:"impactCategories,omitempty"`
	LastChange       string   `json:"lastChange,omitempty"`
	Name             string   `json:"name,omitempty"`
	NwSets           []NwSet  `json:"nwSets,omitempty"`
	Source           *Ref     `json:"source,omitempty"`
	Tags             []string `json:"tags,omitempty"`
	Version          string   `json:"version,omitempty"`
}

func ReadImpactMethod

func ReadImpactMethod(data []byte) (*ImpactMethod, error)

type ImpactResult

type ImpactResult struct {
	Amount      float64 `json:"amount"`
	Description string  `json:"description,omitempty"`
	Indicator   *Ref    `json:"indicator,omitempty"`
}

type ImpactValue

type ImpactValue struct {
	Amount         float64 `json:"amount"`
	ImpactCategory *Ref    `json:"impactCategory,omitempty"`
}

type LinkingConfig

type LinkingConfig struct {
	Cutoff              *float64        `json:"cutoff,omitempty"`
	PreferUnitProcesses bool            `json:"preferUnitProcesses"`
	ProviderLinking     ProviderLinking `json:"providerLinking,omitempty"`
}

type Location

type Location struct {
	ID          string         `json:"@id,omitempty"`
	Category    string         `json:"category,omitempty"`
	Code        string         `json:"code,omitempty"`
	Description string         `json:"description,omitempty"`
	Geometry    map[string]any `json:"geometry"`
	LastChange  string         `json:"lastChange,omitempty"`
	Latitude    *float64       `json:"latitude,omitempty"`
	Longitude   *float64       `json:"longitude,omitempty"`
	Name        string         `json:"name,omitempty"`
	Tags        []string       `json:"tags,omitempty"`
	Version     string         `json:"version,omitempty"`
}

func ReadLocation

func ReadLocation(data []byte) (*Location, error)

type ModelType

type ModelType string
const (
	ACTOR            ModelType = "ACTOR"
	CATEGORY         ModelType = "CATEGORY"
	CURRENCY         ModelType = "CURRENCY"
	DQ_SYSTEM        ModelType = "DQ_SYSTEM"
	EPD              ModelType = "EPD"
	FLOW             ModelType = "FLOW"
	FLOW_PROPERTY    ModelType = "FLOW_PROPERTY"
	IMPACT_CATEGORY  ModelType = "IMPACT_CATEGORY"
	IMPACT_METHOD    ModelType = "IMPACT_METHOD"
	LOCATION         ModelType = "LOCATION"
	PARAMETER        ModelType = "PARAMETER"
	PROCESS          ModelType = "PROCESS"
	PRODUCT_SYSTEM   ModelType = "PRODUCT_SYSTEM"
	PROJECT          ModelType = "PROJECT"
	RESULT           ModelType = "RESULT"
	SOCIAL_INDICATOR ModelType = "SOCIAL_INDICATOR"
	SOURCE           ModelType = "SOURCE"
	UNIT_GROUP       ModelType = "UNIT_GROUP"
)

type NwFactor

type NwFactor struct {
	ImpactCategory      *Ref     `json:"impactCategory,omitempty"`
	NormalisationFactor *float64 `json:"normalisationFactor,omitempty"`
	WeightingFactor     *float64 `json:"weightingFactor,omitempty"`
}

type NwSet

type NwSet struct {
	ID                string     `json:"@id,omitempty"`
	Description       string     `json:"description,omitempty"`
	Factors           []NwFactor `json:"factors,omitempty"`
	Name              string     `json:"name,omitempty"`
	WeightedScoreUnit string     `json:"weightedScoreUnit,omitempty"`
}

type Parameter

type Parameter struct {
	ID               string         `json:"@id,omitempty"`
	Category         string         `json:"category,omitempty"`
	Description      string         `json:"description,omitempty"`
	Formula          string         `json:"formula,omitempty"`
	IsInputParameter bool           `json:"isInputParameter"`
	LastChange       string         `json:"lastChange,omitempty"`
	Name             string         `json:"name,omitempty"`
	ParameterScope   ParameterScope `json:"parameterScope,omitempty"`
	Tags             []string       `json:"tags,omitempty"`
	Uncertainty      *Uncertainty   `json:"uncertainty,omitempty"`
	Value            float64        `json:"value"`
	Version          string         `json:"version,omitempty"`
}

func ReadParameter

func ReadParameter(data []byte) (*Parameter, error)

type ParameterRedef

type ParameterRedef struct {
	Context     *Ref         `json:"context,omitempty"`
	Description string       `json:"description,omitempty"`
	IsProtected bool         `json:"isProtected"`
	Name        string       `json:"name,omitempty"`
	Uncertainty *Uncertainty `json:"uncertainty,omitempty"`
	Value       float64      `json:"value"`
}

type ParameterRedefSet

type ParameterRedefSet struct {
	Description string           `json:"description,omitempty"`
	IsBaseline  bool             `json:"isBaseline"`
	Name        string           `json:"name,omitempty"`
	Parameters  []ParameterRedef `json:"parameters,omitempty"`
}

type ParameterScope

type ParameterScope string
const (
	PROCESS_SCOPE ParameterScope = "PROCESS_SCOPE"
	IMPACT_SCOPE  ParameterScope = "IMPACT_SCOPE"
	GLOBAL_SCOPE  ParameterScope = "GLOBAL_SCOPE"
)

type Process

type Process struct {
	ID                      string                `json:"@id,omitempty"`
	AllocationFactors       []AllocationFactor    `json:"allocationFactors,omitempty"`
	Category                string                `json:"category,omitempty"`
	DefaultAllocationMethod AllocationType        `json:"defaultAllocationMethod,omitempty"`
	Description             string                `json:"description,omitempty"`
	DqEntry                 string                `json:"dqEntry,omitempty"`
	DqSystem                *Ref                  `json:"dqSystem,omitempty"`
	ExchangeDqSystem        *Ref                  `json:"exchangeDqSystem,omitempty"`
	Exchanges               []Exchange            `json:"exchanges,omitempty"`
	IsInfrastructureProcess bool                  `json:"isInfrastructureProcess"`
	LastChange              string                `json:"lastChange,omitempty"`
	LastInternalId          int                   `json:"lastInternalId"`
	Location                *Ref                  `json:"location,omitempty"`
	Name                    string                `json:"name,omitempty"`
	Parameters              []Parameter           `json:"parameters,omitempty"`
	ProcessDocumentation    *ProcessDocumentation `json:"processDocumentation,omitempty"`
	ProcessType             ProcessType           `json:"processType,omitempty"`
	SocialAspects           []SocialAspect        `json:"socialAspects,omitempty"`
	SocialDqSystem          *Ref                  `json:"socialDqSystem,omitempty"`
	Tags                    []string              `json:"tags,omitempty"`
	Version                 string                `json:"version,omitempty"`
}

func ReadProcess

func ReadProcess(data []byte) (*Process, error)

type ProcessDocumentation

type ProcessDocumentation struct {
	CompletenessDescription      string `json:"completenessDescription,omitempty"`
	CreationDate                 string `json:"creationDate,omitempty"`
	DataCollectionDescription    string `json:"dataCollectionDescription,omitempty"`
	DataDocumentor               *Ref   `json:"dataDocumentor,omitempty"`
	DataGenerator                *Ref   `json:"dataGenerator,omitempty"`
	DataSelectionDescription     string `json:"dataSelectionDescription,omitempty"`
	DataSetOwner                 *Ref   `json:"dataSetOwner,omitempty"`
	DataTreatmentDescription     string `json:"dataTreatmentDescription,omitempty"`
	GeographyDescription         string `json:"geographyDescription,omitempty"`
	IntendedApplication          string `json:"intendedApplication,omitempty"`
	InventoryMethodDescription   string `json:"inventoryMethodDescription,omitempty"`
	IsCopyrightProtected         bool   `json:"isCopyrightProtected"`
	ModelingConstantsDescription string `json:"modelingConstantsDescription,omitempty"`
	ProjectDescription           string `json:"projectDescription,omitempty"`
	Publication                  *Ref   `json:"publication,omitempty"`
	RestrictionsDescription      string `json:"restrictionsDescription,omitempty"`
	ReviewDetails                string `json:"reviewDetails,omitempty"`
	Reviewer                     *Ref   `json:"reviewer,omitempty"`
	SamplingDescription          string `json:"samplingDescription,omitempty"`
	Sources                      []Ref  `json:"sources,omitempty"`
	TechnologyDescription        string `json:"technologyDescription,omitempty"`
	TimeDescription              string `json:"timeDescription,omitempty"`
	UseAdvice                    string `json:"useAdvice,omitempty"`
	ValidFrom                    string `json:"validFrom,omitempty"`
	ValidUntil                   string `json:"validUntil,omitempty"`
}
type ProcessLink struct {
	Exchange *ExchangeRef `json:"exchange,omitempty"`
	Flow     *Ref         `json:"flow,omitempty"`
	Process  *Ref         `json:"process,omitempty"`
	Provider *Ref         `json:"provider,omitempty"`
}

type ProcessType

type ProcessType string
const (
	LCI_RESULT   ProcessType = "LCI_RESULT"
	UNIT_PROCESS ProcessType = "UNIT_PROCESS"
)

type ProductSystem

type ProductSystem struct {
	ID                 string              `json:"@id,omitempty"`
	Category           string              `json:"category,omitempty"`
	Description        string              `json:"description,omitempty"`
	LastChange         string              `json:"lastChange,omitempty"`
	Name               string              `json:"name,omitempty"`
	ParameterSets      []ParameterRedefSet `json:"parameterSets,omitempty"`
	ProcessLinks       []ProcessLink       `json:"processLinks,omitempty"`
	Processes          []Ref               `json:"processes,omitempty"`
	RefExchange        *ExchangeRef        `json:"refExchange,omitempty"`
	RefProcess         *Ref                `json:"refProcess,omitempty"`
	Tags               []string            `json:"tags,omitempty"`
	TargetAmount       float64             `json:"targetAmount"`
	TargetFlowProperty *Ref                `json:"targetFlowProperty,omitempty"`
	TargetUnit         *Ref                `json:"targetUnit,omitempty"`
	Version            string              `json:"version,omitempty"`
}

func ReadProductSystem

func ReadProductSystem(data []byte) (*ProductSystem, error)

type Project

type Project struct {
	ID                    string           `json:"@id,omitempty"`
	Category              string           `json:"category,omitempty"`
	Description           string           `json:"description,omitempty"`
	ImpactMethod          *Ref             `json:"impactMethod,omitempty"`
	IsWithCosts           bool             `json:"isWithCosts"`
	IsWithRegionalization bool             `json:"isWithRegionalization"`
	LastChange            string           `json:"lastChange,omitempty"`
	Name                  string           `json:"name,omitempty"`
	NwSet                 *NwSet           `json:"nwSet,omitempty"`
	Tags                  []string         `json:"tags,omitempty"`
	Variants              []ProjectVariant `json:"variants,omitempty"`
	Version               string           `json:"version,omitempty"`
}

func ReadProject

func ReadProject(data []byte) (*Project, error)

type ProjectVariant

type ProjectVariant struct {
	AllocationMethod AllocationType   `json:"allocationMethod,omitempty"`
	Amount           float64          `json:"amount"`
	Description      string           `json:"description,omitempty"`
	IsDisabled       bool             `json:"isDisabled"`
	Name             string           `json:"name,omitempty"`
	ParameterRedefs  []ParameterRedef `json:"parameterRedefs,omitempty"`
	ProductSystem    *Ref             `json:"productSystem,omitempty"`
	Unit             *Ref             `json:"unit,omitempty"`
}

type ProviderLinking

type ProviderLinking string
const (
	IGNORE_DEFAULTS ProviderLinking = "IGNORE_DEFAULTS"
	PREFER_DEFAULTS ProviderLinking = "PREFER_DEFAULTS"
	ONLY_DEFAULTS   ProviderLinking = "ONLY_DEFAULTS"
)

type Ref

type Ref struct {
	Type        string      `json:"@type,omitempty"`
	ID          string      `json:"@id,omitempty"`
	Category    string      `json:"category,omitempty"`
	Description string      `json:"description,omitempty"`
	FlowType    FlowType    `json:"flowType,omitempty"`
	Location    string      `json:"location,omitempty"`
	Name        string      `json:"name,omitempty"`
	ProcessType ProcessType `json:"processType,omitempty"`
	RefUnit     string      `json:"refUnit,omitempty"`
}

type Result

type Result struct {
	ID            string         `json:"@id,omitempty"`
	Category      string         `json:"category,omitempty"`
	Description   string         `json:"description,omitempty"`
	FlowResults   []FlowResult   `json:"flowResults,omitempty"`
	ImpactMethod  *Ref           `json:"impactMethod,omitempty"`
	ImpactResults []ImpactResult `json:"impactResults,omitempty"`
	LastChange    string         `json:"lastChange,omitempty"`
	Name          string         `json:"name,omitempty"`
	ProductSystem *Ref           `json:"productSystem,omitempty"`
	Tags          []string       `json:"tags,omitempty"`
	Version       string         `json:"version,omitempty"`
}

func ReadResult

func ReadResult(data []byte) (*Result, error)

type ResultState

type ResultState struct {
	ID          string `json:"@id,omitempty"`
	Error       string `json:"error,omitempty"`
	IsReady     bool   `json:"isReady"`
	IsScheduled bool   `json:"isScheduled"`
	Time        int    `json:"time"`
}

type RiskLevel

type RiskLevel string
const (
	NO_OPPORTUNITY     RiskLevel = "NO_OPPORTUNITY"
	HIGH_OPPORTUNITY   RiskLevel = "HIGH_OPPORTUNITY"
	MEDIUM_OPPORTUNITY RiskLevel = "MEDIUM_OPPORTUNITY"
	LOW_OPPORTUNITY    RiskLevel = "LOW_OPPORTUNITY"
	NO_RISK            RiskLevel = "NO_RISK"
	VERY_LOW_RISK      RiskLevel = "VERY_LOW_RISK"
	LOW_RISK           RiskLevel = "LOW_RISK"
	MEDIUM_RISK        RiskLevel = "MEDIUM_RISK"
	HIGH_RISK          RiskLevel = "HIGH_RISK"
	VERY_HIGH_RISK     RiskLevel = "VERY_HIGH_RISK"
	NO_DATA            RiskLevel = "NO_DATA"
	NOT_APPLICABLE     RiskLevel = "NOT_APPLICABLE"
)

type SankeyEdge

type SankeyEdge struct {
	NodeIndex     int     `json:"nodeIndex"`
	ProviderIndex int     `json:"providerIndex"`
	UpstreamShare float64 `json:"upstreamShare"`
}

type SankeyGraph

type SankeyGraph struct {
	Edges     []SankeyEdge `json:"edges,omitempty"`
	Nodes     []SankeyNode `json:"nodes,omitempty"`
	RootIndex int          `json:"rootIndex"`
}

type SankeyNode

type SankeyNode struct {
	DirectResult float64   `json:"directResult"`
	Index        int       `json:"index"`
	TechFlow     *TechFlow `json:"techFlow,omitempty"`
	TotalResult  float64   `json:"totalResult"`
}

type SankeyRequest

type SankeyRequest struct {
	EnviFlow       *EnviFlow `json:"enviFlow,omitempty"`
	ForCosts       *bool     `json:"forCosts,omitempty"`
	ImpactCategory *Ref      `json:"impactCategory,omitempty"`
	MaxNodes       *int      `json:"maxNodes,omitempty"`
	MinShare       *float64  `json:"minShare,omitempty"`
}

type SocialAspect

type SocialAspect struct {
	ActivityValue   float64   `json:"activityValue"`
	Comment         string    `json:"comment,omitempty"`
	Quality         string    `json:"quality,omitempty"`
	RawAmount       string    `json:"rawAmount,omitempty"`
	RiskLevel       RiskLevel `json:"riskLevel,omitempty"`
	SocialIndicator *Ref      `json:"socialIndicator,omitempty"`
	Source          *Ref      `json:"source,omitempty"`
}

type SocialIndicator

type SocialIndicator struct {
	ID                string   `json:"@id,omitempty"`
	ActivityQuantity  *Ref     `json:"activityQuantity,omitempty"`
	ActivityUnit      *Ref     `json:"activityUnit,omitempty"`
	ActivityVariable  string   `json:"activityVariable,omitempty"`
	Category          string   `json:"category,omitempty"`
	Description       string   `json:"description,omitempty"`
	EvaluationScheme  string   `json:"evaluationScheme,omitempty"`
	LastChange        string   `json:"lastChange,omitempty"`
	Name              string   `json:"name,omitempty"`
	Tags              []string `json:"tags,omitempty"`
	UnitOfMeasurement string   `json:"unitOfMeasurement,omitempty"`
	Version           string   `json:"version,omitempty"`
}

func ReadSocialIndicator

func ReadSocialIndicator(data []byte) (*SocialIndicator, error)

type Source

type Source struct {
	ID            string   `json:"@id,omitempty"`
	Category      string   `json:"category,omitempty"`
	Description   string   `json:"description,omitempty"`
	ExternalFile  string   `json:"externalFile,omitempty"`
	LastChange    string   `json:"lastChange,omitempty"`
	Name          string   `json:"name,omitempty"`
	Tags          []string `json:"tags,omitempty"`
	TextReference string   `json:"textReference,omitempty"`
	Url           string   `json:"url,omitempty"`
	Version       string   `json:"version,omitempty"`
	Year          *int     `json:"year,omitempty"`
}

func ReadSource

func ReadSource(data []byte) (*Source, error)

type TechFlow

type TechFlow struct {
	Flow     *Ref `json:"flow,omitempty"`
	Provider *Ref `json:"provider,omitempty"`
}

type TechFlowValue

type TechFlowValue struct {
	Amount   float64   `json:"amount"`
	TechFlow *TechFlow `json:"techFlow,omitempty"`
}

type Uncertainty

type Uncertainty struct {
	DistributionType UncertaintyType `json:"distributionType,omitempty"`
	GeomMean         *float64        `json:"geomMean,omitempty"`
	GeomSd           *float64        `json:"geomSd,omitempty"`
	Maximum          *float64        `json:"maximum,omitempty"`
	Mean             *float64        `json:"mean,omitempty"`
	Minimum          *float64        `json:"minimum,omitempty"`
	Mode             *float64        `json:"mode,omitempty"`
	Sd               *float64        `json:"sd,omitempty"`
}

type UncertaintyType

type UncertaintyType string
const (
	LOG_NORMAL_DISTRIBUTION UncertaintyType = "LOG_NORMAL_DISTRIBUTION"
	NORMAL_DISTRIBUTION     UncertaintyType = "NORMAL_DISTRIBUTION"
	TRIANGLE_DISTRIBUTION   UncertaintyType = "TRIANGLE_DISTRIBUTION"
	UNIFORM_DISTRIBUTION    UncertaintyType = "UNIFORM_DISTRIBUTION"
)

type Unit

type Unit struct {
	ID               string   `json:"@id,omitempty"`
	ConversionFactor float64  `json:"conversionFactor"`
	Description      string   `json:"description,omitempty"`
	IsRefUnit        bool     `json:"isRefUnit"`
	Name             string   `json:"name,omitempty"`
	Synonyms         []string `json:"synonyms,omitempty"`
}

type UnitGroup

type UnitGroup struct {
	ID                  string   `json:"@id,omitempty"`
	Category            string   `json:"category,omitempty"`
	DefaultFlowProperty *Ref     `json:"defaultFlowProperty,omitempty"`
	Description         string   `json:"description,omitempty"`
	LastChange          string   `json:"lastChange,omitempty"`
	Name                string   `json:"name,omitempty"`
	Tags                []string `json:"tags,omitempty"`
	Units               []Unit   `json:"units,omitempty"`
	Version             string   `json:"version,omitempty"`
}

func ReadUnitGroup

func ReadUnitGroup(data []byte) (*UnitGroup, error)

type UpstreamNode

type UpstreamNode struct {
	DirectContribution float64   `json:"directContribution"`
	RequiredAmount     float64   `json:"requiredAmount"`
	Result             float64   `json:"result"`
	TechFlow           *TechFlow `json:"techFlow,omitempty"`
}

type ZipReader

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

func NewZipReader

func NewZipReader(filePath string) (*ZipReader, error)

func (*ZipReader) Close

func (r *ZipReader) Close() error

func (*ZipReader) EachActor

func (r *ZipReader) EachActor(fn func(*Actor) bool) error

func (*ZipReader) EachCurrency

func (r *ZipReader) EachCurrency(fn func(*Currency) bool) error

func (*ZipReader) EachDQSystem

func (r *ZipReader) EachDQSystem(fn func(*DQSystem) bool) error

func (*ZipReader) EachEpd

func (r *ZipReader) EachEpd(fn func(*Epd) bool) error

func (*ZipReader) EachFlow

func (r *ZipReader) EachFlow(fn func(*Flow) bool) error

func (*ZipReader) EachFlowProperty

func (r *ZipReader) EachFlowProperty(fn func(*FlowProperty) bool) error

func (*ZipReader) EachImpactCategory

func (r *ZipReader) EachImpactCategory(fn func(*ImpactCategory) bool) error

func (*ZipReader) EachImpactMethod

func (r *ZipReader) EachImpactMethod(fn func(*ImpactMethod) bool) error

func (*ZipReader) EachLocation

func (r *ZipReader) EachLocation(fn func(*Location) bool) error

func (*ZipReader) EachParameter

func (r *ZipReader) EachParameter(fn func(*Parameter) bool) error

func (*ZipReader) EachProcess

func (r *ZipReader) EachProcess(fn func(*Process) bool) error

func (*ZipReader) EachProductSystem

func (r *ZipReader) EachProductSystem(fn func(*ProductSystem) bool) error

func (*ZipReader) EachProject

func (r *ZipReader) EachProject(fn func(*Project) bool) error

func (*ZipReader) EachResult

func (r *ZipReader) EachResult(fn func(*Result) bool) error

func (*ZipReader) EachSocialIndicator

func (r *ZipReader) EachSocialIndicator(fn func(*SocialIndicator) bool) error

func (*ZipReader) EachSource

func (r *ZipReader) EachSource(fn func(*Source) bool) error

func (*ZipReader) EachUnitGroup

func (r *ZipReader) EachUnitGroup(fn func(*UnitGroup) bool) error

func (*ZipReader) ReadActor

func (r *ZipReader) ReadActor(id string) (*Actor, error)

func (*ZipReader) ReadCurrency

func (r *ZipReader) ReadCurrency(id string) (*Currency, error)

func (*ZipReader) ReadDQSystem

func (r *ZipReader) ReadDQSystem(id string) (*DQSystem, error)

func (*ZipReader) ReadEpd

func (r *ZipReader) ReadEpd(id string) (*Epd, error)

func (*ZipReader) ReadFlow

func (r *ZipReader) ReadFlow(id string) (*Flow, error)

func (*ZipReader) ReadFlowProperty

func (r *ZipReader) ReadFlowProperty(id string) (*FlowProperty, error)

func (*ZipReader) ReadImpactCategory

func (r *ZipReader) ReadImpactCategory(id string) (*ImpactCategory, error)

func (*ZipReader) ReadImpactMethod

func (r *ZipReader) ReadImpactMethod(id string) (*ImpactMethod, error)

func (*ZipReader) ReadLocation

func (r *ZipReader) ReadLocation(id string) (*Location, error)

func (*ZipReader) ReadParameter

func (r *ZipReader) ReadParameter(id string) (*Parameter, error)

func (*ZipReader) ReadProcess

func (r *ZipReader) ReadProcess(id string) (*Process, error)

func (*ZipReader) ReadProductSystem

func (r *ZipReader) ReadProductSystem(id string) (*ProductSystem, error)

func (*ZipReader) ReadProject

func (r *ZipReader) ReadProject(id string) (*Project, error)

func (*ZipReader) ReadResult

func (r *ZipReader) ReadResult(id string) (*Result, error)

func (*ZipReader) ReadSocialIndicator

func (r *ZipReader) ReadSocialIndicator(id string) (*SocialIndicator, error)

func (*ZipReader) ReadSource

func (r *ZipReader) ReadSource(id string) (*Source, error)

func (*ZipReader) ReadUnitGroup

func (r *ZipReader) ReadUnitGroup(id string) (*UnitGroup, error)

type ZipWriter

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

func NewZipWriter

func NewZipWriter(filePath string) (*ZipWriter, error)

func (*ZipWriter) Close

func (w *ZipWriter) Close() error

func (*ZipWriter) Write

func (w *ZipWriter) Write(path string, bytes []byte) error

func (*ZipWriter) WriteActor

func (w *ZipWriter) WriteActor(a *Actor) error

func (*ZipWriter) WriteCurrency

func (w *ZipWriter) WriteCurrency(c *Currency) error

func (*ZipWriter) WriteDQSystem

func (w *ZipWriter) WriteDQSystem(d *DQSystem) error

func (*ZipWriter) WriteEpd

func (w *ZipWriter) WriteEpd(e *Epd) error

func (*ZipWriter) WriteFlow

func (w *ZipWriter) WriteFlow(f *Flow) error

func (*ZipWriter) WriteFlowProperty

func (w *ZipWriter) WriteFlowProperty(f *FlowProperty) error

func (*ZipWriter) WriteImpactCategory

func (w *ZipWriter) WriteImpactCategory(l *ImpactCategory) error

func (*ZipWriter) WriteImpactMethod

func (w *ZipWriter) WriteImpactMethod(l *ImpactMethod) error

func (*ZipWriter) WriteLocation

func (w *ZipWriter) WriteLocation(l *Location) error

func (*ZipWriter) WriteParameter

func (w *ZipWriter) WriteParameter(p *Parameter) error

func (*ZipWriter) WriteProcess

func (w *ZipWriter) WriteProcess(p *Process) error

func (*ZipWriter) WriteProductSystem

func (w *ZipWriter) WriteProductSystem(p *ProductSystem) error

func (*ZipWriter) WriteProject

func (w *ZipWriter) WriteProject(p *Project) error

func (*ZipWriter) WriteResult

func (w *ZipWriter) WriteResult(r *Result) error

func (*ZipWriter) WriteSocialIndicator

func (w *ZipWriter) WriteSocialIndicator(s *SocialIndicator) error

func (*ZipWriter) WriteSource

func (w *ZipWriter) WriteSource(s *Source) error

func (*ZipWriter) WriteUnitGroup

func (w *ZipWriter) WriteUnitGroup(u *UnitGroup) error

Jump to

Keyboard shortcuts

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