Documentation ¶
Index ¶
- Constants
- func Connect(ctx context.Context, config *config.PostgresConfig) (*gorm.DB, error)
- func Disconnect(ctx context.Context, db *gorm.DB) error
- func ExecuteFileScript(ctx context.Context, db *gorm.DB, filePath string) error
- func Migrate(ctx context.Context, config *config.PostgresConfig, dir string) error
- type StubDBStore
- func (s *StubDBStore) Create(ctx context.Context, stubs ...*rio.Stub) error
- func (s *StubDBStore) CreateIncomingRequest(ctx context.Context, r *rio.IncomingRequest) error
- func (s *StubDBStore) CreateProto(ctx context.Context, protos ...*rio.Proto) error
- func (s *StubDBStore) Delete(ctx context.Context, id int64) error
- func (s *StubDBStore) Find(ctx context.Context, id int64) (*rio.Stub, error)
- func (s *StubDBStore) GetAll(ctx context.Context, namespace string) ([]*rio.Stub, error)
- func (s *StubDBStore) GetIncomingRequests(ctx context.Context, option *rio.IncomingQueryOption) ([]*rio.IncomingRequest, error)
- func (s *StubDBStore) GetLastUpdatedProto(ctx context.Context) (*rio.LastUpdatedRecord, error)
- func (s *StubDBStore) GetLastUpdatedStub(ctx context.Context, namespace string) (*rio.LastUpdatedRecord, error)
- func (s *StubDBStore) GetProtos(ctx context.Context) ([]*rio.Proto, error)
- func (s *StubDBStore) Reset(ctx context.Context, option *rio.ResetQueryOption) error
Constants ¶
View Source
const LatestVersion = 3
The stub schema version
Variables ¶
This section is empty.
Functions ¶
func Disconnect ¶
Disconnect closes the connections to the MySQL database
func ExecuteFileScript ¶
ExecuteFileScript runs a specific migration file on a MySQL database using specific path
Types ¶
type StubDBStore ¶
type StubDBStore struct {
// contains filtered or unexported fields
}
StubDBStore stores stub information to database
func NewStubDBStore ¶
func NewStubDBStore(ctx context.Context, config *config.PostgresConfig) (*StubDBStore, error)
NewStubDBStore init a new instance for storage
func (*StubDBStore) CreateIncomingRequest ¶
func (s *StubDBStore) CreateIncomingRequest(ctx context.Context, r *rio.IncomingRequest) error
CreateIncomingRequest saves the income request
func (*StubDBStore) CreateProto ¶
CreateProto creates new protos
func (*StubDBStore) Delete ¶
func (s *StubDBStore) Delete(ctx context.Context, id int64) error
Delete marks record as inactive
func (*StubDBStore) GetIncomingRequests ¶
func (s *StubDBStore) GetIncomingRequests(ctx context.Context, option *rio.IncomingQueryOption) ([]*rio.IncomingRequest, error)
GetIncomingRequests finds a income request by id
func (*StubDBStore) GetLastUpdatedProto ¶
func (s *StubDBStore) GetLastUpdatedProto(ctx context.Context) (*rio.LastUpdatedRecord, error)
func (*StubDBStore) GetLastUpdatedStub ¶
func (s *StubDBStore) GetLastUpdatedStub(ctx context.Context, namespace string) (*rio.LastUpdatedRecord, error)
func (*StubDBStore) Reset ¶
func (s *StubDBStore) Reset(ctx context.Context, option *rio.ResetQueryOption) error
Reset clear data
Click to show internal directories.
Click to hide internal directories.