Documentation ¶
Overview ¶
Copyright 2021 Wei (Sam) Wang <sam.wang.0723@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 Wei (Sam) Wang <sam.wang.0723@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 Wei (Sam) Wang <sam.wang.0723@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 Wei (Sam) Wang <sam.wang.0723@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 Wei (Sam) Wang <sam.wang.0723@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 Wei (Sam) Wang <sam.wang.0723@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 Wei (Sam) Wang <sam.wang.0723@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoPickedStock = errors.New("no picked stock")
var ErrUnknownOrderType = errors.New("unknown order type")
Functions ¶
Types ¶
type BalanceLoaderSaver ¶
type BalanceLoaderSaver struct {
// contains filtered or unexported fields
}
func (*BalanceLoaderSaver) Load ¶
func (bls *BalanceLoaderSaver) Load(ctx context.Context, id uint64) (eventsourcing.Aggregate, error)
func (*BalanceLoaderSaver) Save ¶
func (bls *BalanceLoaderSaver) Save(ctx context.Context, aggregate eventsourcing.Aggregate) error
type BalanceRepository ¶
type BalanceRepository struct {
// contains filtered or unexported fields
}
func NewBalanceRepository ¶
func NewBalanceRepository(dbPool *gorm.DB) *BalanceRepository
func (*BalanceRepository) Load ¶
func (br *BalanceRepository) Load(ctx context.Context, id uint64) (*entity.BalanceView, error)
func (*BalanceRepository) LoadForUpdate ¶
func (br *BalanceRepository) LoadForUpdate(ctx context.Context, id uint64) (*entity.BalanceView, error)
func (*BalanceRepository) Save ¶
func (br *BalanceRepository) Save(ctx context.Context, balanceView *entity.BalanceView) error
type NotEnoughBalanceError ¶
type NotEnoughBalanceError struct{}
func (*NotEnoughBalanceError) Error ¶
func (e *NotEnoughBalanceError) Error() string
type Option ¶
type Option func(o *dalImpl)
func WithBalanceRepository ¶
func WithBalanceRepository(balanceRepository *BalanceRepository) Option
func WithOrderRepository ¶
func WithOrderRepository(orderRepository *OrderRepository) Option
func WithTransactionRepository ¶
func WithTransactionRepository(transactionRepository *TransactionRepository) Option
type OrderLoaderSaver ¶
type OrderLoaderSaver struct {
// contains filtered or unexported fields
}
func (*OrderLoaderSaver) Load ¶
func (ols *OrderLoaderSaver) Load(ctx context.Context, id uint64) (eventsourcing.Aggregate, error)
func (*OrderLoaderSaver) Save ¶
func (ols *OrderLoaderSaver) Save(ctx context.Context, aggregate eventsourcing.Aggregate) error
type OrderRepository ¶
type OrderRepository struct {
// contains filtered or unexported fields
}
func NewOrderRepository ¶
func NewOrderRepository(dbPool *gorm.DB) *OrderRepository
type TransactionLoaderSaver ¶
type TransactionLoaderSaver struct {
// contains filtered or unexported fields
}
func (*TransactionLoaderSaver) Load ¶
func (tls *TransactionLoaderSaver) Load(ctx context.Context, id uint64) (eventsourcing.Aggregate, error)
func (*TransactionLoaderSaver) Save ¶
func (tls *TransactionLoaderSaver) Save(ctx context.Context, aggregate eventsourcing.Aggregate) error
type TransactionRepository ¶
type TransactionRepository struct {
// contains filtered or unexported fields
}
func NewTransactionRepository ¶
func NewTransactionRepository(dbPool *gorm.DB) *TransactionRepository
func (*TransactionRepository) Load ¶
func (tr *TransactionRepository) Load(ctx context.Context, id uint64) (*entity.Transaction, error)
func (*TransactionRepository) Save ¶
func (tr *TransactionRepository) Save(ctx context.Context, transactionRequest *entity.Transaction) error
type TypeMismatchError ¶
type TypeMismatchError struct {
// contains filtered or unexported fields
}
func (*TypeMismatchError) Error ¶
func (tme *TypeMismatchError) Error() string