session

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 9 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"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// FieldCreatedBy holds the string denoting the created_by field in the database.
	FieldCreatedBy = "created_by"
	// FieldUpdatedBy holds the string denoting the updated_by field in the database.
	FieldUpdatedBy = "updated_by"
	// FieldType holds the string denoting the type field in the database.
	FieldType = "type"
	// FieldDisabled holds the string denoting the disabled field in the database.
	FieldDisabled = "disabled"
	// FieldToken holds the string denoting the token field in the database.
	FieldToken = "token"
	// FieldUserAgent holds the string denoting the user_agent field in the database.
	FieldUserAgent = "user_agent"
	// FieldIps holds the string denoting the ips field in the database.
	FieldIps = "ips"
	// EdgeUsers holds the string denoting the users edge name in mutations.
	EdgeUsers = "users"
	// Table holds the table name of the session in the database.
	Table = "sessions"
	// UsersTable is the table that holds the users relation/edge.
	UsersTable = "sessions"
	// UsersInverseTable is the table name for the User entity.
	// It exists in this package in order to avoid circular dependency with the "user" package.
	UsersInverseTable = "users"
	// UsersColumn is the table column denoting the users relation/edge.
	UsersColumn = "session_users"
)

Variables

View Source
var (
	Hooks [1]ent.Hook
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
	DefaultUpdatedAt func() time.Time
	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
	UpdateDefaultUpdatedAt func() time.Time
	// DefaultToken holds the default value on creation for the "token" field.
	DefaultToken func() string
	// TokenValidator is a validator for the "token" field. It is called by the builders before save.
	TokenValidator func(string) error
	// DefaultID holds the default value on creation for the "id" field.
	DefaultID func() string
)

Note that the variables below are initialized by the runtime package on the initialization of the application. Therefore, it should be imported in the main as follows:

import _ "github.com/datumforge/datum/internal/ent/generated/runtime"

Columns holds all SQL columns for session fields.

View Source
var ForeignKeys = []string{
	"session_users",
	"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 CreatedBy

func CreatedBy(v string) predicate.Session

CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ.

func CreatedByContains

func CreatedByContains(v string) predicate.Session

CreatedByContains applies the Contains predicate on the "created_by" field.

func CreatedByContainsFold

func CreatedByContainsFold(v string) predicate.Session

CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field.

func CreatedByEQ

func CreatedByEQ(v string) predicate.Session

CreatedByEQ applies the EQ predicate on the "created_by" field.

func CreatedByEqualFold

func CreatedByEqualFold(v string) predicate.Session

CreatedByEqualFold applies the EqualFold predicate on the "created_by" field.

func CreatedByGT

func CreatedByGT(v string) predicate.Session

CreatedByGT applies the GT predicate on the "created_by" field.

func CreatedByGTE

func CreatedByGTE(v string) predicate.Session

CreatedByGTE applies the GTE predicate on the "created_by" field.

func CreatedByHasPrefix

func CreatedByHasPrefix(v string) predicate.Session

CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field.

func CreatedByHasSuffix

func CreatedByHasSuffix(v string) predicate.Session

CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field.

func CreatedByIn

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

CreatedByIn applies the In predicate on the "created_by" field.

func CreatedByIsNil

func CreatedByIsNil() predicate.Session

CreatedByIsNil applies the IsNil predicate on the "created_by" field.

func CreatedByLT

func CreatedByLT(v string) predicate.Session

CreatedByLT applies the LT predicate on the "created_by" field.

func CreatedByLTE

func CreatedByLTE(v string) predicate.Session

CreatedByLTE applies the LTE predicate on the "created_by" field.

func CreatedByNEQ

func CreatedByNEQ(v string) predicate.Session

CreatedByNEQ applies the NEQ predicate on the "created_by" field.

func CreatedByNotIn

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

CreatedByNotIn applies the NotIn predicate on the "created_by" field.

func CreatedByNotNil

func CreatedByNotNil() predicate.Session

CreatedByNotNil applies the NotNil predicate on the "created_by" field.

func Disabled added in v0.1.1

func Disabled(v bool) predicate.Session

Disabled applies equality check predicate on the "disabled" field. It's identical to DisabledEQ.

func DisabledEQ added in v0.1.1

func DisabledEQ(v bool) predicate.Session

DisabledEQ applies the EQ predicate on the "disabled" field.

func DisabledNEQ added in v0.1.1

func DisabledNEQ(v bool) predicate.Session

DisabledNEQ applies the NEQ predicate on the "disabled" field.

func HasUsers added in v0.1.1

func HasUsers() predicate.Session

HasUsers applies the HasEdge predicate on the "users" edge.

func HasUsersWith added in v0.1.1

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

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

func ID

func ID(id string) predicate.Session

ID filters vertices based on their ID field.

func IDContainsFold

func IDContainsFold(id string) predicate.Session

IDContainsFold applies the ContainsFold predicate on the ID field.

func IDEQ

func IDEQ(id string) predicate.Session

IDEQ applies the EQ predicate on the ID field.

func IDEqualFold

func IDEqualFold(id string) predicate.Session

IDEqualFold applies the EqualFold predicate on the ID field.

func IDGT

func IDGT(id string) predicate.Session

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id string) predicate.Session

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id string) predicate.Session

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id string) predicate.Session

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id string) predicate.Session

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func Ips added in v0.1.1

func Ips(v string) predicate.Session

Ips applies equality check predicate on the "ips" field. It's identical to IpsEQ.

func IpsContains added in v0.1.1

func IpsContains(v string) predicate.Session

IpsContains applies the Contains predicate on the "ips" field.

func IpsContainsFold added in v0.1.1

func IpsContainsFold(v string) predicate.Session

IpsContainsFold applies the ContainsFold predicate on the "ips" field.

func IpsEQ added in v0.1.1

func IpsEQ(v string) predicate.Session

IpsEQ applies the EQ predicate on the "ips" field.

func IpsEqualFold added in v0.1.1

func IpsEqualFold(v string) predicate.Session

IpsEqualFold applies the EqualFold predicate on the "ips" field.

func IpsGT added in v0.1.1

func IpsGT(v string) predicate.Session

IpsGT applies the GT predicate on the "ips" field.

func IpsGTE added in v0.1.1

func IpsGTE(v string) predicate.Session

IpsGTE applies the GTE predicate on the "ips" field.

func IpsHasPrefix added in v0.1.1

func IpsHasPrefix(v string) predicate.Session

IpsHasPrefix applies the HasPrefix predicate on the "ips" field.

func IpsHasSuffix added in v0.1.1

func IpsHasSuffix(v string) predicate.Session

IpsHasSuffix applies the HasSuffix predicate on the "ips" field.

func IpsIn added in v0.1.1

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

IpsIn applies the In predicate on the "ips" field.

func IpsLT added in v0.1.1

func IpsLT(v string) predicate.Session

IpsLT applies the LT predicate on the "ips" field.

func IpsLTE added in v0.1.1

func IpsLTE(v string) predicate.Session

IpsLTE applies the LTE predicate on the "ips" field.

func IpsNEQ added in v0.1.1

func IpsNEQ(v string) predicate.Session

IpsNEQ applies the NEQ predicate on the "ips" field.

func IpsNotIn added in v0.1.1

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

IpsNotIn applies the NotIn predicate on the "ips" 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 added in v0.1.1

func Token(v string) predicate.Session

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

func TokenContains added in v0.1.1

func TokenContains(v string) predicate.Session

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

func TokenContainsFold added in v0.1.1

func TokenContainsFold(v string) predicate.Session

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

func TokenEQ added in v0.1.1

func TokenEQ(v string) predicate.Session

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

func TokenEqualFold added in v0.1.1

func TokenEqualFold(v string) predicate.Session

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

func TokenGT added in v0.1.1

func TokenGT(v string) predicate.Session

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

func TokenGTE added in v0.1.1

func TokenGTE(v string) predicate.Session

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

func TokenHasPrefix added in v0.1.1

func TokenHasPrefix(v string) predicate.Session

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

func TokenHasSuffix added in v0.1.1

func TokenHasSuffix(v string) predicate.Session

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

func TokenIn added in v0.1.1

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

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

func TokenLT added in v0.1.1

func TokenLT(v string) predicate.Session

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

func TokenLTE added in v0.1.1

func TokenLTE(v string) predicate.Session

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

func TokenNEQ added in v0.1.1

func TokenNEQ(v string) predicate.Session

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

func TokenNotIn added in v0.1.1

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

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

func TypeEQ added in v0.1.1

func TypeEQ(v Type) predicate.Session

TypeEQ applies the EQ predicate on the "type" field.

func TypeIn added in v0.1.1

func TypeIn(vs ...Type) predicate.Session

TypeIn applies the In predicate on the "type" field.

func TypeNEQ added in v0.1.1

func TypeNEQ(v Type) predicate.Session

TypeNEQ applies the NEQ predicate on the "type" field.

func TypeNotIn added in v0.1.1

func TypeNotIn(vs ...Type) predicate.Session

TypeNotIn applies the NotIn predicate on the "type" field.

func TypeValidator added in v0.1.1

func TypeValidator(_type Type) error

TypeValidator is a validator for the "type" field enum values. It is called by the builders before save.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Session

UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Session

UpdatedAtEQ applies the EQ predicate on the "updated_at" field.

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Session

UpdatedAtGT applies the GT predicate on the "updated_at" field.

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Session

UpdatedAtGTE applies the GTE predicate on the "updated_at" field.

func UpdatedAtIn

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

UpdatedAtIn applies the In predicate on the "updated_at" field.

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Session

UpdatedAtLT applies the LT predicate on the "updated_at" field.

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Session

UpdatedAtLTE applies the LTE predicate on the "updated_at" field.

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Session

UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.

func UpdatedAtNotIn

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

UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.

func UpdatedBy

func UpdatedBy(v string) predicate.Session

UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ.

func UpdatedByContains

func UpdatedByContains(v string) predicate.Session

UpdatedByContains applies the Contains predicate on the "updated_by" field.

func UpdatedByContainsFold

func UpdatedByContainsFold(v string) predicate.Session

UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field.

func UpdatedByEQ

func UpdatedByEQ(v string) predicate.Session

UpdatedByEQ applies the EQ predicate on the "updated_by" field.

func UpdatedByEqualFold

func UpdatedByEqualFold(v string) predicate.Session

UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field.

func UpdatedByGT

func UpdatedByGT(v string) predicate.Session

UpdatedByGT applies the GT predicate on the "updated_by" field.

func UpdatedByGTE

func UpdatedByGTE(v string) predicate.Session

UpdatedByGTE applies the GTE predicate on the "updated_by" field.

func UpdatedByHasPrefix

func UpdatedByHasPrefix(v string) predicate.Session

UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field.

func UpdatedByHasSuffix

func UpdatedByHasSuffix(v string) predicate.Session

UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field.

func UpdatedByIn

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

UpdatedByIn applies the In predicate on the "updated_by" field.

func UpdatedByIsNil

func UpdatedByIsNil() predicate.Session

UpdatedByIsNil applies the IsNil predicate on the "updated_by" field.

func UpdatedByLT

func UpdatedByLT(v string) predicate.Session

UpdatedByLT applies the LT predicate on the "updated_by" field.

func UpdatedByLTE

func UpdatedByLTE(v string) predicate.Session

UpdatedByLTE applies the LTE predicate on the "updated_by" field.

func UpdatedByNEQ

func UpdatedByNEQ(v string) predicate.Session

UpdatedByNEQ applies the NEQ predicate on the "updated_by" field.

func UpdatedByNotIn

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

UpdatedByNotIn applies the NotIn predicate on the "updated_by" field.

func UpdatedByNotNil

func UpdatedByNotNil() predicate.Session

UpdatedByNotNil applies the NotNil predicate on the "updated_by" field.

func UserAgent added in v0.1.1

func UserAgent(v string) predicate.Session

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

func UserAgentContains added in v0.1.1

func UserAgentContains(v string) predicate.Session

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

func UserAgentContainsFold added in v0.1.1

func UserAgentContainsFold(v string) predicate.Session

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

func UserAgentEQ added in v0.1.1

func UserAgentEQ(v string) predicate.Session

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

func UserAgentEqualFold added in v0.1.1

func UserAgentEqualFold(v string) predicate.Session

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

func UserAgentGT added in v0.1.1

func UserAgentGT(v string) predicate.Session

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

func UserAgentGTE added in v0.1.1

func UserAgentGTE(v string) predicate.Session

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

func UserAgentHasPrefix added in v0.1.1

func UserAgentHasPrefix(v string) predicate.Session

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

func UserAgentHasSuffix added in v0.1.1

func UserAgentHasSuffix(v string) predicate.Session

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

func UserAgentIn added in v0.1.1

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

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

func UserAgentIsNil added in v0.1.1

func UserAgentIsNil() predicate.Session

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

func UserAgentLT added in v0.1.1

func UserAgentLT(v string) predicate.Session

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

func UserAgentLTE added in v0.1.1

func UserAgentLTE(v string) predicate.Session

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

func UserAgentNEQ added in v0.1.1

func UserAgentNEQ(v string) predicate.Session

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

func UserAgentNotIn added in v0.1.1

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

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

func UserAgentNotNil added in v0.1.1

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 ByCreatedBy

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

ByCreatedBy orders the results by the created_by field.

func ByDisabled added in v0.1.1

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

ByDisabled orders the results by the disabled field.

func ByID

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

ByID orders the results by the id field.

func ByIps added in v0.1.1

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

ByIps orders the results by the ips field.

func ByToken added in v0.1.1

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

ByToken orders the results by the token field.

func ByType added in v0.1.1

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

ByType orders the results by the type field.

func ByUpdatedAt

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

ByUpdatedAt orders the results by the updated_at field.

func ByUpdatedBy

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

ByUpdatedBy orders the results by the updated_by field.

func ByUserAgent added in v0.1.1

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

ByUserAgent orders the results by the user_agent field.

func ByUsersField added in v0.1.1

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

ByUsersField orders the results by users field.

type Type added in v0.1.1

type Type string

Type defines the type for the "type" enum field.

const (
	TypeLocal       Type = "local"
	TypeOauth       Type = "oauth"
	TypeAppPassword Type = "app_password"
)

Type values.

func (Type) MarshalGQL added in v0.1.1

func (e Type) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (Type) String added in v0.1.1

func (_type Type) String() string

func (*Type) UnmarshalGQL added in v0.1.1

func (e *Type) UnmarshalGQL(val interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

Jump to

Keyboard shortcuts

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