model

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package model provides the pattern templates for svgpattern.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	Name string
	Code string
}

Model represent a go-template model with name and svg code.

type Models

type Models []Model

Models is just a list of models.

var EmbeddedModels Models

EmbeddedModels is the list of all available models.

func (Models) GetModelIndex added in v0.3.0

func (models Models) GetModelIndex(name string) (index int, ok bool)

GetModelIndex provides index in Models list of the desired model. If the model is not found the ok is false and indes is -1

func (Models) ModelsString added in v0.3.0

func (models Models) ModelsString() string

ModelsString provide the list of all available models as string.

func (Models) SelectModels added in v0.3.0

func (models Models) SelectModels(names ...string) (newModels Models, invalid []string)

SelectModels provides a list of models from the given list of names. If a name is not found in the list of available models it is added to the invalid list.

func (*Models) SetModel added in v0.3.0

func (models *Models) SetModel(name string, code string)

SetModel append or replace an existing model.

Jump to

Keyboard shortcuts

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