mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-17 06:52:26 +02:00
* implement highAvailability feature --------- Co-authored-by: Marco Mariani <marco@crowdsec.net>
22 lines
402 B
Go
22 lines
402 B
Go
package schema
|
|
|
|
import (
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/field"
|
|
"github.com/crowdsecurity/crowdsec/pkg/types"
|
|
)
|
|
|
|
type Lock struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (Lock) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.String("name").Unique().StructTag(`json:"name"`),
|
|
field.Time("created_at").Default(types.UtcNow).StructTag(`json:"created_at"`),
|
|
}
|
|
}
|
|
|
|
func (Lock) Edges() []ent.Edge {
|
|
return nil
|
|
}
|