session

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the session type in the database.
	Label = "session"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldToken holds the string denoting the token field in the database.
	FieldToken = "token"
	// FieldIPAddress holds the string denoting the ip_address field in the database.
	FieldIPAddress = "ip_address"
	// FieldUserAgent holds the string denoting the user_agent field in the database.
	FieldUserAgent = "user_agent"
	// FieldExpiresAt holds the string denoting the expires_at field in the database.
	FieldExpiresAt = "expires_at"
	// FieldLastActiveAt holds the string denoting the last_active_at field in the database.
	FieldLastActiveAt = "last_active_at"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// EdgeUser holds the string denoting the user edge name in mutations.
	EdgeUser = "user"
	// Table holds the table name of the session in the database.
	Table = "sessions"
	// UserTable is the table that holds the user relation/edge.
	UserTable = "sessions"
	// UserInverseTable is the table name for the User entity.
	// It exists in this package in order to avoid circular dependency with the "user" package.
	UserInverseTable = "users"
	// UserColumn is the table column denoting the user relation/edge.
	UserColumn = "user_sessions"
)

Variables

View Source
var (
	// TokenValidator is a validator for the "token" field. It is called by the builders before save.
	TokenValidator func(string) error
	// DefaultLastActiveAt holds the default value on creation for the "last_active_at" field.
	DefaultLastActiveAt func() time.Time
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
)

Columns holds all SQL columns for session fields.

View Source
var ForeignKeys = []string{
	"user_sessions",
}

ForeignKeys holds the SQL foreign-keys that are owned by the "sessions" table and are not defined as standalone fields in the schema.

Functions

func And

func And(predicates ...predicate.Session) predicate.Session

And groups predicates with the AND operator between them.

func CreatedAt

func CreatedAt(v time.Time) predicate.Session

CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Session

CreatedAtEQ applies the EQ predicate on the "created_at" field.

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Session

CreatedAtGT applies the GT predicate on the "created_at" field.

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Session

CreatedAtGTE applies the GTE predicate on the "created_at" field.

func CreatedAtIn

func CreatedAtIn(vs ...time.Time) predicate.Session

CreatedAtIn applies the In predicate on the "created_at" field.

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Session

CreatedAtLT applies the LT predicate on the "created_at" field.

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Session

CreatedAtLTE applies the LTE predicate on the "created_at" field.

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Session

CreatedAtNEQ applies the NEQ predicate on the "created_at" field.

func CreatedAtNotIn

func CreatedAtNotIn(vs ...time.Time) predicate.Session

CreatedAtNotIn applies the NotIn predicate on the "created_at" field.

func ExpiresAt

func ExpiresAt(v time.Time) predicate.Session

ExpiresAt applies equality check predicate on the "expires_at" field. It's identical to ExpiresAtEQ.

func ExpiresAtEQ

func ExpiresAtEQ(v time.Time) predicate.Session

ExpiresAtEQ applies the EQ predicate on the "expires_at" field.

func ExpiresAtGT

func ExpiresAtGT(v time.Time) predicate.Session

ExpiresAtGT applies the GT predicate on the "expires_at" field.

func ExpiresAtGTE

func ExpiresAtGTE(v time.Time) predicate.Session

ExpiresAtGTE applies the GTE predicate on the "expires_at" field.

func ExpiresAtIn

func ExpiresAtIn(vs ...time.Time) predicate.Session

ExpiresAtIn applies the In predicate on the "expires_at" field.

func ExpiresAtLT

func ExpiresAtLT(v time.Time) predicate.Session

ExpiresAtLT applies the LT predicate on the "expires_at" field.

func ExpiresAtLTE

func ExpiresAtLTE(v time.Time) predicate.Session

ExpiresAtLTE applies the LTE predicate on the "expires_at" field.

func ExpiresAtNEQ

func ExpiresAtNEQ(v time.Time) predicate.Session

ExpiresAtNEQ applies the NEQ predicate on the "expires_at" field.

func ExpiresAtNotIn

func ExpiresAtNotIn(vs ...time.Time) predicate.Session

ExpiresAtNotIn applies the NotIn predicate on the "expires_at" field.

func HasUser

func HasUser() predicate.Session

HasUser applies the HasEdge predicate on the "user" edge.

func HasUserWith

func HasUserWith(preds ...predicate.User) predicate.Session

HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates).

func ID

func ID(id int) predicate.Session

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.Session

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.Session

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.Session

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...int) predicate.Session

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.Session

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.Session

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.Session

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...int) predicate.Session

IDNotIn applies the NotIn predicate on the ID field.

func IPAddress

func IPAddress(v string) predicate.Session

IPAddress applies equality check predicate on the "ip_address" field. It's identical to IPAddressEQ.

func IPAddressContains

func IPAddressContains(v string) predicate.Session

IPAddressContains applies the Contains predicate on the "ip_address" field.

func IPAddressContainsFold

func IPAddressContainsFold(v string) predicate.Session

IPAddressContainsFold applies the ContainsFold predicate on the "ip_address" field.

func IPAddressEQ

func IPAddressEQ(v string) predicate.Session

IPAddressEQ applies the EQ predicate on the "ip_address" field.

func IPAddressEqualFold

func IPAddressEqualFold(v string) predicate.Session

IPAddressEqualFold applies the EqualFold predicate on the "ip_address" field.

func IPAddressGT

func IPAddressGT(v string) predicate.Session

IPAddressGT applies the GT predicate on the "ip_address" field.

func IPAddressGTE

func IPAddressGTE(v string) predicate.Session

IPAddressGTE applies the GTE predicate on the "ip_address" field.

func IPAddressHasPrefix

func IPAddressHasPrefix(v string) predicate.Session

IPAddressHasPrefix applies the HasPrefix predicate on the "ip_address" field.

func IPAddressHasSuffix

func IPAddressHasSuffix(v string) predicate.Session

IPAddressHasSuffix applies the HasSuffix predicate on the "ip_address" field.

func IPAddressIn

func IPAddressIn(vs ...string) predicate.Session

IPAddressIn applies the In predicate on the "ip_address" field.

func IPAddressIsNil

func IPAddressIsNil() predicate.Session

IPAddressIsNil applies the IsNil predicate on the "ip_address" field.

func IPAddressLT

func IPAddressLT(v string) predicate.Session

IPAddressLT applies the LT predicate on the "ip_address" field.

func IPAddressLTE

func IPAddressLTE(v string) predicate.Session

IPAddressLTE applies the LTE predicate on the "ip_address" field.

func IPAddressNEQ

func IPAddressNEQ(v string) predicate.Session

IPAddressNEQ applies the NEQ predicate on the "ip_address" field.

func IPAddressNotIn

func IPAddressNotIn(vs ...string) predicate.Session

IPAddressNotIn applies the NotIn predicate on the "ip_address" field.

func IPAddressNotNil

func IPAddressNotNil() predicate.Session

IPAddressNotNil applies the NotNil predicate on the "ip_address" field.

func LastActiveAt

func LastActiveAt(v time.Time) predicate.Session

LastActiveAt applies equality check predicate on the "last_active_at" field. It's identical to LastActiveAtEQ.

func LastActiveAtEQ

func LastActiveAtEQ(v time.Time) predicate.Session

LastActiveAtEQ applies the EQ predicate on the "last_active_at" field.

func LastActiveAtGT

func LastActiveAtGT(v time.Time) predicate.Session

LastActiveAtGT applies the GT predicate on the "last_active_at" field.

func LastActiveAtGTE

func LastActiveAtGTE(v time.Time) predicate.Session

LastActiveAtGTE applies the GTE predicate on the "last_active_at" field.

func LastActiveAtIn

func LastActiveAtIn(vs ...time.Time) predicate.Session

LastActiveAtIn applies the In predicate on the "last_active_at" field.

func LastActiveAtLT

func LastActiveAtLT(v time.Time) predicate.Session

LastActiveAtLT applies the LT predicate on the "last_active_at" field.

func LastActiveAtLTE

func LastActiveAtLTE(v time.Time) predicate.Session

LastActiveAtLTE applies the LTE predicate on the "last_active_at" field.

func LastActiveAtNEQ

func LastActiveAtNEQ(v time.Time) predicate.Session

LastActiveAtNEQ applies the NEQ predicate on the "last_active_at" field.

func LastActiveAtNotIn

func LastActiveAtNotIn(vs ...time.Time) predicate.Session

LastActiveAtNotIn applies the NotIn predicate on the "last_active_at" field.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Session) predicate.Session

Or groups predicates with the OR operator between them.

func Token

func Token(v string) predicate.Session

Token applies equality check predicate on the "token" field. It's identical to TokenEQ.

func TokenContains

func TokenContains(v string) predicate.Session

TokenContains applies the Contains predicate on the "token" field.

func TokenContainsFold

func TokenContainsFold(v string) predicate.Session

TokenContainsFold applies the ContainsFold predicate on the "token" field.

func TokenEQ

func TokenEQ(v string) predicate.Session

TokenEQ applies the EQ predicate on the "token" field.

func TokenEqualFold

func TokenEqualFold(v string) predicate.Session

TokenEqualFold applies the EqualFold predicate on the "token" field.

func TokenGT

func TokenGT(v string) predicate.Session

TokenGT applies the GT predicate on the "token" field.

func TokenGTE

func TokenGTE(v string) predicate.Session

TokenGTE applies the GTE predicate on the "token" field.

func TokenHasPrefix

func TokenHasPrefix(v string) predicate.Session

TokenHasPrefix applies the HasPrefix predicate on the "token" field.

func TokenHasSuffix

func TokenHasSuffix(v string) predicate.Session

TokenHasSuffix applies the HasSuffix predicate on the "token" field.

func TokenIn

func TokenIn(vs ...string) predicate.Session

TokenIn applies the In predicate on the "token" field.

func TokenLT

func TokenLT(v string) predicate.Session

TokenLT applies the LT predicate on the "token" field.

func TokenLTE

func TokenLTE(v string) predicate.Session

TokenLTE applies the LTE predicate on the "token" field.

func TokenNEQ

func TokenNEQ(v string) predicate.Session

TokenNEQ applies the NEQ predicate on the "token" field.

func TokenNotIn

func TokenNotIn(vs ...string) predicate.Session

TokenNotIn applies the NotIn predicate on the "token" field.

func UserAgent

func UserAgent(v string) predicate.Session

UserAgent applies equality check predicate on the "user_agent" field. It's identical to UserAgentEQ.

func UserAgentContains

func UserAgentContains(v string) predicate.Session

UserAgentContains applies the Contains predicate on the "user_agent" field.

func UserAgentContainsFold

func UserAgentContainsFold(v string) predicate.Session

UserAgentContainsFold applies the ContainsFold predicate on the "user_agent" field.

func UserAgentEQ

func UserAgentEQ(v string) predicate.Session

UserAgentEQ applies the EQ predicate on the "user_agent" field.

func UserAgentEqualFold

func UserAgentEqualFold(v string) predicate.Session

UserAgentEqualFold applies the EqualFold predicate on the "user_agent" field.

func UserAgentGT

func UserAgentGT(v string) predicate.Session

UserAgentGT applies the GT predicate on the "user_agent" field.

func UserAgentGTE

func UserAgentGTE(v string) predicate.Session

UserAgentGTE applies the GTE predicate on the "user_agent" field.

func UserAgentHasPrefix

func UserAgentHasPrefix(v string) predicate.Session

UserAgentHasPrefix applies the HasPrefix predicate on the "user_agent" field.

func UserAgentHasSuffix

func UserAgentHasSuffix(v string) predicate.Session

UserAgentHasSuffix applies the HasSuffix predicate on the "user_agent" field.

func UserAgentIn

func UserAgentIn(vs ...string) predicate.Session

UserAgentIn applies the In predicate on the "user_agent" field.

func UserAgentIsNil

func UserAgentIsNil() predicate.Session

UserAgentIsNil applies the IsNil predicate on the "user_agent" field.

func UserAgentLT

func UserAgentLT(v string) predicate.Session

UserAgentLT applies the LT predicate on the "user_agent" field.

func UserAgentLTE

func UserAgentLTE(v string) predicate.Session

UserAgentLTE applies the LTE predicate on the "user_agent" field.

func UserAgentNEQ

func UserAgentNEQ(v string) predicate.Session

UserAgentNEQ applies the NEQ predicate on the "user_agent" field.

func UserAgentNotIn

func UserAgentNotIn(vs ...string) predicate.Session

UserAgentNotIn applies the NotIn predicate on the "user_agent" field.

func UserAgentNotNil

func UserAgentNotNil() predicate.Session

UserAgentNotNil applies the NotNil predicate on the "user_agent" field.

func ValidColumn

func ValidColumn(column string) bool

ValidColumn reports if the column name is valid (part of the table columns).

Types

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Session queries.

func ByCreatedAt

func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption

ByCreatedAt orders the results by the created_at field.

func ByExpiresAt

func ByExpiresAt(opts ...sql.OrderTermOption) OrderOption

ByExpiresAt orders the results by the expires_at field.

func ByID

func ByID(opts ...sql.OrderTermOption) OrderOption

ByID orders the results by the id field.

func ByIPAddress

func ByIPAddress(opts ...sql.OrderTermOption) OrderOption

ByIPAddress orders the results by the ip_address field.

func ByLastActiveAt

func ByLastActiveAt(opts ...sql.OrderTermOption) OrderOption

ByLastActiveAt orders the results by the last_active_at field.

func ByToken

func ByToken(opts ...sql.OrderTermOption) OrderOption

ByToken orders the results by the token field.

func ByUserAgent

func ByUserAgent(opts ...sql.OrderTermOption) OrderOption

ByUserAgent orders the results by the user_agent field.

func ByUserField

func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption

ByUserField orders the results by user field.

Jump to

Keyboard shortcuts

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