session

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: GPL-3.0 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"
	// FieldCreateTime holds the string denoting the create_time field in the database.
	FieldCreateTime = "create_time"
	// FieldUpdateTime holds the string denoting the update_time field in the database.
	FieldUpdateTime = "update_time"
	// FieldJti holds the string denoting the jti field in the database.
	FieldJti = "jti"
	// FieldExpiresAt holds the string denoting the expires_at field in the database.
	FieldExpiresAt = "expires_at"
	// FieldRevokedAt holds the string denoting the revoked_at field in the database.
	FieldRevokedAt = "revoked_at"
	// FieldLastSeenAt holds the string denoting the last_seen_at field in the database.
	FieldLastSeenAt = "last_seen_at"
	// FieldIP holds the string denoting the ip field in the database.
	FieldIP = "ip"
	// FieldUserAgent holds the string denoting the user_agent field in the database.
	FieldUserAgent = "user_agent"
	// 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 (
	// DefaultCreateTime holds the default value on creation for the "create_time" field.
	DefaultCreateTime func() time.Time
	// DefaultUpdateTime holds the default value on creation for the "update_time" field.
	DefaultUpdateTime func() time.Time
	// UpdateDefaultUpdateTime holds the default value on update for the "update_time" field.
	UpdateDefaultUpdateTime func() time.Time
	// JtiValidator is a validator for the "jti" field. It is called by the builders before save.
	JtiValidator func(string) error
	// UserAgentValidator is a validator for the "user_agent" field. It is called by the builders before save.
	UserAgentValidator func(string) error
)

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 CreateTime

func CreateTime(v time.Time) predicate.Session

CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ.

func CreateTimeEQ

func CreateTimeEQ(v time.Time) predicate.Session

CreateTimeEQ applies the EQ predicate on the "create_time" field.

func CreateTimeGT

func CreateTimeGT(v time.Time) predicate.Session

CreateTimeGT applies the GT predicate on the "create_time" field.

func CreateTimeGTE

func CreateTimeGTE(v time.Time) predicate.Session

CreateTimeGTE applies the GTE predicate on the "create_time" field.

func CreateTimeIn

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

CreateTimeIn applies the In predicate on the "create_time" field.

func CreateTimeLT

func CreateTimeLT(v time.Time) predicate.Session

CreateTimeLT applies the LT predicate on the "create_time" field.

func CreateTimeLTE

func CreateTimeLTE(v time.Time) predicate.Session

CreateTimeLTE applies the LTE predicate on the "create_time" field.

func CreateTimeNEQ

func CreateTimeNEQ(v time.Time) predicate.Session

CreateTimeNEQ applies the NEQ predicate on the "create_time" field.

func CreateTimeNotIn

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

CreateTimeNotIn applies the NotIn predicate on the "create_time" 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 uint32) predicate.Session

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id uint32) predicate.Session

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id uint32) predicate.Session

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id uint32) predicate.Session

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id uint32) predicate.Session

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id uint32) predicate.Session

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id uint32) predicate.Session

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func IP

func IP(v string) predicate.Session

IP applies equality check predicate on the "ip" field. It's identical to IPEQ.

func IPContains

func IPContains(v string) predicate.Session

IPContains applies the Contains predicate on the "ip" field.

func IPContainsFold

func IPContainsFold(v string) predicate.Session

IPContainsFold applies the ContainsFold predicate on the "ip" field.

func IPEQ

func IPEQ(v string) predicate.Session

IPEQ applies the EQ predicate on the "ip" field.

func IPEqualFold

func IPEqualFold(v string) predicate.Session

IPEqualFold applies the EqualFold predicate on the "ip" field.

func IPGT

func IPGT(v string) predicate.Session

IPGT applies the GT predicate on the "ip" field.

func IPGTE

func IPGTE(v string) predicate.Session

IPGTE applies the GTE predicate on the "ip" field.

func IPHasPrefix

func IPHasPrefix(v string) predicate.Session

IPHasPrefix applies the HasPrefix predicate on the "ip" field.

func IPHasSuffix

func IPHasSuffix(v string) predicate.Session

IPHasSuffix applies the HasSuffix predicate on the "ip" field.

func IPIn

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

IPIn applies the In predicate on the "ip" field.

func IPIsNil

func IPIsNil() predicate.Session

IPIsNil applies the IsNil predicate on the "ip" field.

func IPLT

func IPLT(v string) predicate.Session

IPLT applies the LT predicate on the "ip" field.

func IPLTE

func IPLTE(v string) predicate.Session

IPLTE applies the LTE predicate on the "ip" field.

func IPNEQ

func IPNEQ(v string) predicate.Session

IPNEQ applies the NEQ predicate on the "ip" field.

func IPNotIn

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

IPNotIn applies the NotIn predicate on the "ip" field.

func IPNotNil

func IPNotNil() predicate.Session

IPNotNil applies the NotNil predicate on the "ip" field.

func Jti

func Jti(v string) predicate.Session

Jti applies equality check predicate on the "jti" field. It's identical to JtiEQ.

func JtiContains

func JtiContains(v string) predicate.Session

JtiContains applies the Contains predicate on the "jti" field.

func JtiContainsFold

func JtiContainsFold(v string) predicate.Session

JtiContainsFold applies the ContainsFold predicate on the "jti" field.

func JtiEQ

func JtiEQ(v string) predicate.Session

JtiEQ applies the EQ predicate on the "jti" field.

func JtiEqualFold

func JtiEqualFold(v string) predicate.Session

JtiEqualFold applies the EqualFold predicate on the "jti" field.

func JtiGT

func JtiGT(v string) predicate.Session

JtiGT applies the GT predicate on the "jti" field.

func JtiGTE

func JtiGTE(v string) predicate.Session

JtiGTE applies the GTE predicate on the "jti" field.

func JtiHasPrefix

func JtiHasPrefix(v string) predicate.Session

JtiHasPrefix applies the HasPrefix predicate on the "jti" field.

func JtiHasSuffix

func JtiHasSuffix(v string) predicate.Session

JtiHasSuffix applies the HasSuffix predicate on the "jti" field.

func JtiIn

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

JtiIn applies the In predicate on the "jti" field.

func JtiLT

func JtiLT(v string) predicate.Session

JtiLT applies the LT predicate on the "jti" field.

func JtiLTE

func JtiLTE(v string) predicate.Session

JtiLTE applies the LTE predicate on the "jti" field.

func JtiNEQ

func JtiNEQ(v string) predicate.Session

JtiNEQ applies the NEQ predicate on the "jti" field.

func JtiNotIn

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

JtiNotIn applies the NotIn predicate on the "jti" field.

func LastSeenAt

func LastSeenAt(v time.Time) predicate.Session

LastSeenAt applies equality check predicate on the "last_seen_at" field. It's identical to LastSeenAtEQ.

func LastSeenAtEQ

func LastSeenAtEQ(v time.Time) predicate.Session

LastSeenAtEQ applies the EQ predicate on the "last_seen_at" field.

func LastSeenAtGT

func LastSeenAtGT(v time.Time) predicate.Session

LastSeenAtGT applies the GT predicate on the "last_seen_at" field.

func LastSeenAtGTE

func LastSeenAtGTE(v time.Time) predicate.Session

LastSeenAtGTE applies the GTE predicate on the "last_seen_at" field.

func LastSeenAtIn

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

LastSeenAtIn applies the In predicate on the "last_seen_at" field.

func LastSeenAtIsNil

func LastSeenAtIsNil() predicate.Session

LastSeenAtIsNil applies the IsNil predicate on the "last_seen_at" field.

func LastSeenAtLT

func LastSeenAtLT(v time.Time) predicate.Session

LastSeenAtLT applies the LT predicate on the "last_seen_at" field.

func LastSeenAtLTE

func LastSeenAtLTE(v time.Time) predicate.Session

LastSeenAtLTE applies the LTE predicate on the "last_seen_at" field.

func LastSeenAtNEQ

func LastSeenAtNEQ(v time.Time) predicate.Session

LastSeenAtNEQ applies the NEQ predicate on the "last_seen_at" field.

func LastSeenAtNotIn

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

LastSeenAtNotIn applies the NotIn predicate on the "last_seen_at" field.

func LastSeenAtNotNil

func LastSeenAtNotNil() predicate.Session

LastSeenAtNotNil applies the NotNil predicate on the "last_seen_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 RevokedAt

func RevokedAt(v time.Time) predicate.Session

RevokedAt applies equality check predicate on the "revoked_at" field. It's identical to RevokedAtEQ.

func RevokedAtEQ

func RevokedAtEQ(v time.Time) predicate.Session

RevokedAtEQ applies the EQ predicate on the "revoked_at" field.

func RevokedAtGT

func RevokedAtGT(v time.Time) predicate.Session

RevokedAtGT applies the GT predicate on the "revoked_at" field.

func RevokedAtGTE

func RevokedAtGTE(v time.Time) predicate.Session

RevokedAtGTE applies the GTE predicate on the "revoked_at" field.

func RevokedAtIn

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

RevokedAtIn applies the In predicate on the "revoked_at" field.

func RevokedAtIsNil

func RevokedAtIsNil() predicate.Session

RevokedAtIsNil applies the IsNil predicate on the "revoked_at" field.

func RevokedAtLT

func RevokedAtLT(v time.Time) predicate.Session

RevokedAtLT applies the LT predicate on the "revoked_at" field.

func RevokedAtLTE

func RevokedAtLTE(v time.Time) predicate.Session

RevokedAtLTE applies the LTE predicate on the "revoked_at" field.

func RevokedAtNEQ

func RevokedAtNEQ(v time.Time) predicate.Session

RevokedAtNEQ applies the NEQ predicate on the "revoked_at" field.

func RevokedAtNotIn

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

RevokedAtNotIn applies the NotIn predicate on the "revoked_at" field.

func RevokedAtNotNil

func RevokedAtNotNil() predicate.Session

RevokedAtNotNil applies the NotNil predicate on the "revoked_at" field.

func UpdateTime

func UpdateTime(v time.Time) predicate.Session

UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ.

func UpdateTimeEQ

func UpdateTimeEQ(v time.Time) predicate.Session

UpdateTimeEQ applies the EQ predicate on the "update_time" field.

func UpdateTimeGT

func UpdateTimeGT(v time.Time) predicate.Session

UpdateTimeGT applies the GT predicate on the "update_time" field.

func UpdateTimeGTE

func UpdateTimeGTE(v time.Time) predicate.Session

UpdateTimeGTE applies the GTE predicate on the "update_time" field.

func UpdateTimeIn

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

UpdateTimeIn applies the In predicate on the "update_time" field.

func UpdateTimeLT

func UpdateTimeLT(v time.Time) predicate.Session

UpdateTimeLT applies the LT predicate on the "update_time" field.

func UpdateTimeLTE

func UpdateTimeLTE(v time.Time) predicate.Session

UpdateTimeLTE applies the LTE predicate on the "update_time" field.

func UpdateTimeNEQ

func UpdateTimeNEQ(v time.Time) predicate.Session

UpdateTimeNEQ applies the NEQ predicate on the "update_time" field.

func UpdateTimeNotIn

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

UpdateTimeNotIn applies the NotIn predicate on the "update_time" 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 ByCreateTime

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

ByCreateTime orders the results by the create_time 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 ByIP

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

ByIP orders the results by the ip field.

func ByJti

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

ByJti orders the results by the jti field.

func ByLastSeenAt

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

ByLastSeenAt orders the results by the last_seen_at field.

func ByRevokedAt

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

ByRevokedAt orders the results by the revoked_at field.

func ByUpdateTime

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

ByUpdateTime orders the results by the update_time 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