service

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StepStatusPreparing = iota + 1
	StepStatusProcessing
	StepStatusSuccess
	StepStatusFail
)

Variables

This section is empty.

Functions

Types

type FailedConvertService

type FailedConvertService struct {
	Data servicev4.HttpRsp_AgentServicePolling
	Err  error
}

type Flow

type Flow []*FlowStep

func (*Flow) UnmarshalJSON

func (s *Flow) UnmarshalJSON(b []byte) error

type FlowStep

type FlowStep struct {
	Id      string        `json:"$id"`
	Command string        `json:"$command"`
	Inputs  FlowStepInput `json:"inputs,omitempty"`
	Outputs interface{}   `json:"outputs,omitempty"`
	Error   error         `json:"error,omitempty"`
}

func (*FlowStep) UnmarshalJSON

func (s *FlowStep) UnmarshalJSON(b []byte) error

type FlowStepInput

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

func (*FlowStepInput) FindReplaceDeferredInputsFrom

func (f *FlowStepInput) FindReplaceDeferredInputsFrom(in map[string]interface{}) error

func (*FlowStepInput) FindReplacePassedInputsFrom

func (f *FlowStepInput) FindReplacePassedInputsFrom(in map[string]interface{}) error

func (*FlowStepInput) GetInputs

func (f *FlowStepInput) GetInputs() map[string]interface{}

type Result

type Result struct {
	Body string
	Err  error
}

type ServiceInterface

type ServiceInterface interface {
	Version() Version
	GetId() string
	GetPriority() int
	GetCreatedTime() time.Time
}

type ServiceStatus

type ServiceStatus int32
const (
	ServiceStatusPreparing ServiceStatus = iota + 1
	ServiceStatusStart
	ServiceStatusProcessing
	ServiceStatusSuccess
	ServiceStatusFailed
)

func (ServiceStatus) String

func (s ServiceStatus) String() string

type ServiceUpdateInterface

type ServiceUpdateInterface interface {
	Version() Version
	GetId() string
	GetStepCount() int
	GetSequence() int
	GetStatus() StepStatus
}

func CreateUpdateService

func CreateUpdateService(version Version, id string, seqCount, seq int, status StepStatus, result string, start, end time.Time) ServiceUpdateInterface

type ServiceV1

type ServiceV1 struct {
	Id          string
	Name        string
	ClusterId   string
	Priority    int
	CreatedTime time.Time
	StartTime   time.Time
	UpdateTime  time.Time
	EndTime     time.Time
	Status      ServiceStatus
	Steps       []Step
	Result      Result
}

func (*ServiceV1) GetCreatedTime

func (s *ServiceV1) GetCreatedTime() time.Time

func (*ServiceV1) GetId

func (s *ServiceV1) GetId() string

func (*ServiceV1) GetPriority

func (s *ServiceV1) GetPriority() int

func (*ServiceV1) Version

func (s *ServiceV1) Version() Version

type ServiceV2

type ServiceV2 struct {
	Id          string
	Name        string
	ClusterId   string
	Priority    int
	CreatedTime time.Time
	StartTime   time.Time
	UpdateTime  time.Time
	EndTime     time.Time
	Status      ServiceStatus
	Flow        Flow
	// Inputs      map[string]interface{}
	Result Result
}

func (*ServiceV2) GetCreatedTime

func (s *ServiceV2) GetCreatedTime() time.Time

func (*ServiceV2) GetId

func (s *ServiceV2) GetId() string

func (*ServiceV2) GetPriority

func (s *ServiceV2) GetPriority() int

func (*ServiceV2) Version

func (s *ServiceV2) Version() Version

type Step

type Step struct {
	Id           string
	ParentId     string
	Command      *StepCommand
	StartTime    time.Time
	EndTime      time.Time
	Status       StepStatus
	ResultFilter string
	Result       Result
}

type StepCommand

type StepCommand struct {
	Method string
	Args   map[string]interface{}
}

type StepStatus

type StepStatus int32

type UpdateServiceV1

type UpdateServiceV1 struct {
	Uuid      string
	StepCount int
	Sequence  int
	Status    StepStatus
	Result    string
	Started   time.Time
	Ended     time.Time
}

func (*UpdateServiceV1) GetId

func (s *UpdateServiceV1) GetId() string

func (*UpdateServiceV1) GetSequence

func (s *UpdateServiceV1) GetSequence() int

func (*UpdateServiceV1) GetStatus

func (s *UpdateServiceV1) GetStatus() StepStatus

func (*UpdateServiceV1) GetStepCount

func (s *UpdateServiceV1) GetStepCount() int

func (*UpdateServiceV1) Version

func (s *UpdateServiceV1) Version() Version

type UpdateServiceV2

type UpdateServiceV2 struct {
	Id        string
	StepCount int
	Sequence  int
	Status    StepStatus
	Result    string
	Started   time.Time
	Ended     time.Time
}

func (*UpdateServiceV2) GetId

func (s *UpdateServiceV2) GetId() string

func (*UpdateServiceV2) GetSequence

func (s *UpdateServiceV2) GetSequence() int

func (*UpdateServiceV2) GetStatus

func (s *UpdateServiceV2) GetStatus() StepStatus

func (*UpdateServiceV2) GetStepCount

func (s *UpdateServiceV2) GetStepCount() int

func (*UpdateServiceV2) Version

func (s *UpdateServiceV2) Version() Version

type Version

type Version string
const (
	// client service version
	SERVICE_VERSION_V1 Version = "v1"
	SERVICE_VERSION_V2 Version = "v2"
)

func (Version) GetMatchManagerServiceVersion

func (v Version) GetMatchManagerServiceVersion() string

Jump to

Keyboard shortcuts

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