github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/models/operator.go (about)

     1  package models
     2  
     3  import (
     4  	"github.com/machinefi/w3bstream/pkg/depends/base/types"
     5  	"github.com/machinefi/w3bstream/pkg/depends/kit/sqlx/datatypes"
     6  	"github.com/machinefi/w3bstream/pkg/enums"
     7  )
     8  
     9  // Operator schema for blockchain operate information
    10  // @def primary                      ID
    11  // @def unique_index UI_operator_id  OperatorID
    12  // @def unique_index UI_name         AccountID Name
    13  //
    14  //go:generate toolkit gen model Operator --database DB
    15  type Operator struct {
    16  	datatypes.PrimaryID
    17  	RelAccount
    18  	RelOperator
    19  	OperatorInfo
    20  	datatypes.OperationTimesWithDeleted
    21  }
    22  
    23  type RelOperator struct {
    24  	OperatorID types.SFID `db:"f_operator_id" json:"operatorID"`
    25  }
    26  
    27  type OperatorInfo struct {
    28  	PrivateKey   string                `db:"f_private_key,size=1024"        json:"-"`
    29  	PaymasterKey string                `db:"f_paymaster_key,default=''"     json:"-"`
    30  	Name         string                `db:"f_name"                         json:"name"`
    31  	Type         enums.OperatorKeyType `db:"f_type,default='1'"             json:"type,omitempty,default='1'"`
    32  }