models

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package models contains models used by the application

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileArgumentFlag

type FileArgumentFlag []string

FileArgumentFlag is a custom type that is used to store the file arguments

func (*FileArgumentFlag) Set

func (w *FileArgumentFlag) Set(value string) error

Set is used to implement the flag.Value interface

func (*FileArgumentFlag) String

func (w *FileArgumentFlag) String() string

String is used to implement the flag.Value interface

type FileSystem

type FileSystem interface {
	ReadFile(filename string) ([]byte, error)
}

FileSystem is an interface that is used to read files from the file system This is used to allow the application to read files from the real file system or from a mock file system for testing

type IntRange

type IntRange struct {
	Start, End int
}

IntRange is used to store the start and end of the range of integers. These are used to generate the insert and overwrite rules. The intention is to provide a way to define the range of integers in a structured way.

func (*IntRange) Set

func (i *IntRange) Set(value string) error

Set is used to implement the flag.Value interface

func (*IntRange) String

func (i *IntRange) String() string

NewIntRange is used to create a new IntRange object

type MockFileSystem

type MockFileSystem struct {
	Files map[string][]byte
}

MockFileSystem is used to read files from the mock file system

func (*MockFileSystem) ReadFile

func (m *MockFileSystem) ReadFile(filename string) ([]byte, error)

ReadFile Implements the ReadFile method of the FileSystem interface for the MockFileSystem

type MockScanner

type MockScanner struct {
	Lines []string
	Index int
}

MockScanner is used to read lines from a mock file for testing

func (*MockScanner) Err

func (m *MockScanner) Err() error

Err implements the Err method of the Scanner interface for the MockScanner

func (*MockScanner) Scan

func (m *MockScanner) Scan() bool

Scan implements the Scan, Text, and Err methods of the Scanner interface for the MockScanner

func (*MockScanner) Text

func (m *MockScanner) Text() string

Text implements the Text method of the Scanner interface for the MockScanner

type Pair

type Pair struct {
	Key   string
	Value int
}

Pair is used to store the key value pair of the map[string]int

type PairList

type PairList []Pair

PairList is a slice of Pairs that implements sort.Interface to sort by Value

func (PairList) Len

func (p PairList) Len() int

func (PairList) Less

func (p PairList) Less(i, j int) bool

func (PairList) Swap

func (p PairList) Swap(i, j int)

type RealFileSystem

type RealFileSystem struct{}

RealFileSystem is used to read files from the real file system

func (*RealFileSystem) ReadFile

func (r *RealFileSystem) ReadFile(filename string) ([]byte, error)

ReadFile is used to read a file from the real file system

type Scanner

type Scanner interface {
	Scan() bool
	Text() string
	Err() error
}

Scanner is an interface that is used to read lines from a file

type TemplateFileOperation added in v0.2.0

type TemplateFileOperation struct {
	StartIndex         int
	EndIndex           int
	Verbose            bool
	ReplacementMask    string
	Bypass             bool
	TransformationMode string
}

TemplateFileOperation is used to store the transformation operations loaded from JSON template files. The intention is to provide a way to define the operations in a structured way.

Jump to

Keyboard shortcuts

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