Documentation ¶
Index ¶
- Constants
- Variables
- type CreateProfileParams
- type CreateProfileTxParams
- type CreateProfileTxResult
- type CreateReferralParams
- type DBTX
- type Error
- type GetProfileTxParams
- type GetProfileTxResult
- type ListProfilesParams
- type ListReferralsParams
- type Profile
- type Querier
- type Queries
- func (q *Queries) CreateProfile(ctx context.Context, arg CreateProfileParams) (Profile, error)
- func (q *Queries) CreateReferral(ctx context.Context, arg CreateReferralParams) (Referral, error)
- func (q *Queries) DeleteProfile(ctx context.Context, walletAddress string) error
- func (q *Queries) GetProfile(ctx context.Context, walletAddress string) (Profile, error)
- func (q *Queries) GetProfilesCount(ctx context.Context) (int64, error)
- func (q *Queries) GetReferralsCount(ctx context.Context, referrer string) (int64, error)
- func (q *Queries) GetReferrer(ctx context.Context, referee string) (Referral, error)
- func (q *Queries) ListProfiles(ctx context.Context, arg ListProfilesParams) ([]Profile, error)
- func (q *Queries) ListReferrals(ctx context.Context, arg ListReferralsParams) ([]Referral, error)
- func (q *Queries) UpdateProfile(ctx context.Context, arg UpdateProfileParams) (Profile, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Referral
- type SQLStore
- func (store *SQLStore) CreateProfileTx(ctx context.Context, params CreateProfileTxParams) (CreateProfileTxResult, error)
- func (store *SQLStore) GetProfileTx(ctx context.Context, params GetProfileTxParams) (GetProfileTxResult, error)
- func (store *SQLStore) UpdateProfileTx(ctx context.Context, params UpdateProfileTxParams) (UpdateProfileTxResult, error)
- type Store
- type UpdateProfileParams
- type UpdateProfileTxParams
- type UpdateProfileTxResult
Constants ¶
View Source
const UniqueViolationCode = "23505"
Variables ¶
View Source
var ( UserProfileAlreadyExistsError = errors.New("user profile already exists") GamerTagAlreadyInUseError = errors.New("gamer tag already in use") UserAlreadyReferredError = errors.New("user already referred") ReferrerDoesNotExistError = errors.New("referrer does not exist") SelfReferralError = errors.New("self referrals not permitted") )
View Source
var RecordNotFoundError = pgx.ErrNoRows
Functions ¶
This section is empty.
Types ¶
type CreateProfileParams ¶
type CreateProfileTxParams ¶
type CreateProfileTxParams struct { CreateProfileParams Referrer string AfterCreate func() error }
type CreateProfileTxResult ¶
type CreateReferralParams ¶
type Error ¶
func ParseError ¶
type GetProfileTxParams ¶
type GetProfileTxResult ¶
type ListProfilesParams ¶
type ListReferralsParams ¶
type Querier ¶
type Querier interface { CreateProfile(ctx context.Context, arg CreateProfileParams) (Profile, error) CreateReferral(ctx context.Context, arg CreateReferralParams) (Referral, error) DeleteProfile(ctx context.Context, walletAddress string) error GetProfile(ctx context.Context, walletAddress string) (Profile, error) GetProfilesCount(ctx context.Context) (int64, error) GetReferralsCount(ctx context.Context, referrer string) (int64, error) GetReferrer(ctx context.Context, referee string) (Referral, error) ListProfiles(ctx context.Context, arg ListProfilesParams) ([]Profile, error) ListReferrals(ctx context.Context, arg ListReferralsParams) ([]Referral, error) UpdateProfile(ctx context.Context, arg UpdateProfileParams) (Profile, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateProfile ¶
func (*Queries) CreateReferral ¶
func (*Queries) DeleteProfile ¶
func (*Queries) GetProfile ¶
func (*Queries) GetProfilesCount ¶
func (*Queries) GetReferralsCount ¶
func (*Queries) GetReferrer ¶
func (*Queries) ListProfiles ¶
func (*Queries) ListReferrals ¶
func (*Queries) UpdateProfile ¶
type SQLStore ¶
type SQLStore struct { *Queries // contains filtered or unexported fields }
func (*SQLStore) CreateProfileTx ¶
func (store *SQLStore) CreateProfileTx(ctx context.Context, params CreateProfileTxParams) (CreateProfileTxResult, error)
func (*SQLStore) GetProfileTx ¶
func (store *SQLStore) GetProfileTx(ctx context.Context, params GetProfileTxParams) (GetProfileTxResult, error)
func (*SQLStore) UpdateProfileTx ¶
func (store *SQLStore) UpdateProfileTx(ctx context.Context, params UpdateProfileTxParams) (UpdateProfileTxResult, error)
type Store ¶
type Store interface { Querier GetProfileTx(ctx context.Context, params GetProfileTxParams) (GetProfileTxResult, error) UpdateProfileTx(ctx context.Context, params UpdateProfileTxParams) (UpdateProfileTxResult, error) CreateProfileTx(ctx context.Context, params CreateProfileTxParams) (CreateProfileTxResult, error) }
type UpdateProfileParams ¶
type UpdateProfileTxParams ¶
type UpdateProfileTxResult ¶
Click to show internal directories.
Click to hide internal directories.