gotemporal

package module
v0.0.0-...-066368f Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 6 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.

README

Golang Temporal Model with ORM

Goals

  • Managing document versions with timestamps (in the case of bitemporal, two for valid time and two for system time).
  • Organizing documents into collections so that they can be effectively sliced and diced.
  • Support Uni-Temporal

Structure

├── LICENSE
├── README.md
├── bitemporal
│   ├── bi.go
│   ├── bi_gormer.go
│   └── collection.go
├── errors.go
├── example
├── go.mod
├── go.sum
├── gorm_callbacks.go
├── gotemporal.go
├── model.go
└── unitemporal
    ├── sys_uni_gormer.go
    └── uni.go

Models

  • Bi-temporal
  • Uni-temporal with system time
  • Uni-temporal with valid time

ORM

  • GORM
  • XORM

Referrence

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

All errors for every gotemporal packages

Functions

func GenTID

func GenTID() string

func SysToIsNull

func SysToIsNull(table string) func(d *gorm.DB) *gorm.DB

SysToIsNull where code = <input value>

func ValidToIsNull

func ValidToIsNull(table string) func(d *gorm.DB) *gorm.DB

ValidToIsNull where the valid_to column is NULL

func WithID

func WithID(id IDer) func(d *gorm.DB) *gorm.DB

WithID where id = <input value>

func WithSysAt

func WithSysAt(sysAt time.Time) func(d *gorm.DB) *gorm.DB

WithSysAt where code = <input value>

func WithTID

func WithTID(tid TIDer) func(d *gorm.DB) *gorm.DB

WithTID where biid = <input value>

func WithValidAt

func WithValidAt(validAt time.Time) func(d *gorm.DB) *gorm.DB

WithValidAt where code = <input value>

Types

type IDer

type IDer interface {
	GetID() uint64
}

type TIDer

type TIDer interface {
	GetTID() string
	SetTID(string)
}

type Temporal

type Temporal interface {
	// contains filtered or unexported methods
}

type TemporalModel

type TemporalModel interface {
	IDer
	TIDer

	Clean()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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