Documentation ¶
Index ¶
- Variables
- func ReadErrorFromResponse(resp *http.Response) error
- type Migration
- type MigrationsIndexManager
- type MigrationsIndexManagerInterface
- type OpenSearch
- func (o *OpenSearch) Close() error
- func (o *OpenSearch) Drop() error
- func (o *OpenSearch) Lock() error
- func (o *OpenSearch) Open(_ string) (database.Driver, error)
- func (o *OpenSearch) Run(migration io.Reader) error
- func (o *OpenSearch) SetVersion(version int, dirty bool) error
- func (o *OpenSearch) Unlock() error
- func (o *OpenSearch) Version() (version int, dirty bool, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidContent = errors.New("invalid migration content")
)
Functions ¶
func ReadErrorFromResponse ¶
Types ¶
type Migration ¶
type Migration struct { Method string `json:"method"` URL string `json:"url"` Params url.Values `json:"params,omitempty"` Body map[string]any `json:"body,omitempty"` Headers http.Header `json:"headers,omitempty"` }
type MigrationsIndexManager ¶
type MigrationsIndexManager struct {
// contains filtered or unexported fields
}
func NewMigrationsIndexManager ¶
func NewMigrationsIndexManager(transport opensearchapi.Transport) MigrationsIndexManager
func (MigrationsIndexManager) Create ¶
func (m MigrationsIndexManager) Create(name string) error
func (MigrationsIndexManager) Exists ¶
func (m MigrationsIndexManager) Exists(name string) (bool, error)
func (MigrationsIndexManager) Upsert ¶
func (m MigrationsIndexManager) Upsert(name string) error
type OpenSearch ¶
type OpenSearch struct { MigrationSequence []string LastRunMigration []byte // contains filtered or unexported fields }
func NewDriver ¶
func NewDriver( transport opensearchapi.Transport, manager MigrationsIndexManagerInterface, ) *OpenSearch
func (*OpenSearch) Close ¶
func (o *OpenSearch) Close() error
func (*OpenSearch) Drop ¶
func (o *OpenSearch) Drop() error
func (*OpenSearch) Lock ¶
func (o *OpenSearch) Lock() error
func (*OpenSearch) SetVersion ¶
func (o *OpenSearch) SetVersion(version int, dirty bool) error
func (*OpenSearch) Unlock ¶
func (o *OpenSearch) Unlock() error
Click to show internal directories.
Click to hide internal directories.