Documentation
¶
Index ¶
- type Field
- type FieldKey
- type Fields
- type Lots
- type LotsClient
- func (l *LotsClient) ByUser(ctx context.Context, userID int64) (map[NodeID][]OfferID, error)
- func (l *LotsClient) FieldsByNodeID(ctx context.Context, nodeID NodeID) (Fields, error)
- func (l *LotsClient) FieldsByOfferID(ctx context.Context, offerID OfferID) (Fields, error)
- func (l *LotsClient) List() map[NodeID][]OfferID
- func (l *LotsClient) Save(ctx context.Context, fields Fields) error
- func (l *LotsClient) Update(ctx context.Context) error
- type NodeID
- type OfferID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lots ¶
type Lots interface {
// Save makes request to /lots/offerSave. Use [Lots.Fields] to get fields.
//
// Fields:
// - Provide offer_id to update lot;
// - Set offer_id = "0" to create lot;
// - Set deleted = "1" to delete lot.
Save(ctx context.Context, fields Fields) error
// Fields loads [Fields] for [OfferID]. Values will be filled with provided offerID.
FieldsByOfferID(ctx context.Context, offerID OfferID) (Fields, error)
// FieldsByNodeID loads [Fields] for [NodeID].
FieldsByNodeID(ctx context.Context, nodeID NodeID) (Fields, error)
// ByUser gets lots for provided userID. Key represents nodeID, value represents slice of offerIDs.
ByUser(ctx context.Context, userID int64) (map[NodeID][]OfferID, error)
// Update updates lots for current account. Use [Lots.List] to get loaded lots.
// Returns [funpay.ErrAccountUnauthorized] if user id equals 0. Call [Funpay.Update] to update account info.
Update(ctx context.Context) error
// List returns loaded lots (see [Lots.Update]).
List() map[NodeID][]OfferID
}
type LotsClient ¶
type LotsClient struct {
// contains filtered or unexported fields
}
func (*LotsClient) FieldsByNodeID ¶ added in v0.4.0
func (*LotsClient) FieldsByOfferID ¶ added in v0.4.0
func (*LotsClient) List ¶
func (l *LotsClient) List() map[NodeID][]OfferID
Click to show internal directories.
Click to hide internal directories.