api

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimiter

type RateLimiter struct {
	// contains filtered or unexported fields
}

RateLimiter manages API request timing

func NewRateLimiter

func NewRateLimiter(callsPerMinute int) *RateLimiter

NewRateLimiter creates a new rate limiter

func (*RateLimiter) Wait

func (r *RateLimiter) Wait()

Wait ensures enough time has passed since the last call

type RustMapsClient

type RustMapsClient struct {
	RustMapsClientBase
	ApiUrl string
	// contains filtered or unexported fields
}

func (*RustMapsClient) GenerateCustom

func (c *RustMapsClient) GenerateCustom(log *zap.Logger, m *types.Map) (*RustMapsGenerateResponse, error)

func (*RustMapsClient) GenerateProcedural

func (c *RustMapsClient) GenerateProcedural(log *zap.Logger, m *types.Map) (*RustMapsGenerateResponse, error)

func (*RustMapsClient) GetLimits

func (c *RustMapsClient) GetLimits(log *zap.Logger) (*RustMapsLimitsResponse, error)

func (*RustMapsClient) GetStatus

func (c *RustMapsClient) GetStatus(log *zap.Logger, m *types.Map) (*RustMapsStatusResponse, error)

func (*RustMapsClient) SetApiKey

func (r *RustMapsClient) SetApiKey(apiKey string)

type RustMapsClientBase

type RustMapsClientBase interface {
	GetStatus(log *zap.Logger, m *types.Map) (*RustMapsStatusResponse, error)
	SetApiKey(apiKey string)
	GetLimits(log *zap.Logger) (*RustMapsLimitsResponse, error)
	GenerateCustom(log *zap.Logger, m *types.Map) (*RustMapsGenerateResponse, error)
	GenerateProcedural(log *zap.Logger, m *types.Map) (*RustMapsGenerateResponse, error)
}

func NewRustMapsClient

func NewRustMapsClient(apiKey string) RustMapsClientBase

type RustMapsGenerateCustomRequest

type RustMapsGenerateCustomRequest struct {
	MapParameters RustMapsGenerateProceduralRequest `json:"mapParameters"`
	ConfigName    string                            `json:"configName"`
}

type RustMapsGenerateProceduralRequest

type RustMapsGenerateProceduralRequest struct {
	Size    int    `json:"size"`
	Seed    string `json:"seed"`
	Staging bool   `json:"staging"`
}

type RustMapsGenerateResponse

type RustMapsGenerateResponse struct {
	Meta RustMapsGenerateResponseMeta `json:"meta"`
	Data RustMapsGenerateResponseData `json:"data"`
}

type RustMapsGenerateResponseData

type RustMapsGenerateResponseData struct {
	MapID                string    `json:"mapId"`
	QueuePosition        int       `json:"queuePosition"`
	State                string    `json:"state"`
	CurrentStep          string    `json:"currentStep"`
	LastGeneratorPingUtc time.Time `json:"lastGeneratorPingUtc"`
}

type RustMapsGenerateResponseMeta

type RustMapsGenerateResponseMeta struct {
	Status     string   `json:"status"`
	StatusCode int      `json:"statusCode"`
	Errors     []string `json:"errors"`
}

type RustMapsLimitsResponse

type RustMapsLimitsResponse struct {
	Meta RustMapsLimitsResponseMeta `json:"meta"`
	Data RustMapsLimitsResponseData `json:"data"`
}

type RustMapsLimitsResponseData

type RustMapsLimitsResponseData struct {
	Concurrent RustMapsLimitsResponseDataConcurrent `json:"concurrent"`
	Monthly    RustMapsLimitsResponseDataMonthly    `json:"monthly"`
}

type RustMapsLimitsResponseDataConcurrent

type RustMapsLimitsResponseDataConcurrent struct {
	Current int `json:"current"`
	Allowed int `json:"allowed"`
}

type RustMapsLimitsResponseDataMonthly

type RustMapsLimitsResponseDataMonthly struct {
	Current int `json:"current"`
	Allowed int `json:"allowed"`
}

type RustMapsLimitsResponseMeta

type RustMapsLimitsResponseMeta struct {
	Status     string   `json:"status"`
	StatusCode int      `json:"statusCode"`
	Errors     []string `json:"errors"`
}

type RustMapsStatusResponse

type RustMapsStatusResponse struct {
	Meta RustMapsStatusResponseMeta `json:"meta"`
	Data RustMapsStatusResponseData `json:"data"`
}

type RustMapsStatusResponseData

type RustMapsStatusResponseData struct {
	ID                  string                                     `json:"id"`
	Type                string                                     `json:"type"`
	Seed                int                                        `json:"seed"`
	Size                int                                        `json:"size"`
	SaveVersion         int                                        `json:"saveVersion"`
	URL                 string                                     `json:"url"`
	RawImageURL         string                                     `json:"rawImageUrl"`
	ImageURL            string                                     `json:"imageUrl"`
	ImageIconURL        string                                     `json:"imageIconUrl"`
	ThumbnailURL        string                                     `json:"thumbnailUrl"`
	IsStaging           bool                                       `json:"isStaging"`
	IsCustomMap         bool                                       `json:"isCustomMap"`
	CanDownload         bool                                       `json:"canDownload"`
	DownloadURL         string                                     `json:"downloadUrl"`
	TotalMonuments      int                                        `json:"totalMonuments"`
	Monuments           []RustMapsStatusResponseDataMonuments      `json:"monuments"`
	LandPercentageOfMap int                                        `json:"landPercentageOfMap"`
	BiomePercentages    RustMapsStatusResponseDataBiomePercentages `json:"biomePercentages"`
	Islands             int                                        `json:"islands"`
	Mountains           int                                        `json:"mountains"`
	IceLakes            int                                        `json:"iceLakes"`
	Rivers              int                                        `json:"rivers"`
	Lakes               int                                        `json:"lakes"`
	Canyons             int                                        `json:"canyons"`
	Oases               int                                        `json:"oases"`
	BuildableRocks      int                                        `json:"buildableRocks"`
}

type RustMapsStatusResponseDataBiomePercentages

type RustMapsStatusResponseDataBiomePercentages struct {
	S float64 `json:"s"`
	D float64 `json:"d"`
	F float64 `json:"f"`
	T float64 `json:"t"`
}

type RustMapsStatusResponseDataCoordinates

type RustMapsStatusResponseDataCoordinates struct {
	X int `json:"x"`
	Y int `json:"y"`
}

type RustMapsStatusResponseDataMonuments

type RustMapsStatusResponseDataMonuments struct {
	Type         string                                `json:"type"`
	Coordinates  RustMapsStatusResponseDataCoordinates `json:"coordinates"`
	NameOverride string                                `json:"nameOverride"`
}

type RustMapsStatusResponseMeta

type RustMapsStatusResponseMeta struct {
	Status     string   `json:"status"`
	StatusCode int      `json:"statusCode"`
	Errors     []string `json:"errors"`
}

Jump to

Keyboard shortcuts

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