session

package
v0.0.0-...-3bb7120 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IsAuthKey                    = "is_auth"
	UserIDKey                    = "user_id"
	UserFirstnameKey             = "firstname"
	CartIDKey                    = "cart_id"
	ShippingAddressIDKey         = "shipping_address_id"
	BillingAddressIDKey          = "billing_address_id"
	PaymentMethodKey             = "payment_method"
	StripeConfirmationTokenIDKey = "stripe_confirmation_token_id"
)
View Source
const UserKey = "userKey"

Variables

This section is empty.

Functions

func NewContextWithUser

func NewContextWithUser(ctx context.Context, u *User) context.Context

NewContextWithUser NewContext returns a new Context that carries value u.

Types

type User

type User struct {
	ID                        int64
	IsAuth                    bool
	Firstname                 string
	CartID                    int64
	ShippingAddressID         int64
	BillingAddressID          int64
	PaymentMethod             string
	StripeConfirmationTokenID string
}

func UserFromContext

func UserFromContext(ctx context.Context) *User

UserFromContext FromContext returns the User value stored in ctx, if any.

Jump to

Keyboard shortcuts

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