v1

package
v0.0.0-...-519bf1e Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Code generated by idl2go from JSON generated by Barrister v0.1.6

Index

Constants

View Source
const (
	EventSourceTypeHttp        EventSourceType = "http"
	EventSourceTypeCron                        = "cron"
	EventSourceTypeSqs                         = "sqs"
	EventSourceTypeAwsstepfunc                 = "awsstepfunc"
)
View Source
const (
	StartParallelismParallel    StartParallelism = "parallel"
	StartParallelismSeries                       = "series"
	StartParallelismSeriesfirst                  = "seriesfirst"
)
View Source
const (
	ComponentStatusActive   ComponentStatus = "active"
	ComponentStatusStarting                 = "starting"
	ComponentStatusStopping                 = "stopping"
)
View Source
const BarristerChecksum string = "87ef9444ef9262bbe7d97cb2e46997e8"
View Source
const BarristerDateGenerated int64 = 1606767518809000000
View Source
const BarristerVersion string = "0.1.6"

Variables

View Source
var IdlJsonRaw = `` /* 97083-byte string literal not displayed */

Functions

func HealthCheckSeconds

func HealthCheckSeconds(d *DockerComponent) int64

func NewJSONServer

func NewJSONServer(idl *barrister.Idl, forceASCII bool, maelstromservice MaelstromService, nodeservice NodeService) barrister.Server

func NewServer

func NewServer(idl *barrister.Idl, ser barrister.Serializer, maelstromservice MaelstromService, nodeservice NodeService) barrister.Server

Types

type AwsLifecycleHook

type AwsLifecycleHook struct {
	QueueUrl             string `json:"QueueUrl"`
	MessageReceiptHandle string `json:"MessageReceiptHandle"`
	AutoScalingGroupName string `json:"AutoScalingGroupName"`
	InstanceId           string `json:"InstanceId"`
	LifecycleActionToken string `json:"LifecycleActionToken"`
	LifecycleHookName    string `json:"LifecycleHookName"`
}

type AwsStepFunctionEventSource

type AwsStepFunctionEventSource struct {
	ActivityName         string `json:"activityName"`
	Path                 string `json:"path"`
	MaxConcurrency       int64  `json:"maxConcurrency,omitempty"`
	ConcurrencyPerPoller int64  `json:"concurrencyPerPoller,omitempty"`
}

type Component

type Component struct {
	Name                    string           `json:"name"`
	ProjectName             string           `json:"projectName,omitempty"`
	Environment             []NameValue      `json:"environment"`
	MinInstances            int64            `json:"minInstances,omitempty"`
	MaxInstances            int64            `json:"maxInstances,omitempty"`
	MaxInstancesPerNode     int64            `json:"maxInstancesPerNode,omitempty"`
	MaxConcurrency          int64            `json:"maxConcurrency"`
	SoftConcurrencyLimit    bool             `json:"softConcurrencyLimit,omitempty"`
	ScaleUpConcurrencyPct   float64          `json:"scaleUpConcurrencyPct,omitempty"`
	ScaleDownConcurrencyPct float64          `json:"scaleDownConcurrencyPct,omitempty"`
	MaxDurationSeconds      int64            `json:"maxDurationSeconds,omitempty"`
	StartParallelism        StartParallelism `json:"startParallelism,omitempty"`
	RestartOrder            RestartOrder     `json:"RestartOrder,omitempty"`
	Version                 int64            `json:"version"`
	ModifiedAt              int64            `json:"modifiedAt,omitempty"`
	Docker                  *DockerComponent `json:"docker,omitempty"`
}

type ComponentActivity

type ComponentActivity struct {
	Requests    int64   `json:"requests"`
	Concurrency float64 `json:"concurrency"`
}

type ComponentDelta

type ComponentDelta struct {
	ComponentName     string `json:"componentName"`
	Delta             int64  `json:"delta"`
	RequiredMemoryMiB int64  `json:"requiredMemoryMiB"`
}

type ComponentDeltaError

type ComponentDeltaError struct {
	ComponentDelta ComponentDelta `json:"componentDelta"`
	Error          string         `json:"error"`
}

type ComponentInfo

type ComponentInfo struct {
	ComponentName     string              `json:"componentName"`
	ComponentVersion  int64               `json:"componentVersion"`
	Status            ComponentStatus     `json:"status"`
	MaxConcurrency    int64               `json:"maxConcurrency"`
	MemoryReservedMiB int64               `json:"memoryReservedMiB"`
	StartTime         int64               `json:"startTime"`
	LastRequestTime   int64               `json:"lastRequestTime"`
	TotalRequests     int64               `json:"totalRequests"`
	Activity          []ComponentActivity `json:"activity"`
}

type ComponentStatus

type ComponentStatus string

type ComponentTarget

type ComponentTarget struct {
	ComponentName     string `json:"componentName"`
	RequiredMemoryMiB int64  `json:"requiredMemoryMiB"`
	TargetCount       int64  `json:"targetCount"`
}

type ComponentWithEventSources

type ComponentWithEventSources struct {
	Component    Component               `json:"component"`
	EventSources []EventSourceWithStatus `json:"eventSources"`
}

type CronEventSource

type CronEventSource struct {
	Schedule string          `json:"schedule"`
	Http     CronHttpRequest `json:"http"`
}

type CronHttpRequest

type CronHttpRequest struct {
	Method  string      `json:"method"`
	Path    string      `json:"path"`
	Data    string      `json:"data,omitempty"`
	Headers []NameValue `json:"headers,omitempty"`
}

type DataChangedUnion

type DataChangedUnion struct {
	PutComponent    *Component             `json:"putComponent,omitempty"`
	RemoveComponent *RemoveComponentOutput `json:"removeComponent,omitempty"`
}

type DockerComponent

type DockerComponent struct {
	Image                       string        `json:"image"`
	Command                     []string      `json:"command,omitempty"`
	Entrypoint                  []string      `json:"entrypoint,omitempty"`
	HttpPort                    int64         `json:"httpPort"`
	HttpHealthCheckPath         string        `json:"httpHealthCheckPath"`
	HttpStartHealthCheckSeconds int64         `json:"httpStartHealthCheckSeconds,omitempty"`
	HttpHealthCheckSeconds      int64         `json:"httpHealthCheckSeconds,omitempty"`
	HttpHealthCheckMaxFailures  int64         `json:"httpHealthCheckMaxFailures,omitempty"`
	HealthCheckFailedCommand    []string      `json:"healthCheckFailedCommand,omitempty"`
	IdleTimeoutSeconds          int64         `json:"idleTimeoutSeconds,omitempty"`
	Ports                       []string      `json:"ports,omitempty"`
	Volumes                     []VolumeMount `json:"volumes,omitempty"`
	NetworkName                 string        `json:"networkName,omitempty"`
	LogDriver                   string        `json:"logDriver,omitempty"`
	LogDriverOptions            []NameValue   `json:"logDriverOptions,omitempty"`
	CpuShares                   int64         `json:"cpuShares,omitempty"`
	ReserveMemoryMiB            int64         `json:"reserveMemoryMiB,omitempty"`
	LimitMemoryMiB              int64         `json:"limitMemoryMiB,omitempty"`
	PullCommand                 []string      `json:"pullCommand,omitempty"`
	PullUsername                string        `json:"pullUsername,omitempty"`
	PullPassword                string        `json:"pullPassword,omitempty"`
	PullImageOnPut              bool          `json:"pullImageOnPut,omitempty"`
	PullImageOnStart            bool          `json:"pullImageOnStart,omitempty"`
	Dns                         []string      `json:"dns,omitempty"`
	DnsOptions                  []string      `json:"dnsOptions,omitempty"`
	DnsSearch                   []string      `json:"dnsSearch,omitempty"`
	Ulimits                     []string      `json:"ulimits,omitempty"`
	Init                        bool          `json:"init,omitempty"`
}

type EventSource

type EventSource struct {
	Name          string                      `json:"name"`
	ComponentName string                      `json:"componentName"`
	ProjectName   string                      `json:"projectName,omitempty"`
	Version       int64                       `json:"version"`
	ModifiedAt    int64                       `json:"modifiedAt"`
	Http          *HttpEventSource            `json:"http,omitempty"`
	Cron          *CronEventSource            `json:"cron,omitempty"`
	Sqs           *SqsEventSource             `json:"sqs,omitempty"`
	Awsstepfunc   *AwsStepFunctionEventSource `json:"awsstepfunc,omitempty"`
}

type EventSourceType

type EventSourceType string

func GetEventSourceType

func GetEventSourceType(e EventSource) EventSourceType

func StrToEventSourceType

func StrToEventSourceType(esType string) (EventSourceType, error)

type EventSourceWithStatus

type EventSourceWithStatus struct {
	EventSource EventSource `json:"eventSource"`
	Enabled     bool        `json:"enabled"`
}

type GetComponentInput

type GetComponentInput struct {
	Name string `json:"name"`
}

type GetComponentOutput

type GetComponentOutput struct {
	Component Component `json:"component"`
}

type GetEventSourceInput

type GetEventSourceInput struct {
	Name string `json:"name"`
}

type GetEventSourceOutput

type GetEventSourceOutput struct {
	EventSource EventSource `json:"eventSource"`
}

type GetNodeStatusInput

type GetNodeStatusInput struct {
	Status *NodeStatus `json:"status,omitempty"`
}

type GetNodeStatusOutput

type GetNodeStatusOutput struct {
	Status NodeStatus `json:"status"`
}

type GetProjectInput

type GetProjectInput struct {
	Name string `json:"name"`
}

type GetProjectOutput

type GetProjectOutput struct {
	Project Project `json:"project"`
}

type HttpEventSource

type HttpEventSource struct {
	Hostname    string `json:"hostname,omitempty"`
	PathPrefix  string `json:"pathPrefix,omitempty"`
	StripPrefix bool   `json:"stripPrefix,omitempty"`
}

type ListComponentsInput

type ListComponentsInput struct {
	NamePrefix  string `json:"namePrefix,omitempty"`
	ProjectName string `json:"projectName,omitempty"`
	Limit       int64  `json:"limit,omitempty"`
	NextToken   string `json:"nextToken,omitempty"`
}

type ListComponentsOutput

type ListComponentsOutput struct {
	Components []Component `json:"components"`
	NextToken  string      `json:"nextToken,omitempty"`
}

type ListEventSourcesInput

type ListEventSourcesInput struct {
	NamePrefix      string          `json:"namePrefix,omitempty"`
	ComponentName   string          `json:"componentName,omitempty"`
	ProjectName     string          `json:"projectName,omitempty"`
	EventSourceType EventSourceType `json:"eventSourceType,omitempty"`
	Limit           int64           `json:"limit,omitempty"`
	NextToken       string          `json:"nextToken,omitempty"`
}

type ListEventSourcesOutput

type ListEventSourcesOutput struct {
	EventSources []EventSourceWithStatus `json:"eventSources"`
	NextToken    string                  `json:"nextToken,omitempty"`
}

type ListNodeStatusInput

type ListNodeStatusInput struct {
	ForceRefresh bool `json:"forceRefresh,omitempty"`
}

type ListNodeStatusOutput

type ListNodeStatusOutput struct {
	RespondingNodeId string       `json:"respondingNodeId"`
	Nodes            []NodeStatus `json:"nodes"`
}

type ListProjectsInput

type ListProjectsInput struct {
	NamePrefix string `json:"namePrefix,omitempty"`
}

type ListProjectsOutput

type ListProjectsOutput struct {
	Projects []ProjectInfo `json:"projects"`
}

type MaelstromService

type MaelstromService interface {
	ListProjects(input ListProjectsInput) (ListProjectsOutput, error)
	PutProject(input PutProjectInput) (PutProjectOutput, error)
	GetProject(input GetProjectInput) (GetProjectOutput, error)
	RemoveProject(input RemoveProjectInput) (RemoveProjectOutput, error)
	PutComponent(input PutComponentInput) (PutComponentOutput, error)
	GetComponent(input GetComponentInput) (GetComponentOutput, error)
	RemoveComponent(input RemoveComponentInput) (RemoveComponentOutput, error)
	ListComponents(input ListComponentsInput) (ListComponentsOutput, error)
	PutEventSource(input PutEventSourceInput) (PutEventSourceOutput, error)
	GetEventSource(input GetEventSourceInput) (GetEventSourceOutput, error)
	RemoveEventSource(input RemoveEventSourceInput) (RemoveEventSourceOutput, error)
	ToggleEventSources(input ToggleEventSourcesInput) (ToggleEventSourcesOutput, error)
	ListEventSources(input ListEventSourcesInput) (ListEventSourcesOutput, error)
	NotifyDataChanged(input NotifyDataChangedInput) (NotifyDataChangedOutput, error)
}

func NewMaelstromServiceProxy

func NewMaelstromServiceProxy(c barrister.Client) MaelstromService

type MaelstromServiceProxy

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

func (MaelstromServiceProxy) GetComponent

func (MaelstromServiceProxy) GetEventSource

func (MaelstromServiceProxy) GetProject

func (MaelstromServiceProxy) ListComponents

func (MaelstromServiceProxy) ListEventSources

func (MaelstromServiceProxy) ListProjects

func (MaelstromServiceProxy) NotifyDataChanged

func (MaelstromServiceProxy) PutComponent

func (MaelstromServiceProxy) PutEventSource

func (MaelstromServiceProxy) PutProject

func (MaelstromServiceProxy) RemoveComponent

func (MaelstromServiceProxy) RemoveEventSource

func (MaelstromServiceProxy) RemoveProject

func (MaelstromServiceProxy) ToggleEventSources

type NameValue

type NameValue struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type NodeService

type NodeService interface {
	ListNodeStatus(input ListNodeStatusInput) (ListNodeStatusOutput, error)
	GetStatus(input GetNodeStatusInput) (GetNodeStatusOutput, error)
	StatusChanged(input StatusChangedInput) (StatusChangedOutput, error)
	PlaceComponent(input PlaceComponentInput) (PlaceComponentOutput, error)
	StartStopComponents(input StartStopComponentsInput) (StartStopComponentsOutput, error)
	TerminateNode(input TerminateNodeInput) (TerminateNodeOutput, error)
}

func NewNodeServiceProxy

func NewNodeServiceProxy(c barrister.Client) NodeService

type NodeServiceProxy

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

func (NodeServiceProxy) GetStatus

func (NodeServiceProxy) ListNodeStatus

func (_p NodeServiceProxy) ListNodeStatus(input ListNodeStatusInput) (ListNodeStatusOutput, error)

func (NodeServiceProxy) PlaceComponent

func (_p NodeServiceProxy) PlaceComponent(input PlaceComponentInput) (PlaceComponentOutput, error)

func (NodeServiceProxy) StartStopComponents

func (NodeServiceProxy) StatusChanged

func (_p NodeServiceProxy) StatusChanged(input StatusChangedInput) (StatusChangedOutput, error)

func (NodeServiceProxy) TerminateNode

func (_p NodeServiceProxy) TerminateNode(input TerminateNodeInput) (TerminateNodeOutput, error)

type NodeStatus

type NodeStatus struct {
	NodeId            string          `json:"nodeId"`
	StartedAt         int64           `json:"startedAt"`
	ObservedAt        int64           `json:"observedAt"`
	Version           int64           `json:"version"`
	PeerUrl           string          `json:"peerUrl"`
	TotalMemoryMiB    int64           `json:"totalMemoryMiB"`
	FreeMemoryMiB     int64           `json:"freeMemoryMiB"`
	NumCPUs           int64           `json:"numCPUs"`
	LoadAvg1m         float64         `json:"loadAvg1m"`
	LoadAvg5m         float64         `json:"loadAvg5m"`
	LoadAvg15m        float64         `json:"loadAvg15m"`
	RunningComponents []ComponentInfo `json:"runningComponents"`
}

type NotifyDataChangedInput

type NotifyDataChangedInput struct {
	NodeId  string             `json:"nodeId"`
	Changes []DataChangedUnion `json:"changes"`
}

type NotifyDataChangedOutput

type NotifyDataChangedOutput struct {
	RespondingNodeId string `json:"respondingNodeId"`
}

type PlaceComponentInput

type PlaceComponentInput struct {
	ComponentName string `json:"componentName"`
}

type PlaceComponentOutput

type PlaceComponentOutput struct {
	ComponentName string     `json:"componentName"`
	Node          NodeStatus `json:"node"`
}

type Project

type Project struct {
	Name       string                      `json:"name"`
	Components []ComponentWithEventSources `json:"components"`
}

type ProjectInfo

type ProjectInfo struct {
	ProjectName      string `json:"projectName"`
	ComponentCount   int64  `json:"componentCount"`
	EventSourceCount int64  `json:"eventSourceCount"`
}

type PutComponentInput

type PutComponentInput struct {
	Component Component `json:"component"`
}

type PutComponentOutput

type PutComponentOutput struct {
	Name    string `json:"name"`
	Version int64  `json:"version"`
}

type PutEventSourceInput

type PutEventSourceInput struct {
	EventSource EventSource `json:"eventSource"`
}

type PutEventSourceOutput

type PutEventSourceOutput struct {
	Name    string `json:"name"`
	Version int64  `json:"version"`
}

type PutProjectInput

type PutProjectInput struct {
	Project  Project `json:"project"`
	DiffOnly bool    `json:"diffOnly,omitempty"`
}

type PutProjectOutput

type PutProjectOutput struct {
	Name                string        `json:"name"`
	ComponentsAdded     []Component   `json:"componentsAdded"`
	ComponentsUpdated   []Component   `json:"componentsUpdated"`
	ComponentsRemoved   []string      `json:"componentsRemoved"`
	EventSourcesAdded   []EventSource `json:"eventSourcesAdded"`
	EventSourcesUpdated []EventSource `json:"eventSourcesUpdated"`
	EventSourcesRemoved []string      `json:"eventSourcesRemoved"`
}

type RemoveComponentInput

type RemoveComponentInput struct {
	Name string `json:"name"`
}

type RemoveComponentOutput

type RemoveComponentOutput struct {
	Name  string `json:"name"`
	Found bool   `json:"found"`
}

type RemoveEventSourceInput

type RemoveEventSourceInput struct {
	Name string `json:"name"`
}

type RemoveEventSourceOutput

type RemoveEventSourceOutput struct {
	Name  string `json:"name"`
	Found bool   `json:"found"`
}

type RemoveProjectInput

type RemoveProjectInput struct {
	Name string `json:"name"`
}

type RemoveProjectOutput

type RemoveProjectOutput struct {
	Name  string `json:"name"`
	Found bool   `json:"found"`
}

type RestartOrder

type RestartOrder string
const (
	RestartOrderStartstop RestartOrder = "startstop"
	RestartOrderStopstart              = "stopstart"
)

type SqsEventSource

type SqsEventSource struct {
	QueueName            string `json:"queueName"`
	NameAsPrefix         bool   `json:"nameAsPrefix,omitempty"`
	Path                 string `json:"path"`
	MaxConcurrency       int64  `json:"maxConcurrency,omitempty"`
	MessagesPerPoll      int64  `json:"messagesPerPoll,omitempty"`
	ConcurrencyPerPoller int64  `json:"concurrencyPerPoller,omitempty"`
	VisibilityTimeout    int64  `json:"visibilityTimeout,omitempty"`
}

type StartParallelism

type StartParallelism string

type StartStopComponentsInput

type StartStopComponentsInput struct {
	ClientNodeId  string            `json:"clientNodeId"`
	TargetVersion int64             `json:"targetVersion"`
	TargetCounts  []ComponentTarget `json:"targetCounts"`
	ReturnStatus  bool              `json:"returnStatus,omitempty"`
	Block         bool              `json:"block,omitempty"`
}

type StartStopComponentsOutput

type StartStopComponentsOutput struct {
	TargetVersionMismatch bool                  `json:"targetVersionMismatch"`
	TargetStatus          *NodeStatus           `json:"targetStatus,omitempty"`
	Started               []ComponentDelta      `json:"started"`
	Stopped               []ComponentDelta      `json:"stopped"`
	Errors                []ComponentDeltaError `json:"errors"`
}

type StatusChangedInput

type StatusChangedInput struct {
	NodeId  string      `json:"nodeId"`
	Exiting bool        `json:"exiting"`
	Status  *NodeStatus `json:"status,omitempty"`
}

type StatusChangedOutput

type StatusChangedOutput struct {
	NodeId string `json:"nodeId"`
}

type TerminateNodeInput

type TerminateNodeInput struct {
	AwsLifecycleHook *AwsLifecycleHook `json:"awsLifecycleHook,omitempty"`
}

type TerminateNodeOutput

type TerminateNodeOutput struct {
	AcceptedMessage bool   `json:"acceptedMessage"`
	NodeId          string `json:"nodeId,omitempty"`
	InstanceId      string `json:"instanceId,omitempty"`
}

type ToggleEventSourcesInput

type ToggleEventSourcesInput struct {
	Enabled         bool            `json:"enabled"`
	NamePrefix      string          `json:"namePrefix,omitempty"`
	ComponentName   string          `json:"componentName,omitempty"`
	ProjectName     string          `json:"projectName,omitempty"`
	EventSourceType EventSourceType `json:"eventSourceType,omitempty"`
}

type ToggleEventSourcesOutput

type ToggleEventSourcesOutput struct {
	Enabled          bool     `json:"enabled"`
	EventSourceNames []string `json:"eventSourceNames"`
}

type VolumeMount

type VolumeMount struct {
	Type     string `json:"type,omitempty"`
	Source   string `json:"source"`
	Target   string `json:"target"`
	ReadOnly bool   `json:"readOnly,omitempty"`
}

Jump to

Keyboard shortcuts

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