decentralized

package
v0.4.40 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "decentralized"

Variables

This section is empty.

Functions

func NewComponent

func NewComponent(_ context.Context, apiServer *echo.Echo, config *config.File, databaseClient database.Client, redisClient rueidis.Client) component.Component

Types

type AccountActivitiesRequest

type AccountActivitiesRequest struct {
	Account        string               `param:"account" validate:"required"`
	Limit          int                  `query:"limit" validate:"min=1,max=100" default:"100"`
	ActionLimit    int                  `query:"action_limit" validate:"min=1,max=20" default:"10"`
	Cursor         *string              `query:"cursor"`
	SinceTimestamp *uint64              `query:"since_timestamp"`
	UntilTimestamp *uint64              `query:"until_timestamp"`
	Status         *bool                `query:"success"`
	Direction      *activityx.Direction `query:"direction"`
	Network        []network.Network    `query:"network"`
	Tag            []tag.Tag            `query:"tag"`
	Type           []schema.Type        `query:"-"`
	Platform       []string             `query:"platform"`
}

type ActivitiesResponse

type ActivitiesResponse struct {
	Data []*activityx.Activity `json:"data"`
	Meta *MetaCursor           `json:"meta,omitempty"`
}

type ActivityRequest

type ActivityRequest struct {
	ID          string `param:"id"`
	ActionLimit int    `query:"action_limit"  validate:"min=1,max=20" default:"10"`
	ActionPage  int    `query:"action_page" validate:"min=1" default:"1"`
}

type ActivityResponse

type ActivityResponse struct {
	Data *activityx.Activity `json:"data"`
	Meta *MetaTotalPages     `json:"meta"`
}

type Component

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

func (*Component) CollectMetric

func (c *Component) CollectMetric(ctx context.Context, value string)

func (*Component) GetAccountActivities

func (c *Component) GetAccountActivities(ctx echo.Context) (err error)

func (*Component) GetActivitiesCount

func (c *Component) GetActivitiesCount(ctx echo.Context) error

func (*Component) GetActivity

func (c *Component) GetActivity(ctx echo.Context) error

func (*Component) GetWorkers

func (c *Component) GetWorkers(ctx echo.Context) error

GetWorkers returns the status of all workers.

func (*Component) InitMeter

func (c *Component) InitMeter() (err error)

func (*Component) Name

func (c *Component) Name() string

type MetaCursor

type MetaCursor struct {
	Cursor string `json:"cursor"`
}

type MetaTotalPages

type MetaTotalPages struct {
	TotalPages int `json:"totalPages"`
}

type StatisticResponse

type StatisticResponse struct {
	Count      int64      `json:"count"`
	LastUpdate *time.Time `json:"last_update,omitempty"`
}

type WorkerInfo

type WorkerInfo struct {
	Network  network.Network `json:"network"`
	Worker   worker.Worker   `json:"worker"`
	Tags     []tag.Tag       `json:"tags"`
	Platform worker.Platform `json:"platform"`
	Status   worker.Status   `json:"status"`
}

type WorkerKey added in v0.4.24

type WorkerKey struct {
	Network network.Network
	Worker  worker.Worker
}

WorkerKey is the key for the worker status aggregator.

type WorkerResponse

type WorkerResponse struct {
	Data []*WorkerInfo `json:"data"`
}

type WorkerStatusAggregator added in v0.4.24

type WorkerStatusAggregator struct {
	Statuses []worker.Status
}

WorkerStatusAggregator aggregates the statuses of workers with the same Network+Worker.

Jump to

Keyboard shortcuts

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