client

package
v0.0.0-...-817c61a Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: MIT Imports: 11 Imported by: 2

Documentation

Overview

Package client provides helper functions to communicate with flow servers. Each server uses this client to talk to each other, and the client can be used for. integration testing, or building other go based interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FloeHost

type FloeHost struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

FloeHost provides methods to access a host api

func New

func New(base, token string) *FloeHost

New returns a new FloeHost

func (*FloeHost) AttemptExecute

func (f *FloeHost) AttemptExecute(pend interface{}) bool

AttemptExecute tries to execute the flow matching the flowref and instigating event. Returns true if the host accepted the run.

func (*FloeHost) FindRun

func (f *FloeHost) FindRun(flowID, runID string) *Run

FindRun - finds the run in any of the peer hosts

func (*FloeHost) GetConfig

func (f *FloeHost) GetConfig() HostConfig

GetConfig returns the config

func (*FloeHost) GetRuns

func (f *FloeHost) GetRuns(id string) *RunSummaries

GetRuns - gets the runs from a host for the given id or nil if there is a problem

type HostConfig

type HostConfig struct {
	HostID  string
	BaseURL string
	Online  bool
	Tags    []string
}

HostConfig the public config data of a host

func (HostConfig) TagsMatch

func (h HostConfig) TagsMatch(tags []string) bool

TagsMatch returns true is all tags are present in the receivers tags

type Run

type Run struct {
	Ref        event.RunRef
	Flow       config.Flow
	ExecHost   string
	StartTime  time.Time
	EndTime    time.Time
	Ended      bool
	Status     string // constructed
	Good       bool
	Initiating event.Event
	MergeNodes map[string]merge
	DataNodes  map[string]data
	ExecNodes  map[string]exec
}

Run is a specific invocation of a flow

type RunSummaries

type RunSummaries struct {
	Active  []RunSummary
	Pending []RunSummary
	Archive []RunSummary
}

RunSummaries holds slices of RunSummary for each group of run

func (*RunSummaries) Append

func (s *RunSummaries) Append(o *RunSummaries)

Append adds the summaries o to the reciever s

type RunSummary

type RunSummary struct {
	Ref       event.RunRef
	ExecHost  string // the id of the host who's actually executing this run
	StartTime time.Time
	EndTime   time.Time
	Ended     bool
	Status    string
	Good      bool
}

RunSummary represents the state of a run

Jump to

Keyboard shortcuts

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