Documentation ¶
Index ¶
- Constants
- type Message
- type MessageHandler
- type MessageHandlerOption
- func WithCellStore(cellStore store.CellStore) MessageHandlerOption
- func WithQueueProducer(q *background.QueueProducer[Message]) MessageHandlerOption
- func WithServerBillingHourlyProducer(q *background.QueueProducer[serverbillinghourly.Message]) MessageHandlerOption
- func WithServerOfferingStore(serverOfferingStore store.ServerOfferingStore) MessageHandlerOption
- func WithServerProviderHetzner(serverProviderHetzner serverprovider.ServerProvider) MessageHandlerOption
- func WithServerStore(serverStore store.ServerStore) MessageHandlerOption
- func WithSshKeyBase64(sshKeyBase64 string) MessageHandlerOption
- func WithSshKeyFingerprint(sshKeyFingerprint string) MessageHandlerOption
- func WithSshKeyPassword(sshKeyPassword string) MessageHandlerOption
- func WithStripeCheckoutSession(stripeCheckoutSession *session.Client) MessageHandlerOption
- func WithTalosCellProvider(talosCellProvider *cellprovider.TalosClusterCellProvider) MessageHandlerOption
- func WithTalosProviderHetzner(talosProviderHetzner *talosprovider.HetznerProvider) MessageHandlerOption
- func WithTeamStore(teamStore store.TeamStore) MessageHandlerOption
- func WithUserStore(userStore store.UserStore) MessageHandlerOption
- type StepBuyServer
Constants ¶
View Source
const ServerFulfillmentCheckInterval = 30 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { TeamId string UserId string OfferingId string LocationId string StripeCheckoutSessionId string // in the future these might be configurable on a per-fulfillment basis // e.g. to put a new server into an existing cell // or to create a new cell that has custom dns CellName string // defaults to default cell DnsZoneId string StepServerId string StepPaymentReceived bool StepProviderTransactionId string StepProviderServerId string StepServerOnline bool StepServerInstalled bool StepTalosOnline bool StepServerAddedToCell bool }
Message is sent as soon as a server is purchased. It takes care of the following: - creating the server object in the db - waiting for payment to be confirmed - ordering the server - waiting for the server to come online - setting up the server (installing Talos) If any of these steps involve waiting, then the logic will re-queue the message with a delay of 30s to check again later.
type MessageHandler ¶
type MessageHandler struct {
// contains filtered or unexported fields
}
func NewMessageHandler ¶
func NewMessageHandler(opts ...MessageHandlerOption) (*MessageHandler, error)
type MessageHandlerOption ¶
type MessageHandlerOption func(*MessageHandler) error
func WithCellStore ¶
func WithCellStore(cellStore store.CellStore) MessageHandlerOption
func WithQueueProducer ¶
func WithQueueProducer(q *background.QueueProducer[Message]) MessageHandlerOption
func WithServerBillingHourlyProducer ¶
func WithServerBillingHourlyProducer(q *background.QueueProducer[serverbillinghourly.Message]) MessageHandlerOption
func WithServerOfferingStore ¶
func WithServerOfferingStore(serverOfferingStore store.ServerOfferingStore) MessageHandlerOption
func WithServerProviderHetzner ¶
func WithServerProviderHetzner(serverProviderHetzner serverprovider.ServerProvider) MessageHandlerOption
func WithServerStore ¶
func WithServerStore(serverStore store.ServerStore) MessageHandlerOption
func WithSshKeyBase64 ¶
func WithSshKeyBase64(sshKeyBase64 string) MessageHandlerOption
func WithSshKeyFingerprint ¶
func WithSshKeyFingerprint(sshKeyFingerprint string) MessageHandlerOption
func WithSshKeyPassword ¶
func WithSshKeyPassword(sshKeyPassword string) MessageHandlerOption
func WithStripeCheckoutSession ¶
func WithStripeCheckoutSession(stripeCheckoutSession *session.Client) MessageHandlerOption
func WithTalosCellProvider ¶
func WithTalosCellProvider(talosCellProvider *cellprovider.TalosClusterCellProvider) MessageHandlerOption
func WithTalosProviderHetzner ¶
func WithTalosProviderHetzner(talosProviderHetzner *talosprovider.HetznerProvider) MessageHandlerOption
func WithTeamStore ¶
func WithTeamStore(teamStore store.TeamStore) MessageHandlerOption
func WithUserStore ¶
func WithUserStore(userStore store.UserStore) MessageHandlerOption
type StepBuyServer ¶
type StepBuyServer struct {
TransactionId *string
}
StepBuyServer buys the server and fills out the transaction ID
Click to show internal directories.
Click to hide internal directories.