Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Migrations ¶
migrations := Migrations{
"2023-02-28": []Migration{
Migration{},
Migration{},
},
}
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶
func NewMigrator(from, to *Version, avs []*Version, migrations Migrations) (*Migrator, error)
type RequestMigration ¶
type RequestMigration struct {
Metric *prometheus.HistogramVec
// contains filtered or unexported fields
}
func NewRequestMigration ¶
func NewRequestMigration(opts *RequestMigrationOptions) (*RequestMigration, error)
func (*RequestMigration) RegisterMigrations ¶
func (rm *RequestMigration) RegisterMigrations(migrations Migrations) error
func (*RequestMigration) VersionAPI ¶
func (rm *RequestMigration) VersionAPI(next http.Handler) http.Handler
type RequestMigrationOptions ¶
type RequestMigrationOptions struct {
VersionHeader string
CurrentVersion string
GetUserHeaderFunc GetUserHeaderFunc
VersionFormat VersionFormat
}
type Version ¶
type Version struct {
Format VersionFormat
Value interface{}
}
type VersionFormat ¶
type VersionFormat string
const ( SemverFormat VersionFormat = "semver" DateFormat VersionFormat = "date" )
Click to show internal directories.
Click to hide internal directories.