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.
109 lines
3.8 KiB
109 lines
3.8 KiB
// Code generated by ent, DO NOT EDIT. |
|
|
|
package devicetoken |
|
|
|
import ( |
|
"entgo.io/ent/dialect/sql" |
|
) |
|
|
|
const ( |
|
// Label holds the string label denoting the devicetoken type in the database. |
|
Label = "device_token" |
|
// FieldID holds the string denoting the id field in the database. |
|
FieldID = "id" |
|
// FieldDeviceCode holds the string denoting the device_code field in the database. |
|
FieldDeviceCode = "device_code" |
|
// FieldStatus holds the string denoting the status field in the database. |
|
FieldStatus = "status" |
|
// FieldToken holds the string denoting the token field in the database. |
|
FieldToken = "token" |
|
// FieldExpiry holds the string denoting the expiry field in the database. |
|
FieldExpiry = "expiry" |
|
// FieldLastRequest holds the string denoting the last_request field in the database. |
|
FieldLastRequest = "last_request" |
|
// FieldPollInterval holds the string denoting the poll_interval field in the database. |
|
FieldPollInterval = "poll_interval" |
|
// FieldCodeChallenge holds the string denoting the code_challenge field in the database. |
|
FieldCodeChallenge = "code_challenge" |
|
// FieldCodeChallengeMethod holds the string denoting the code_challenge_method field in the database. |
|
FieldCodeChallengeMethod = "code_challenge_method" |
|
// Table holds the table name of the devicetoken in the database. |
|
Table = "device_tokens" |
|
) |
|
|
|
// Columns holds all SQL columns for devicetoken fields. |
|
var Columns = []string{ |
|
FieldID, |
|
FieldDeviceCode, |
|
FieldStatus, |
|
FieldToken, |
|
FieldExpiry, |
|
FieldLastRequest, |
|
FieldPollInterval, |
|
FieldCodeChallenge, |
|
FieldCodeChallengeMethod, |
|
} |
|
|
|
// 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 ( |
|
// DeviceCodeValidator is a validator for the "device_code" field. It is called by the builders before save. |
|
DeviceCodeValidator func(string) error |
|
// StatusValidator is a validator for the "status" field. It is called by the builders before save. |
|
StatusValidator func(string) error |
|
// DefaultCodeChallenge holds the default value on creation for the "code_challenge" field. |
|
DefaultCodeChallenge string |
|
// DefaultCodeChallengeMethod holds the default value on creation for the "code_challenge_method" field. |
|
DefaultCodeChallengeMethod string |
|
) |
|
|
|
// OrderOption defines the ordering options for the DeviceToken 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() |
|
} |
|
|
|
// ByDeviceCode orders the results by the device_code field. |
|
func ByDeviceCode(opts ...sql.OrderTermOption) OrderOption { |
|
return sql.OrderByField(FieldDeviceCode, opts...).ToFunc() |
|
} |
|
|
|
// ByStatus orders the results by the status field. |
|
func ByStatus(opts ...sql.OrderTermOption) OrderOption { |
|
return sql.OrderByField(FieldStatus, opts...).ToFunc() |
|
} |
|
|
|
// ByExpiry orders the results by the expiry field. |
|
func ByExpiry(opts ...sql.OrderTermOption) OrderOption { |
|
return sql.OrderByField(FieldExpiry, opts...).ToFunc() |
|
} |
|
|
|
// ByLastRequest orders the results by the last_request field. |
|
func ByLastRequest(opts ...sql.OrderTermOption) OrderOption { |
|
return sql.OrderByField(FieldLastRequest, opts...).ToFunc() |
|
} |
|
|
|
// ByPollInterval orders the results by the poll_interval field. |
|
func ByPollInterval(opts ...sql.OrderTermOption) OrderOption { |
|
return sql.OrderByField(FieldPollInterval, opts...).ToFunc() |
|
} |
|
|
|
// ByCodeChallenge orders the results by the code_challenge field. |
|
func ByCodeChallenge(opts ...sql.OrderTermOption) OrderOption { |
|
return sql.OrderByField(FieldCodeChallenge, opts...).ToFunc() |
|
} |
|
|
|
// ByCodeChallengeMethod orders the results by the code_challenge_method field. |
|
func ByCodeChallengeMethod(opts ...sql.OrderTermOption) OrderOption { |
|
return sql.OrderByField(FieldCodeChallengeMethod, opts...).ToFunc() |
|
}
|
|
|