dms

package
v6.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertModelsEquivalent

func AssertModelsEquivalent(got, want Model, opts CompareOptions) error

func Generate

func Generate(doc *Document, opts GenerateOptions) ([]byte, error)

Types

type Attribute

type Attribute struct {
	Encryption     any      `yaml:"encryption" json:"encryption"`
	Attribute      string   `yaml:"attribute" json:"attribute"`
	Type           string   `yaml:"type" json:"type"`
	Format         string   `yaml:"format" json:"format"`
	JsonStringMode string   `yaml:"json_string_mode" json:"json_string_mode,omitempty"`
	Roles          []string `yaml:"roles" json:"roles"`
	Required       bool     `yaml:"required" json:"required"`
	Optional       bool     `yaml:"optional" json:"optional"`
	OmitEmpty      bool     `yaml:"omit_empty" json:"omit_empty"`
	JSON           bool     `yaml:"json" json:"json"`
	Binary         bool     `yaml:"binary" json:"binary"`
}

type CompareOptions

type CompareOptions struct {
	IgnoreTableName bool
}

type Document

type Document struct {
	DMSVersion string  `yaml:"dms_version" json:"dms_version"`
	Namespace  string  `yaml:"namespace" json:"namespace"`
	Models     []Model `yaml:"models" json:"models"`
}

func ParseDocument

func ParseDocument(data []byte) (*Document, error)

type GenerateOptions

type GenerateOptions struct {
	Lang          string
	PackageName   string
	ModelName     string
	RuntimeImport string
}

type Index

type Index struct {
	Name       string        `yaml:"name" json:"name"`
	Type       string        `yaml:"type" json:"type"` // GSI | LSI
	Partition  KeyAttribute  `yaml:"partition" json:"partition"`
	Sort       *KeyAttribute `yaml:"sort" json:"sort"`
	Projection Projection    `yaml:"projection" json:"projection"`
}

type KeyAttribute

type KeyAttribute struct {
	Attribute string `yaml:"attribute" json:"attribute"`
	Type      string `yaml:"type" json:"type"`
}

type Keys

type Keys struct {
	Sort      *KeyAttribute `yaml:"sort" json:"sort"`
	Partition KeyAttribute  `yaml:"partition" json:"partition"`
}

type Model

type Model struct {
	Name        string      `yaml:"name" json:"name"`
	Table       Table       `yaml:"table" json:"table"`
	Naming      Naming      `yaml:"naming" json:"naming"`
	Keys        Keys        `yaml:"keys" json:"keys"`
	WritePolicy WritePolicy `yaml:"write_policy" json:"write_policy"`
	Attributes  []Attribute `yaml:"attributes" json:"attributes"`
	Indexes     []Index     `yaml:"indexes" json:"indexes"`
}

func FindModel

func FindModel(doc *Document, name string) (*Model, bool)

func FromMetadata

func FromMetadata(meta *model.Metadata) (Model, error)

type Naming

type Naming struct {
	Convention string `yaml:"convention" json:"convention"`
}

type Projection

type Projection struct {
	Type   string   `yaml:"type" json:"type"` // ALL | KEYS_ONLY | INCLUDE
	Fields []string `yaml:"fields" json:"fields"`
}

type Table

type Table struct {
	Name string `yaml:"name" json:"name"`
}

type WritePolicy

type WritePolicy struct {
	Mode                string   `yaml:"mode" json:"mode"`
	ProtectedAttributes []string `yaml:"protected_attributes" json:"protected_attributes"`
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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