Documentation ¶
Index ¶
- Constants
- Variables
- func Create(db *gorm.DB, lawsuit *Lawsuit) error
- func DoCrawler(lawsuitNumber string) (map[string]LawSuitCrawler, error)
- func IsLawsuitNumber(lawsuitNumber string) bool
- func Update(db *gorm.DB, lawsuit *Lawsuit) error
- type LawSuitCrawler
- type Lawsuit
- func GetByOrderID(db *gorm.DB, orderID string) (*Lawsuit, error)
- func GetByOrderIDAndLawsuitNumber(db *gorm.DB, orderID string, lawsuitNumber string) (*Lawsuit, error)
- func New(lawsuitNumber string) *Lawsuit
- func Process(db *gorm.DB, channel *amqp.Channel, lawsuitNumber string) (*Lawsuit, error)
- func ProcessFinished(db *gorm.DB, input *ProcessFinishedInput) (*Lawsuit, error)
- type ProcessFinishedInput
Constants ¶
View Source
const (
LawsuitTableName = "lawsuit"
)
View Source
const QueueProcessName = "stiuswalProcess"
Variables ¶
View Source
var (
LawsuitNumberRegex = regexp.MustCompile(`^\d{7}\-\d{2}\.\d{4}\.\d{1}\.\d{2}\.\d{4}$`)
)
Functions ¶
func IsLawsuitNumber ¶
Types ¶
type LawSuitCrawler ¶
type LawSuitCrawler struct { Classe string `json:"classe"` Area string `json:"area"` Assunto string `json:"assunto"` DataDeDistribuição string `json:"data_de_distribuição"` Juiz string `json:"juiz"` ValorDaAção string `json:"valor_da_ação"` PartesDoProcesso []string `json:"partes_do_processo"` ListaDasMovimentações map[string]string `json:"lista_das_movimentações"` }
type Lawsuit ¶
type Lawsuit struct { ID uint `gorm:"primary_key"` OrderID string `gorm:"column:order_id"` LawsuitNumber string `gorm:"column:lawsuit_number"` Processed bool `gorm:"column:processed"` Criticized bool `gorm:"column:criticized"` CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` Output postgres.Jsonb `gorm:"column:output"` }
func ProcessFinished ¶
func ProcessFinished(db *gorm.DB, input *ProcessFinishedInput) (*Lawsuit, error)
type ProcessFinishedInput ¶
type ProcessFinishedInput struct { OrderID string `json:"order-id"` LawsuitNumber string `json:"lawsuit-number"` Criticized bool `json:"criticized"` Output json.RawMessage `json:"output"` }
func (*ProcessFinishedInput) Ok ¶
func (i *ProcessFinishedInput) Ok() error
Click to show internal directories.
Click to hide internal directories.