data

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DispatchStorage

func DispatchStorage(storage StorageType, table StorageFuncTable)

func DispatchTarget

func DispatchTarget(target TargetType, table TargetFuncTable)

Types

type DataSyncType added in v0.1.0

type DataSyncType struct {
	Version   string        `json:"version"`
	Histories []VersionType `json:"histories"`
}

---------------------

type SettingType

type SettingType struct {
	Targets []TargetType
	Storage StorageType
}

type StorageFuncTable

type StorageFuncTable struct {
	Gcs StorageGcsFunc
}

type StorageGcsFunc

type StorageGcsFunc func(config StorageGcsType)

--------------------- storage funcs

type StorageGcsType

type StorageGcsType struct {
	Bucket string
	Dir    string
}

type StorageType

type StorageType struct {
	Kind   string
	Config interface{}
}

type TargetFileFunc added in v0.1.0

type TargetFileFunc func(config TargetFileType)

type TargetFileType added in v0.1.0

type TargetFileType struct {
	Path string
}

type TargetFuncTable

type TargetFuncTable struct {
	Mysql TargetMysqlFunc
	File  TargetFileFunc
}

type TargetMysqlFunc

type TargetMysqlFunc func(config TargetMysqlType)

--------------------- target funcs

type TargetMysqlType

type TargetMysqlType struct {
	Host     string `default:"localhost"`
	Port     int    `default:"3306"`
	User     string `default:"root"`
	Password string `default:""`
	Database string
}

type TargetType

type TargetType struct {
	Kind   string
	Config interface{}
}

type VersionType

type VersionType struct {
	Id      string `json:"id"`
	Time    int64  `json:"time"`
	Message string `json:"message"`
}

func (VersionType) FileName added in v1.1.0

func (v VersionType) FileName() string

func (VersionType) FileNameWithDir added in v1.1.0

func (v VersionType) FileNameWithDir(dir string) string

Jump to

Keyboard shortcuts

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