This document will not disclose the topic why you need fsm.
But if you implement fsm, then you need to do it as nearly as possible in the data.
This document will explain how you can implement it with PostgreSQL and gives developers maximum freedom.
| 4pda.to | |
| habr.com | |
| openwrt.org |
| diff --git a/.gitignore b/.gitignore | |
| index 94d2001..2078a91 100644 | |
| --- a/.gitignore | |
| +++ b/.gitignore | |
| @@ -1,3 +1,4 @@ | |
| /target | |
| .idea | |
| /examples | |
| +/vendor | |
| diff --git a/Cargo.lock b/Cargo.lock |
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "net" | |
| "os" | |
| "strconv" | |
| "strings" | |
| "time" |
This document will not disclose the topic why you need fsm.
But if you implement fsm, then you need to do it as nearly as possible in the data.
This document will explain how you can implement it with PostgreSQL and gives developers maximum freedom.
| package main | |
| import ( | |
| "encoding/json" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "os" | |
| "os/signal" | |
| "syscall" |
begin;
drop table if exists audit_data;
create table audit_data ( id bigserial unique not null, payment_id text, payload text );
insert into audit_data (payment_id, payload)
select md5(i::text),
repeat(md5(i::text), 10)
from generate_series(1, 1000*1000) s(i);
commit;| /* list of order */ | |
| create table "order" ( | |
| id text primary key, | |
| created_at timestamp with time zone default current_timestamp, | |
| processed_at timestamp with time zone, | |
| processed_state text | |
| ); | |
| /* processed transition on order.id */ | |
| create table order_events ( |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import os | |
| import re | |
| import requests | |
| import sys | |
| from Crypto.Cipher import AES | |
| package crypto | |
| import ( | |
| "bytes" | |
| "crypto/aes" | |
| "fmt" | |
| "io" | |
| ) | |
| // читаем из io.Reader размером size и записываем в io.Writer дешифрованный поток ключом key |