mirror of https://github.com/dexidp/dex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.7 KiB
83 lines
2.7 KiB
// Code generated by ent, DO NOT EDIT. |
|
|
|
package authsession |
|
|
|
import ( |
|
"entgo.io/ent/dialect/sql" |
|
) |
|
|
|
const ( |
|
// Label holds the string label denoting the authsession type in the database. |
|
Label = "auth_session" |
|
// FieldID holds the string denoting the id field in the database. |
|
FieldID = "id" |
|
// FieldClientStates holds the string denoting the client_states field in the database. |
|
FieldClientStates = "client_states" |
|
// FieldCreatedAt holds the string denoting the created_at field in the database. |
|
FieldCreatedAt = "created_at" |
|
// FieldLastActivity holds the string denoting the last_activity field in the database. |
|
FieldLastActivity = "last_activity" |
|
// 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" |
|
// Table holds the table name of the authsession in the database. |
|
Table = "auth_sessions" |
|
) |
|
|
|
// Columns holds all SQL columns for authsession fields. |
|
var Columns = []string{ |
|
FieldID, |
|
FieldClientStates, |
|
FieldCreatedAt, |
|
FieldLastActivity, |
|
FieldIPAddress, |
|
FieldUserAgent, |
|
} |
|
|
|
// ValidColumn reports if the column name is valid (part of the table columns). |
|
func ValidColumn(column string) bool { |
|
for i := range Columns { |
|
if column == Columns[i] { |
|
return true |
|
} |
|
} |
|
return false |
|
} |
|
|
|
var ( |
|
// DefaultIPAddress holds the default value on creation for the "ip_address" field. |
|
DefaultIPAddress string |
|
// DefaultUserAgent holds the default value on creation for the "user_agent" field. |
|
DefaultUserAgent string |
|
// IDValidator is a validator for the "id" field. It is called by the builders before save. |
|
IDValidator func(string) error |
|
) |
|
|
|
// OrderOption defines the ordering options for the AuthSession queries. |
|
type OrderOption func(*sql.Selector) |
|
|
|
// ByID orders the results by the id field. |
|
func ByID(opts ...sql.OrderTermOption) OrderOption { |
|
return sql.OrderByField(FieldID, opts...).ToFunc() |
|
} |
|
|
|
// ByCreatedAt orders the results by the created_at field. |
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { |
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() |
|
} |
|
|
|
// ByLastActivity orders the results by the last_activity field. |
|
func ByLastActivity(opts ...sql.OrderTermOption) OrderOption { |
|
return sql.OrderByField(FieldLastActivity, opts...).ToFunc() |
|
} |
|
|
|
// ByIPAddress orders the results by the ip_address field. |
|
func ByIPAddress(opts ...sql.OrderTermOption) OrderOption { |
|
return sql.OrderByField(FieldIPAddress, opts...).ToFunc() |
|
} |
|
|
|
// ByUserAgent orders the results by the user_agent field. |
|
func ByUserAgent(opts ...sql.OrderTermOption) OrderOption { |
|
return sql.OrderByField(FieldUserAgent, opts...).ToFunc() |
|
}
|
|
|