dms

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertModelsEquivalent

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

Types

type Attribute

type Attribute struct {
	Attribute string `yaml:"attribute" json:"attribute"`
	Type      string `yaml:"type" json:"type"`
	Format    string `yaml:"format" json:"format"`

	Encryption any      `yaml:"encryption" json:"encryption"`
	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 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"`
	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"`
}

Jump to

Keyboard shortcuts

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