dal

package
v0.0.0-...-24cbbce Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

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

View Source
var ErrNoPickedStock = errors.New("no picked stock")
View Source
var ErrUnknownOrderType = errors.New("unknown order type")

Functions

func New

func New(opts ...Option) idal.IDAL

functional options design pattern

Types

type BalanceLoaderSaver

type BalanceLoaderSaver struct {
	// contains filtered or unexported fields
}

func (*BalanceLoaderSaver) Load

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 (*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 WithDB

func WithDB(db *gorm.DB) 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 (*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

func (*OrderRepository) Load

func (tr *OrderRepository) Load(ctx context.Context, id uint64) (*entity.Order, error)

func (*OrderRepository) Save

func (tr *OrderRepository) Save(ctx context.Context, orderRequest *entity.Order) error

type TransactionLoaderSaver

type TransactionLoaderSaver struct {
	// contains filtered or unexported fields
}

func (*TransactionLoaderSaver) Load

func (*TransactionLoaderSaver) Save

type TransactionRepository

type TransactionRepository struct {
	// contains filtered or unexported fields
}

func NewTransactionRepository

func NewTransactionRepository(dbPool *gorm.DB) *TransactionRepository

func (*TransactionRepository) Load

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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