kafka

package
v0.0.0-...-dcd4fad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaDetails

type KafkaDetails struct {
	Topic     string
	Partition int
	// contains filtered or unexported fields
}

type KafkaProxy

type KafkaProxy struct {
	Consumer *KafkaDetails
	Producer *KafkaDetails
	// contains filtered or unexported fields
}

func (*KafkaProxy) BuyGood

func (kp *KafkaProxy) BuyGood(good string, quantity int) ([]byte, error)

BuyGood sends to game a purchase order.

https://api.spacetraders.io/#api-purchase_orders-NewPurchaseOrder

func (*KafkaProxy) Close

func (kp *KafkaProxy) Close()

func (*KafkaProxy) GetFlightPlan

func (kp *KafkaProxy) GetFlightPlan(planId string) ([]byte, error)

GetFlightPlan retrieves information about current flight plan for specific ship, if any.

https://api.spacetraders.io/#api-flight_plans-GetFlightPlan

func (*KafkaProxy) GetMarketplaceProducts

func (kp *KafkaProxy) GetMarketplaceProducts(location string) ([]byte, error)

GetMarketplaceProducts gathers information about products available to trade in the planet where the ship is.

https://api.spacetraders.io/#api-locations-GetMarketplace

func (*KafkaProxy) GetShipInfo

func (kp *KafkaProxy) GetShipInfo() ([]byte, error)

GetShipInfo collects information about specific ship.

https://api.spacetraders.io/#api-ships-GetShip

func (*KafkaProxy) Read

func (kp *KafkaProxy) Read() []byte

func (*KafkaProxy) SellGood

func (kp *KafkaProxy) SellGood(good string, quantity int) ([]byte, error)

SellGood sends to game a sell order.

https://api.spacetraders.io/#api-sell_orders-NewSellOrder

func (*KafkaProxy) SetNewFlightPlan

func (kp *KafkaProxy) SetNewFlightPlan(destination string) ([]byte, error)

SetNewFlightPlan sends to game a new destination where the ships needs to fly to.

https://api.spacetraders.io/#api-flight_plans-NewFlightPlan

func (*KafkaProxy) Write

func (kp *KafkaProxy) Write(key, msg string) error

type Proxy

type Proxy interface {
	// GetShipInfo collects information about specific ship.
	//
	// https://api.spacetraders.io/#api-ships-GetShip
	GetShipInfo() ([]byte, error)

	// GetMarketplaceProducts gathers information about products available to trade in the planet where the ship is.
	//
	// https://api.spacetraders.io/#api-locations-GetMarketplace
	GetMarketplaceProducts(string) ([]byte, error)

	// SetNewFlightPlan sends to game a new destination where the ships needs to fly to.
	//
	// https://api.spacetraders.io/#api-flight_plans-NewFlightPlan
	SetNewFlightPlan(string) ([]byte, error)

	// GetFlightPlan retrieves information about current flight plan for specific ship, if any.
	//
	// https://api.spacetraders.io/#api-flight_plans-GetFlightPlan
	GetFlightPlan(string) ([]byte, error)

	// BuyGood sends to game a purchase order.
	//
	// https://api.spacetraders.io/#api-purchase_orders-NewPurchaseOrder
	BuyGood(string, int) ([]byte, error)

	// SellGood sends to game a sell order.
	//
	// https://api.spacetraders.io/#api-sell_orders-NewSellOrder
	SellGood(string, int) ([]byte, error)
}

func NewKafkaProxy

func NewKafkaProxy(
	ctx context.Context, id, connectionType, hostname,
	topicRead string, partitionRead int,
	topicWrite string, partitionWrite int) Proxy

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL