Skip to content
프로젝트

소개

Polaris: Golang용 고성능 워크플로 오케스트레이터

비즈니스 및 금융

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

An extremely light weight workflow orchestrator for Golang.

Installation | Documentation | Twitter | Inspiration

Quick overview

Polaris helps you create, store and run workflows. A workflow is a series of multiple steps, and can often be long running.

You don't need to worry about:

  • Sequence of steps (it will figure out which the sequence along with the ones that can run concurrently)
  • Explicitly pausing workflows (when it runs out of new data to move the workflow ahead, it pauses)

Payments and Fulfilment

Polaris is especially useful for payments, e-commerce and fulfilment use cases. Consider a payment gateway trying to process payments via cards and netbanking.

Often, a lot of the logic would overlap - such as invoicing, settlements, etc. Polaris can neatly structure your code, making it more maintainable than ever.

type CardPaymentWorkflow struct{}

func (w CPW) GetWorkflowMeta() WorkflowMeta {
    return WorkflowMeta{
        Builders: []IBuilder{
            InitiateReq{},
            EncryptCardInfo{},
            TokenizeCard{},
            ProcessPayment{},
            OTPVerification{},
            PaymentComplete{},
            GenerateInvoice{},
        },
        TargetData: PaymentCompletedData{},
    }
}
type NetbankingPaymentWorkflow struct{}

func (w NPW) GetWorkflowMeta() WorkflowMeta {
    return WorkflowMeta{
        Builders: []IBuilder{
            InitiateReq{},
            FetchBankRedirectURL{},
            RedirectAndCollect{},
            ProcessBankPayment{},
            OTPVerification{},
            PaymentComplete{},
            GenerateInvoice{},
        },
        TargetData: PaymentCompletedData{},
    }
}

Each builder (workflow's unit of work) would maintain and process some logic, which can be reused across multiple workflows.

For example,

type TokenizeCard struct {
    TokenService TokenService
    DB           TokenStore
}

func (b TokenizeCard) GetBuilderInfo() BuilderInfo {
    return BuilderInfo{
        Consumes: []IData{ EncryptedCardData{} },
        Produces: CardTokenData{},
    }
}

func (b TokenizeCard) Process(ctx BuilderContext) IData {
    enc := ctx.Get(EncryptedCardData{})
    token := b.TokenService.Generate(enc)
    b.DB.Save(token)
    return CardTokenData{ Token: token }
}

For more details, dive into the docs!

관련 프로젝트 살펴보기

불러오는 중…