louhi

package
v0.0.0-...-a295026 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TriggerTypeCommit = "git-change-trigger"
	TriggerTypeCron   = "cron-trigger"
	TriggerTypeManual = "MANUAL"
)
View Source
const (
	FlowResultUnknown = ""
	FlowResultSuccess = "success"
	FlowResultFailure = "failure"
)

Variables

View Source
var (
	EventSource_name = map[int32]string{
		0: "PIPELINE",
		1: "STAGE",
	}
	EventSource_value = map[string]int32{
		"PIPELINE": 0,
		"STAGE":    1,
	}
)

Enum value maps for EventSource.

View Source
var (
	EventAction_name = map[int32]string{
		0: "STARTED",
		1: "FINISHED",
		2: "FAILED",
		3: "CREATED_ARTIFACT",
	}
	EventAction_value = map[string]int32{
		"STARTED":          0,
		"FINISHED":         1,
		"FAILED":           2,
		"CREATED_ARTIFACT": 3,
	}
)

Enum value maps for EventAction.

View Source
var File_louhi_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type DB

type DB interface {
	// PutFlowExecution inserts or updates the FlowExecution in the DB.
	PutFlowExecution(ctx context.Context, fe *FlowExecution) error
	// GetFlowExecution retrieves the FlowExecution from the DB. Should return
	// nil and no error if the flow with the given ID does not exist.
	GetFlowExecution(ctx context.Context, id string) (*FlowExecution, error)
	// GetLatestFlowExecutions retrieves the most recent flow executions by
	// flow name.
	GetLatestFlowExecutions(ctx context.Context) (map[string]*FlowExecution, error)
}

DB stores information about Louhi flows.

type EventAction

type EventAction int32

EventAction describes the action which generated a Notification.

const (
	EventAction_STARTED          EventAction = 0
	EventAction_FINISHED         EventAction = 1
	EventAction_FAILED           EventAction = 2
	EventAction_CREATED_ARTIFACT EventAction = 3
)

func (EventAction) Descriptor

func (EventAction) Enum

func (x EventAction) Enum() *EventAction

func (EventAction) EnumDescriptor deprecated

func (EventAction) EnumDescriptor() ([]byte, []int)

Deprecated: Use EventAction.Descriptor instead.

func (EventAction) Number

func (x EventAction) Number() protoreflect.EnumNumber

func (EventAction) String

func (x EventAction) String() string

func (EventAction) Type

type EventSource

type EventSource int32

EventSource describes the source of a Notification.

const (
	EventSource_PIPELINE EventSource = 0
	EventSource_STAGE    EventSource = 1
)

func (EventSource) Descriptor

func (EventSource) Enum

func (x EventSource) Enum() *EventSource

func (EventSource) EnumDescriptor deprecated

func (EventSource) EnumDescriptor() ([]byte, []int)

Deprecated: Use EventSource.Descriptor instead.

func (EventSource) Number

func (x EventSource) Number() protoreflect.EnumNumber

func (EventSource) String

func (x EventSource) String() string

func (EventSource) Type

type FlowExecution

type FlowExecution struct {
	Artifacts    []string
	CreatedAt    time.Time
	FinishedAt   time.Time
	FlowName     string
	FlowID       string
	GeneratedCLs []string
	GitBranch    string
	GitCommit    string
	ID           string
	Link         string
	ModifiedAt   time.Time
	ProjectID    string
	Result       FlowResult
	SourceCL     string
	StartedBy    string
	TriggerType  TriggerType
}

FlowExecution describes one instance of a Louhi flow.

func (*FlowExecution) Finished

func (fe *FlowExecution) Finished() bool

Finished returns true if the flow has finished.

type FlowResult

type FlowResult string

FlowResult describes the result of a flow.

type Notification

type Notification struct {
	ProjectId           string      `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
	FlowUniqueKey       string      `protobuf:"bytes,2,opt,name=flow_unique_key,json=flowUniqueKey,proto3" json:"flow_unique_key,omitempty"`
	FlowName            string      `protobuf:"bytes,3,opt,name=flow_name,json=flowName,proto3" json:"flow_name,omitempty"`
	PipelineExecutionId string      `protobuf:"bytes,4,opt,name=pipeline_execution_id,json=pipelineExecutionId,proto3" json:"pipeline_execution_id,omitempty"`
	EventSource         EventSource `protobuf:"varint,5,opt,name=event_source,json=eventSource,proto3,enum=louhi.EventSource" json:"event_source,omitempty"`
	EventAction         EventAction `protobuf:"varint,6,opt,name=event_action,json=eventAction,proto3,enum=louhi.EventAction" json:"event_action,omitempty"`
	Link                string      `protobuf:"bytes,7,opt,name=link,proto3" json:"link,omitempty"`
	Branch              string      `protobuf:"bytes,8,opt,name=branch,proto3" json:"branch,omitempty"`
	RefSha              string      `protobuf:"bytes,9,opt,name=ref_sha,json=refSha,proto3" json:"ref_sha,omitempty"`
	// We'd really prefer an enum for trigger_type, but the values don't follow
	// a consistent format, eg. "MANUAL" and "cron-trigger", the latter of which
	// is not a valid enum value.
	TriggerType  string   `protobuf:"bytes,10,opt,name=trigger_type,json=triggerType,proto3" json:"trigger_type,omitempty"`
	StartedBy    string   `protobuf:"bytes,11,opt,name=started_by,json=startedBy,proto3" json:"started_by,omitempty"`
	ArtifactLink []string `protobuf:"bytes,12,rep,name=artifact_link,json=artifactLink,proto3" json:"artifact_link,omitempty"`
	GeneratedCls []string `protobuf:"bytes,13,rep,name=generated_cls,json=generatedCls,proto3" json:"generated_cls,omitempty"`
	// contains filtered or unexported fields
}

Notification describes a PubSub notification from Louhi.

func (*Notification) Descriptor deprecated

func (*Notification) Descriptor() ([]byte, []int)

Deprecated: Use Notification.ProtoReflect.Descriptor instead.

func (x *Notification) GetArtifactLink() []string

func (*Notification) GetBranch

func (x *Notification) GetBranch() string

func (*Notification) GetEventAction

func (x *Notification) GetEventAction() EventAction

func (*Notification) GetEventSource

func (x *Notification) GetEventSource() EventSource

func (*Notification) GetFlowName

func (x *Notification) GetFlowName() string

func (*Notification) GetFlowUniqueKey

func (x *Notification) GetFlowUniqueKey() string

func (*Notification) GetGeneratedCls

func (x *Notification) GetGeneratedCls() []string
func (x *Notification) GetLink() string

func (*Notification) GetPipelineExecutionId

func (x *Notification) GetPipelineExecutionId() string

func (*Notification) GetProjectId

func (x *Notification) GetProjectId() string

func (*Notification) GetRefSha

func (x *Notification) GetRefSha() string

func (*Notification) GetStartedBy

func (x *Notification) GetStartedBy() string

func (*Notification) GetTriggerType

func (x *Notification) GetTriggerType() string

func (*Notification) ProtoMessage

func (*Notification) ProtoMessage()

func (*Notification) ProtoReflect

func (x *Notification) ProtoReflect() protoreflect.Message

func (*Notification) Reset

func (x *Notification) Reset()

func (*Notification) String

func (x *Notification) String() string

type TriggerType

type TriggerType string

TriggerType describes how a flow was triggered.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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