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.
Index ¶
- Constants
- func BalanceToPB(in *domain.BalanceView) *pb.Balance
- func CreateOrderResponseToPB(in *CreateOrderResponse) *pb.CreateOrderResponse
- func CreateTransactionResponseToPB(in *CreateTransactionResponse) *pb.CreateTransactionResponse
- func CreateUserResponseToPB(in *CreateUserResponse) *pb.CreateUserResponse
- func DailyCloseToPB(in *domain.DailyClose) *pb.DailyClose
- func DeletePickedStocksResponseToPB(in *DeletePickedStocksResponse) *pb.DeletePickedStocksResponse
- func GetBalanceResponseToPB(in *domain.BalanceView) *pb.GetBalanceResponse
- func GetStakeConcentrationResponseToPB(in *domain.StakeConcentration) *pb.GetStakeConcentrationResponse
- func InsertPickedStocksResponseToPB(in *InsertPickedStocksResponse) *pb.InsertPickedStocksResponse
- func ListCategoriesResponseToPB(in *ListCategoriesResponse) *pb.ListCategoriesResponse
- func ListDailyCloseResponseToPB(in *ListDailyCloseResponse) *pb.ListDailyCloseResponse
- func ListOrderResponseToPB(in *ListOrderResponse) *pb.ListOrderResponse
- func ListPickedStocksResponseToPB(in *ListPickedStocksResponse) *pb.ListPickedStocksResponse
- func ListSelectionResponseToPB(in *ListSelectionResponse) *pb.ListSelectionResponse
- func ListStockResponseToPB(in *ListStockResponse) *pb.ListStockResponse
- func ListThreePrimaryResponseToPB(in *ListThreePrimaryResponse) *pb.ListThreePrimaryResponse
- func ListUsersResponseToPB(in *ListUsersResponse) *pb.ListUsersResponse
- func LoginResponseToPB(in *LoginResponse) *pb.LoginResponse
- func LogoutResponseToPB(in *LogoutResponse) *pb.LogoutResponse
- func MapToProtobufStructFloat32(m map[int]float32) *structpb.Struct
- func MapToProtobufStructUint64(m map[int]uint64) *structpb.Struct
- func OrderToPB(in *domain.Order) *pb.Order
- func SelectionToPB(in *domain.Selection) *pb.Selection
- func StockToPB(in *domain.Stock) *pb.Stock
- func ThreePrimaryToPB(in *domain.ThreePrimary) *pb.ThreePrimary
- func UserToPB(in *domain.User) *pb.User
- type CreateOrderRequest
- type CreateOrderResponse
- type CreateTransactionRequest
- type CreateTransactionResponse
- type CreateUserRequest
- type CreateUserResponse
- type DeletePickedStocksRequest
- type DeletePickedStocksResponse
- type GetBalanceViewRequest
- type GetBalanceViewResponse
- type GetStakeConcentrationRequest
- type InsertPickedStocksRequest
- type InsertPickedStocksResponse
- type ListCategoriesResponse
- type ListDailyCloseRequest
- type ListDailyCloseResponse
- type ListDailyCloseSearchParams
- type ListOrderRequest
- type ListOrderResponse
- type ListOrderSearchParams
- type ListPickedStocksResponse
- type ListSelectionRequest
- type ListSelectionResponse
- type ListStockRequest
- type ListStockResponse
- type ListStockSearchParams
- type ListThreePrimaryRequest
- type ListThreePrimaryResponse
- type ListThreePrimarySearchParams
- type ListUsersRequest
- type ListUsersResponse
- type LoginRequest
- type LoginResponse
- type LogoutResponse
Constants ¶
const ( StatusSuccess = 200 StatusBadRequest = 400 StatusError = 500 )
Variables ¶
This section is empty.
Functions ¶
func BalanceToPB ¶
func BalanceToPB(in *domain.BalanceView) *pb.Balance
func CreateOrderResponseToPB ¶
func CreateOrderResponseToPB(in *CreateOrderResponse) *pb.CreateOrderResponse
func CreateTransactionResponseToPB ¶
func CreateTransactionResponseToPB(in *CreateTransactionResponse) *pb.CreateTransactionResponse
func CreateUserResponseToPB ¶
func CreateUserResponseToPB(in *CreateUserResponse) *pb.CreateUserResponse
func DailyCloseToPB ¶
func DailyCloseToPB(in *domain.DailyClose) *pb.DailyClose
func DeletePickedStocksResponseToPB ¶
func DeletePickedStocksResponseToPB(in *DeletePickedStocksResponse) *pb.DeletePickedStocksResponse
func GetBalanceResponseToPB ¶
func GetBalanceResponseToPB(in *domain.BalanceView) *pb.GetBalanceResponse
func GetStakeConcentrationResponseToPB ¶
func GetStakeConcentrationResponseToPB( in *domain.StakeConcentration, ) *pb.GetStakeConcentrationResponse
func InsertPickedStocksResponseToPB ¶
func InsertPickedStocksResponseToPB(in *InsertPickedStocksResponse) *pb.InsertPickedStocksResponse
func ListCategoriesResponseToPB ¶
func ListCategoriesResponseToPB(in *ListCategoriesResponse) *pb.ListCategoriesResponse
func ListDailyCloseResponseToPB ¶
func ListDailyCloseResponseToPB(in *ListDailyCloseResponse) *pb.ListDailyCloseResponse
func ListOrderResponseToPB ¶
func ListOrderResponseToPB(in *ListOrderResponse) *pb.ListOrderResponse
func ListPickedStocksResponseToPB ¶
func ListPickedStocksResponseToPB(in *ListPickedStocksResponse) *pb.ListPickedStocksResponse
func ListSelectionResponseToPB ¶
func ListSelectionResponseToPB(in *ListSelectionResponse) *pb.ListSelectionResponse
func ListStockResponseToPB ¶
func ListStockResponseToPB(in *ListStockResponse) *pb.ListStockResponse
func ListThreePrimaryResponseToPB ¶
func ListThreePrimaryResponseToPB(in *ListThreePrimaryResponse) *pb.ListThreePrimaryResponse
func ListUsersResponseToPB ¶
func ListUsersResponseToPB(in *ListUsersResponse) *pb.ListUsersResponse
func LoginResponseToPB ¶
func LoginResponseToPB(in *LoginResponse) *pb.LoginResponse
func LogoutResponseToPB ¶
func LogoutResponseToPB(in *LogoutResponse) *pb.LogoutResponse
func ThreePrimaryToPB ¶
func ThreePrimaryToPB(in *domain.ThreePrimary) *pb.ThreePrimary
Types ¶
type CreateOrderRequest ¶
type CreateOrderRequest struct { OrderType string `json:"orderType"` StockID string `json:"stockID"` ExchangeDate string `json:"exchangeDate"` TradePrice float32 `json:"tradePrice"` Quantity uint64 `json:"quantity"` }
func CreateOrderRequestFromPB ¶
func CreateOrderRequestFromPB(in *pb.CreateOrderRequest) *CreateOrderRequest
type CreateOrderResponse ¶
type CreateTransactionRequest ¶
type CreateTransactionRequest struct { OrderType string `json:"orderType"` Amount float32 `json:"amount"` }
func CreateTransactionRequestFromPB ¶
func CreateTransactionRequestFromPB(in *pb.CreateTransactionRequest) *CreateTransactionRequest
type CreateUserRequest ¶
type CreateUserRequest struct { Email string `json:"email"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Phone string `json:"phone"` Password string `json:"password"` Recaptcha string `json:"recaptcha"` }
func CreateUserRequestFromPB ¶
func CreateUserRequestFromPB(in *pb.CreateUserRequest) *CreateUserRequest
type CreateUserResponse ¶
type DeletePickedStocksRequest ¶
type DeletePickedStocksRequest struct {
StockID string `json:"stockID"`
}
func DeletePickedStocksRequestFromPB ¶
func DeletePickedStocksRequestFromPB(in *pb.DeletePickedStocksRequest) *DeletePickedStocksRequest
type GetBalanceViewRequest ¶
type GetBalanceViewRequest struct{}
func GetBalanceRequestFromPB ¶
func GetBalanceRequestFromPB(in *pb.GetBalanceRequest) *GetBalanceViewRequest
type GetBalanceViewResponse ¶
type GetBalanceViewResponse struct {
Balance *domain.BalanceView `json:"balance"`
}
type GetStakeConcentrationRequest ¶
type GetStakeConcentrationRequest struct { StockID string `json:"stockID"` Date string `json:"date"` }
func GetStakeConcentrationRequestFromPB ¶
func GetStakeConcentrationRequestFromPB( in *pb.GetStakeConcentrationRequest, ) *GetStakeConcentrationRequest
type InsertPickedStocksRequest ¶
type InsertPickedStocksRequest struct {
StockIDs []string `json:"stockIDs"`
}
func InsertPickedStocksRequestFromPB ¶
func InsertPickedStocksRequestFromPB(in *pb.InsertPickedStocksRequest) *InsertPickedStocksRequest
type ListCategoriesResponse ¶
type ListCategoriesResponse struct {
Entries []string `json:"entries"`
}
type ListDailyCloseRequest ¶
type ListDailyCloseRequest struct { SearchParams *ListDailyCloseSearchParams `json:"searchParams"` Offset int32 `json:"offset"` Limit int32 `json:"limit"` }
func ListDailyCloseRequestFromPB ¶
func ListDailyCloseRequestFromPB(in *pb.ListDailyCloseRequest) *ListDailyCloseRequest
type ListDailyCloseResponse ¶
type ListDailyCloseResponse struct { Entries []*domain.DailyClose `json:"entries"` Offset int32 `json:"offset"` Limit int32 `json:"limit"` TotalCount int64 `json:"totalCount"` }
type ListOrderRequest ¶
type ListOrderRequest struct { SearchParams *ListOrderSearchParams `json:"searchParams"` Offset int32 `json:"offset"` Limit int32 `json:"limit"` }
func ListOrderRequestFromPB ¶
func ListOrderRequestFromPB(in *pb.ListOrderRequest) *ListOrderRequest
type ListOrderResponse ¶
type ListOrderSearchParams ¶
type ListOrderSearchParams struct { StockIDs *[]string `json:"stockIDs,omitempty"` ExchangeMonth *string `json:"exchangeMonth,omitempty"` Status *string `json:"status,omitempty"` }
func ListOrderSearchParamsFromPB ¶
func ListOrderSearchParamsFromPB(in *pb.ListOrderSearchParams) *ListOrderSearchParams
type ListSelectionRequest ¶
func ListSelectionRequestFromPB ¶
func ListSelectionRequestFromPB(in *pb.ListSelectionRequest) *ListSelectionRequest
type ListSelectionResponse ¶
type ListStockRequest ¶
type ListStockRequest struct { SearchParams *ListStockSearchParams `json:"searchParams"` Offset int32 `json:"offset"` Limit int32 `json:"limit"` }
func ListStockRequestFromPB ¶
func ListStockRequestFromPB(in *pb.ListStockRequest) *ListStockRequest
type ListStockResponse ¶
type ListStockSearchParams ¶
type ListThreePrimaryRequest ¶
type ListThreePrimaryRequest struct { SearchParams *ListThreePrimarySearchParams `json:"searchParams"` Offset int32 `json:"offset"` Limit int32 `json:"limit"` }
func ListThreePrimaryRequestFromPB ¶
func ListThreePrimaryRequestFromPB(in *pb.ListThreePrimaryRequest) *ListThreePrimaryRequest
type ListThreePrimaryResponse ¶
type ListThreePrimaryResponse struct { Entries []*domain.ThreePrimary `json:"entries"` Offset int32 `json:"offset"` Limit int32 `json:"limit"` TotalCount int64 `json:"totalCount"` }
type ListThreePrimarySearchParams ¶
type ListThreePrimarySearchParams struct { End *string `json:"end,omitempty"` StockID string `json:"stockID,omitempty"` Start string `json:"start"` }
func ListThreePrimarySearchParamsFromPB ¶
func ListThreePrimarySearchParamsFromPB( in *pb.ListThreePrimarySearchParams, ) *ListThreePrimarySearchParams
type ListUsersRequest ¶
func ListUsersRequestFromPB ¶
func ListUsersRequestFromPB(in *pb.ListUsersRequest) *ListUsersRequest
type ListUsersResponse ¶
type LoginRequest ¶
func LoginRequestFromPB ¶
func LoginRequestFromPB(in *pb.LoginRequest) *LoginRequest