refactor(数据库): 迁移持久层到 Ent 并清理 GORM
将仓储层/基础设施改为 Ent + 原生 SQL 执行路径,并移除 AutoMigrate 与 GORM 依赖。 重构内容包括: - 仓储层改用 Ent/SQL(含 usage_log/account 等复杂查询),统一错误映射 - 基础设施与 setup 初始化切换为 Ent + SQL migrations - 集成测试与 fixtures 迁移到 Ent 事务模型 - 清理遗留 GORM 模型/依赖,补充迁移与文档说明 - 增加根目录 Makefile 便于前后端编译 测试: - go test -tags unit ./... - go test -tags integration ./...
This commit is contained in:
152
backend/ent/proxy/proxy.go
Normal file
152
backend/ent/proxy/proxy.go
Normal file
@@ -0,0 +1,152 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the proxy type in the database.
|
||||
Label = "proxy"
|
||||
// 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"
|
||||
// FieldDeletedAt holds the string denoting the deleted_at field in the database.
|
||||
FieldDeletedAt = "deleted_at"
|
||||
// FieldName holds the string denoting the name field in the database.
|
||||
FieldName = "name"
|
||||
// FieldProtocol holds the string denoting the protocol field in the database.
|
||||
FieldProtocol = "protocol"
|
||||
// FieldHost holds the string denoting the host field in the database.
|
||||
FieldHost = "host"
|
||||
// FieldPort holds the string denoting the port field in the database.
|
||||
FieldPort = "port"
|
||||
// FieldUsername holds the string denoting the username field in the database.
|
||||
FieldUsername = "username"
|
||||
// FieldPassword holds the string denoting the password field in the database.
|
||||
FieldPassword = "password"
|
||||
// FieldStatus holds the string denoting the status field in the database.
|
||||
FieldStatus = "status"
|
||||
// Table holds the table name of the proxy in the database.
|
||||
Table = "proxies"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for proxy fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldCreatedAt,
|
||||
FieldUpdatedAt,
|
||||
FieldDeletedAt,
|
||||
FieldName,
|
||||
FieldProtocol,
|
||||
FieldHost,
|
||||
FieldPort,
|
||||
FieldUsername,
|
||||
FieldPassword,
|
||||
FieldStatus,
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
// 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/Wei-Shaw/sub2api/ent/runtime"
|
||||
var (
|
||||
Hooks [1]ent.Hook
|
||||
Interceptors [1]ent.Interceptor
|
||||
// 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
|
||||
// NameValidator is a validator for the "name" field. It is called by the builders before save.
|
||||
NameValidator func(string) error
|
||||
// ProtocolValidator is a validator for the "protocol" field. It is called by the builders before save.
|
||||
ProtocolValidator func(string) error
|
||||
// HostValidator is a validator for the "host" field. It is called by the builders before save.
|
||||
HostValidator func(string) error
|
||||
// UsernameValidator is a validator for the "username" field. It is called by the builders before save.
|
||||
UsernameValidator func(string) error
|
||||
// PasswordValidator is a validator for the "password" field. It is called by the builders before save.
|
||||
PasswordValidator func(string) error
|
||||
// DefaultStatus holds the default value on creation for the "status" field.
|
||||
DefaultStatus string
|
||||
// StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
||||
StatusValidator func(string) error
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the Proxy 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()
|
||||
}
|
||||
|
||||
// ByUpdatedAt orders the results by the updated_at field.
|
||||
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByDeletedAt orders the results by the deleted_at field.
|
||||
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByName orders the results by the name field.
|
||||
func ByName(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldName, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByProtocol orders the results by the protocol field.
|
||||
func ByProtocol(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldProtocol, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByHost orders the results by the host field.
|
||||
func ByHost(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldHost, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByPort orders the results by the port field.
|
||||
func ByPort(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPort, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByUsername orders the results by the username field.
|
||||
func ByUsername(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUsername, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByPassword orders the results by the password field.
|
||||
func ByPassword(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPassword, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByStatus orders the results by the status field.
|
||||
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
||||
}
|
||||
700
backend/ent/proxy/where.go
Normal file
700
backend/ent/proxy/where.go
Normal file
@@ -0,0 +1,700 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"github.com/Wei-Shaw/sub2api/ent/predicate"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int64) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int64) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int64) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int64) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int64) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int64) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int64) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int64) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int64) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
|
||||
func UpdatedAt(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ.
|
||||
func DeletedAt(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldDeletedAt, v))
|
||||
}
|
||||
|
||||
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
|
||||
func Name(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldName, v))
|
||||
}
|
||||
|
||||
// Protocol applies equality check predicate on the "protocol" field. It's identical to ProtocolEQ.
|
||||
func Protocol(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldProtocol, v))
|
||||
}
|
||||
|
||||
// Host applies equality check predicate on the "host" field. It's identical to HostEQ.
|
||||
func Host(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldHost, v))
|
||||
}
|
||||
|
||||
// Port applies equality check predicate on the "port" field. It's identical to PortEQ.
|
||||
func Port(v int) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldPort, v))
|
||||
}
|
||||
|
||||
// Username applies equality check predicate on the "username" field. It's identical to UsernameEQ.
|
||||
func Username(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldUsername, v))
|
||||
}
|
||||
|
||||
// Password applies equality check predicate on the "password" field. It's identical to PasswordEQ.
|
||||
func Password(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldPassword, v))
|
||||
}
|
||||
|
||||
// Status applies equality check predicate on the "status" field. It's identical to StatusEQ.
|
||||
func Status(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldStatus, v))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||||
func CreatedAtEQ(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
|
||||
func CreatedAtNEQ(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtIn applies the In predicate on the "created_at" field.
|
||||
func CreatedAtIn(vs ...time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
|
||||
func CreatedAtNotIn(vs ...time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtGT applies the GT predicate on the "created_at" field.
|
||||
func CreatedAtGT(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
|
||||
func CreatedAtGTE(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLT applies the LT predicate on the "created_at" field.
|
||||
func CreatedAtLT(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
|
||||
func CreatedAtLTE(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
|
||||
func UpdatedAtEQ(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
|
||||
func UpdatedAtNEQ(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtIn applies the In predicate on the "updated_at" field.
|
||||
func UpdatedAtIn(vs ...time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
|
||||
func UpdatedAtNotIn(vs ...time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
|
||||
func UpdatedAtGT(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
|
||||
func UpdatedAtGTE(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
|
||||
func UpdatedAtLT(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
|
||||
func UpdatedAtLTE(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// DeletedAtEQ applies the EQ predicate on the "deleted_at" field.
|
||||
func DeletedAtEQ(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldDeletedAt, v))
|
||||
}
|
||||
|
||||
// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field.
|
||||
func DeletedAtNEQ(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNEQ(FieldDeletedAt, v))
|
||||
}
|
||||
|
||||
// DeletedAtIn applies the In predicate on the "deleted_at" field.
|
||||
func DeletedAtIn(vs ...time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIn(FieldDeletedAt, vs...))
|
||||
}
|
||||
|
||||
// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field.
|
||||
func DeletedAtNotIn(vs ...time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotIn(FieldDeletedAt, vs...))
|
||||
}
|
||||
|
||||
// DeletedAtGT applies the GT predicate on the "deleted_at" field.
|
||||
func DeletedAtGT(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGT(FieldDeletedAt, v))
|
||||
}
|
||||
|
||||
// DeletedAtGTE applies the GTE predicate on the "deleted_at" field.
|
||||
func DeletedAtGTE(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGTE(FieldDeletedAt, v))
|
||||
}
|
||||
|
||||
// DeletedAtLT applies the LT predicate on the "deleted_at" field.
|
||||
func DeletedAtLT(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLT(FieldDeletedAt, v))
|
||||
}
|
||||
|
||||
// DeletedAtLTE applies the LTE predicate on the "deleted_at" field.
|
||||
func DeletedAtLTE(v time.Time) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLTE(FieldDeletedAt, v))
|
||||
}
|
||||
|
||||
// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field.
|
||||
func DeletedAtIsNil() predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIsNull(FieldDeletedAt))
|
||||
}
|
||||
|
||||
// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field.
|
||||
func DeletedAtNotNil() predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotNull(FieldDeletedAt))
|
||||
}
|
||||
|
||||
// NameEQ applies the EQ predicate on the "name" field.
|
||||
func NameEQ(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldName, v))
|
||||
}
|
||||
|
||||
// NameNEQ applies the NEQ predicate on the "name" field.
|
||||
func NameNEQ(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNEQ(FieldName, v))
|
||||
}
|
||||
|
||||
// NameIn applies the In predicate on the "name" field.
|
||||
func NameIn(vs ...string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIn(FieldName, vs...))
|
||||
}
|
||||
|
||||
// NameNotIn applies the NotIn predicate on the "name" field.
|
||||
func NameNotIn(vs ...string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotIn(FieldName, vs...))
|
||||
}
|
||||
|
||||
// NameGT applies the GT predicate on the "name" field.
|
||||
func NameGT(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGT(FieldName, v))
|
||||
}
|
||||
|
||||
// NameGTE applies the GTE predicate on the "name" field.
|
||||
func NameGTE(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGTE(FieldName, v))
|
||||
}
|
||||
|
||||
// NameLT applies the LT predicate on the "name" field.
|
||||
func NameLT(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLT(FieldName, v))
|
||||
}
|
||||
|
||||
// NameLTE applies the LTE predicate on the "name" field.
|
||||
func NameLTE(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLTE(FieldName, v))
|
||||
}
|
||||
|
||||
// NameContains applies the Contains predicate on the "name" field.
|
||||
func NameContains(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldContains(FieldName, v))
|
||||
}
|
||||
|
||||
// NameHasPrefix applies the HasPrefix predicate on the "name" field.
|
||||
func NameHasPrefix(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldHasPrefix(FieldName, v))
|
||||
}
|
||||
|
||||
// NameHasSuffix applies the HasSuffix predicate on the "name" field.
|
||||
func NameHasSuffix(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldHasSuffix(FieldName, v))
|
||||
}
|
||||
|
||||
// NameEqualFold applies the EqualFold predicate on the "name" field.
|
||||
func NameEqualFold(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEqualFold(FieldName, v))
|
||||
}
|
||||
|
||||
// NameContainsFold applies the ContainsFold predicate on the "name" field.
|
||||
func NameContainsFold(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldContainsFold(FieldName, v))
|
||||
}
|
||||
|
||||
// ProtocolEQ applies the EQ predicate on the "protocol" field.
|
||||
func ProtocolEQ(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldProtocol, v))
|
||||
}
|
||||
|
||||
// ProtocolNEQ applies the NEQ predicate on the "protocol" field.
|
||||
func ProtocolNEQ(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNEQ(FieldProtocol, v))
|
||||
}
|
||||
|
||||
// ProtocolIn applies the In predicate on the "protocol" field.
|
||||
func ProtocolIn(vs ...string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIn(FieldProtocol, vs...))
|
||||
}
|
||||
|
||||
// ProtocolNotIn applies the NotIn predicate on the "protocol" field.
|
||||
func ProtocolNotIn(vs ...string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotIn(FieldProtocol, vs...))
|
||||
}
|
||||
|
||||
// ProtocolGT applies the GT predicate on the "protocol" field.
|
||||
func ProtocolGT(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGT(FieldProtocol, v))
|
||||
}
|
||||
|
||||
// ProtocolGTE applies the GTE predicate on the "protocol" field.
|
||||
func ProtocolGTE(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGTE(FieldProtocol, v))
|
||||
}
|
||||
|
||||
// ProtocolLT applies the LT predicate on the "protocol" field.
|
||||
func ProtocolLT(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLT(FieldProtocol, v))
|
||||
}
|
||||
|
||||
// ProtocolLTE applies the LTE predicate on the "protocol" field.
|
||||
func ProtocolLTE(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLTE(FieldProtocol, v))
|
||||
}
|
||||
|
||||
// ProtocolContains applies the Contains predicate on the "protocol" field.
|
||||
func ProtocolContains(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldContains(FieldProtocol, v))
|
||||
}
|
||||
|
||||
// ProtocolHasPrefix applies the HasPrefix predicate on the "protocol" field.
|
||||
func ProtocolHasPrefix(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldHasPrefix(FieldProtocol, v))
|
||||
}
|
||||
|
||||
// ProtocolHasSuffix applies the HasSuffix predicate on the "protocol" field.
|
||||
func ProtocolHasSuffix(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldHasSuffix(FieldProtocol, v))
|
||||
}
|
||||
|
||||
// ProtocolEqualFold applies the EqualFold predicate on the "protocol" field.
|
||||
func ProtocolEqualFold(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEqualFold(FieldProtocol, v))
|
||||
}
|
||||
|
||||
// ProtocolContainsFold applies the ContainsFold predicate on the "protocol" field.
|
||||
func ProtocolContainsFold(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldContainsFold(FieldProtocol, v))
|
||||
}
|
||||
|
||||
// HostEQ applies the EQ predicate on the "host" field.
|
||||
func HostEQ(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldHost, v))
|
||||
}
|
||||
|
||||
// HostNEQ applies the NEQ predicate on the "host" field.
|
||||
func HostNEQ(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNEQ(FieldHost, v))
|
||||
}
|
||||
|
||||
// HostIn applies the In predicate on the "host" field.
|
||||
func HostIn(vs ...string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIn(FieldHost, vs...))
|
||||
}
|
||||
|
||||
// HostNotIn applies the NotIn predicate on the "host" field.
|
||||
func HostNotIn(vs ...string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotIn(FieldHost, vs...))
|
||||
}
|
||||
|
||||
// HostGT applies the GT predicate on the "host" field.
|
||||
func HostGT(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGT(FieldHost, v))
|
||||
}
|
||||
|
||||
// HostGTE applies the GTE predicate on the "host" field.
|
||||
func HostGTE(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGTE(FieldHost, v))
|
||||
}
|
||||
|
||||
// HostLT applies the LT predicate on the "host" field.
|
||||
func HostLT(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLT(FieldHost, v))
|
||||
}
|
||||
|
||||
// HostLTE applies the LTE predicate on the "host" field.
|
||||
func HostLTE(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLTE(FieldHost, v))
|
||||
}
|
||||
|
||||
// HostContains applies the Contains predicate on the "host" field.
|
||||
func HostContains(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldContains(FieldHost, v))
|
||||
}
|
||||
|
||||
// HostHasPrefix applies the HasPrefix predicate on the "host" field.
|
||||
func HostHasPrefix(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldHasPrefix(FieldHost, v))
|
||||
}
|
||||
|
||||
// HostHasSuffix applies the HasSuffix predicate on the "host" field.
|
||||
func HostHasSuffix(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldHasSuffix(FieldHost, v))
|
||||
}
|
||||
|
||||
// HostEqualFold applies the EqualFold predicate on the "host" field.
|
||||
func HostEqualFold(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEqualFold(FieldHost, v))
|
||||
}
|
||||
|
||||
// HostContainsFold applies the ContainsFold predicate on the "host" field.
|
||||
func HostContainsFold(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldContainsFold(FieldHost, v))
|
||||
}
|
||||
|
||||
// PortEQ applies the EQ predicate on the "port" field.
|
||||
func PortEQ(v int) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldPort, v))
|
||||
}
|
||||
|
||||
// PortNEQ applies the NEQ predicate on the "port" field.
|
||||
func PortNEQ(v int) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNEQ(FieldPort, v))
|
||||
}
|
||||
|
||||
// PortIn applies the In predicate on the "port" field.
|
||||
func PortIn(vs ...int) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIn(FieldPort, vs...))
|
||||
}
|
||||
|
||||
// PortNotIn applies the NotIn predicate on the "port" field.
|
||||
func PortNotIn(vs ...int) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotIn(FieldPort, vs...))
|
||||
}
|
||||
|
||||
// PortGT applies the GT predicate on the "port" field.
|
||||
func PortGT(v int) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGT(FieldPort, v))
|
||||
}
|
||||
|
||||
// PortGTE applies the GTE predicate on the "port" field.
|
||||
func PortGTE(v int) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGTE(FieldPort, v))
|
||||
}
|
||||
|
||||
// PortLT applies the LT predicate on the "port" field.
|
||||
func PortLT(v int) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLT(FieldPort, v))
|
||||
}
|
||||
|
||||
// PortLTE applies the LTE predicate on the "port" field.
|
||||
func PortLTE(v int) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLTE(FieldPort, v))
|
||||
}
|
||||
|
||||
// UsernameEQ applies the EQ predicate on the "username" field.
|
||||
func UsernameEQ(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameNEQ applies the NEQ predicate on the "username" field.
|
||||
func UsernameNEQ(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNEQ(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameIn applies the In predicate on the "username" field.
|
||||
func UsernameIn(vs ...string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIn(FieldUsername, vs...))
|
||||
}
|
||||
|
||||
// UsernameNotIn applies the NotIn predicate on the "username" field.
|
||||
func UsernameNotIn(vs ...string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotIn(FieldUsername, vs...))
|
||||
}
|
||||
|
||||
// UsernameGT applies the GT predicate on the "username" field.
|
||||
func UsernameGT(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGT(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameGTE applies the GTE predicate on the "username" field.
|
||||
func UsernameGTE(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGTE(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameLT applies the LT predicate on the "username" field.
|
||||
func UsernameLT(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLT(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameLTE applies the LTE predicate on the "username" field.
|
||||
func UsernameLTE(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLTE(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameContains applies the Contains predicate on the "username" field.
|
||||
func UsernameContains(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldContains(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameHasPrefix applies the HasPrefix predicate on the "username" field.
|
||||
func UsernameHasPrefix(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldHasPrefix(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameHasSuffix applies the HasSuffix predicate on the "username" field.
|
||||
func UsernameHasSuffix(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldHasSuffix(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameIsNil applies the IsNil predicate on the "username" field.
|
||||
func UsernameIsNil() predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIsNull(FieldUsername))
|
||||
}
|
||||
|
||||
// UsernameNotNil applies the NotNil predicate on the "username" field.
|
||||
func UsernameNotNil() predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotNull(FieldUsername))
|
||||
}
|
||||
|
||||
// UsernameEqualFold applies the EqualFold predicate on the "username" field.
|
||||
func UsernameEqualFold(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEqualFold(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameContainsFold applies the ContainsFold predicate on the "username" field.
|
||||
func UsernameContainsFold(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldContainsFold(FieldUsername, v))
|
||||
}
|
||||
|
||||
// PasswordEQ applies the EQ predicate on the "password" field.
|
||||
func PasswordEQ(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordNEQ applies the NEQ predicate on the "password" field.
|
||||
func PasswordNEQ(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNEQ(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordIn applies the In predicate on the "password" field.
|
||||
func PasswordIn(vs ...string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIn(FieldPassword, vs...))
|
||||
}
|
||||
|
||||
// PasswordNotIn applies the NotIn predicate on the "password" field.
|
||||
func PasswordNotIn(vs ...string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotIn(FieldPassword, vs...))
|
||||
}
|
||||
|
||||
// PasswordGT applies the GT predicate on the "password" field.
|
||||
func PasswordGT(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGT(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordGTE applies the GTE predicate on the "password" field.
|
||||
func PasswordGTE(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGTE(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordLT applies the LT predicate on the "password" field.
|
||||
func PasswordLT(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLT(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordLTE applies the LTE predicate on the "password" field.
|
||||
func PasswordLTE(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLTE(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordContains applies the Contains predicate on the "password" field.
|
||||
func PasswordContains(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldContains(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordHasPrefix applies the HasPrefix predicate on the "password" field.
|
||||
func PasswordHasPrefix(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldHasPrefix(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordHasSuffix applies the HasSuffix predicate on the "password" field.
|
||||
func PasswordHasSuffix(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldHasSuffix(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordIsNil applies the IsNil predicate on the "password" field.
|
||||
func PasswordIsNil() predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIsNull(FieldPassword))
|
||||
}
|
||||
|
||||
// PasswordNotNil applies the NotNil predicate on the "password" field.
|
||||
func PasswordNotNil() predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotNull(FieldPassword))
|
||||
}
|
||||
|
||||
// PasswordEqualFold applies the EqualFold predicate on the "password" field.
|
||||
func PasswordEqualFold(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEqualFold(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordContainsFold applies the ContainsFold predicate on the "password" field.
|
||||
func PasswordContainsFold(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldContainsFold(FieldPassword, v))
|
||||
}
|
||||
|
||||
// StatusEQ applies the EQ predicate on the "status" field.
|
||||
func StatusEQ(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEQ(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusNEQ applies the NEQ predicate on the "status" field.
|
||||
func StatusNEQ(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNEQ(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusIn applies the In predicate on the "status" field.
|
||||
func StatusIn(vs ...string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldIn(FieldStatus, vs...))
|
||||
}
|
||||
|
||||
// StatusNotIn applies the NotIn predicate on the "status" field.
|
||||
func StatusNotIn(vs ...string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldNotIn(FieldStatus, vs...))
|
||||
}
|
||||
|
||||
// StatusGT applies the GT predicate on the "status" field.
|
||||
func StatusGT(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGT(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusGTE applies the GTE predicate on the "status" field.
|
||||
func StatusGTE(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldGTE(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusLT applies the LT predicate on the "status" field.
|
||||
func StatusLT(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLT(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusLTE applies the LTE predicate on the "status" field.
|
||||
func StatusLTE(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldLTE(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusContains applies the Contains predicate on the "status" field.
|
||||
func StatusContains(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldContains(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusHasPrefix applies the HasPrefix predicate on the "status" field.
|
||||
func StatusHasPrefix(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldHasPrefix(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusHasSuffix applies the HasSuffix predicate on the "status" field.
|
||||
func StatusHasSuffix(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldHasSuffix(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusEqualFold applies the EqualFold predicate on the "status" field.
|
||||
func StatusEqualFold(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldEqualFold(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusContainsFold applies the ContainsFold predicate on the "status" field.
|
||||
func StatusContainsFold(v string) predicate.Proxy {
|
||||
return predicate.Proxy(sql.FieldContainsFold(FieldStatus, v))
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.Proxy) predicate.Proxy {
|
||||
return predicate.Proxy(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.Proxy) predicate.Proxy {
|
||||
return predicate.Proxy(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.Proxy) predicate.Proxy {
|
||||
return predicate.Proxy(sql.NotPredicates(p))
|
||||
}
|
||||
Reference in New Issue
Block a user