storage

package
Version: v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	model.Log
	Target string `json:"target,omitempty"`
}

LOG

type Match

type Match struct {
	IDs  []string `json:"ids"` // ids of targets not covered by tags
	Tags []string `json:"tags"`
	List []string `json:"list"` // all ids
}

type Order

type Order struct {
	model.Header `yaml:",inline"`
	Source       *source.Source `json:"source,omitempty"`
	Build        *build         `json:"build"`
	Deploy       *deploy        `json:"deploy"`
}

ORDER

func (Order) Validate

func (o Order) Validate() error

type Storage

type Storage interface {
	GetOrders(from, size int) ([]Order, int64, error)
	AddOrder(*Order) error
	GetOrder(string) (*Order, error)
	//DeleteOrder(string) error
	//
	GetTargets(tags []string, from, size int) ([]Target, int64, error)
	PatchTarget(id string, target *Target) (bool, error)
	MatchTargets(ids, tags []string) (allIDs, hitIDs, hitTags []string, err error)
	SearchTargets(map[string]interface{}) ([]Target, int64, error)
	AddTarget(*Target) error
	GetTarget(string) (*Target, error)
	//DeleteTarget(string) error
	//
	GetLogs(target, task, stage, command, sortField string, sortAsc bool, from, size int) ([]Log, int64, error)
	SearchLogs(map[string]interface{}) ([]Log, int64, error)
	AddLog(*Log) error
	AddLogs(logs []Log) error
	//DeleteLogs(target string) error
	DeliveredTask(target, task string) (bool, error)
}

func NewElasticStorage

func NewElasticStorage(url string) (Storage, error)

type Target

type Target struct {
	model.TargetBase
	UpdatedAt    model.UnixTimeType `json:"updatedAt,omitempty"`
	LogRequestAt model.UnixTimeType `json:"logRequestAt,omitempty"`
}

TARGET

Jump to

Keyboard shortcuts

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