github.com/crowdsecurity/crowdsec@v1.6.1/pkg/database/ent/schema/lock.go (about)

     1  package schema
     2  
     3  import (
     4  	"entgo.io/ent"
     5  	"entgo.io/ent/schema/field"
     6  	"github.com/crowdsecurity/crowdsec/pkg/types"
     7  )
     8  
     9  type Lock struct {
    10  	ent.Schema
    11  }
    12  
    13  func (Lock) Fields() []ent.Field {
    14  	return []ent.Field{
    15  		field.String("name").Unique().StructTag(`json:"name"`),
    16  		field.Time("created_at").Default(types.UtcNow).StructTag(`json:"created_at"`),
    17  	}
    18  }
    19  
    20  func (Lock) Edges() []ent.Edge {
    21  	return nil
    22  }