Documentation ¶
Index ¶
- Variables
- type Master
- func (m *Master) CancelApplication(ctx context.Context, appID int) (*ent.Application, error)
- func (m *Master) CleanupRunningApps() (err error)
- func (m *Master) Counter(ctx context.Context, req *pb.CounterReq) (*pb.CounterRes, error)
- func (m *Master) DbClient() *ent.Client
- func (m *Master) DeleteApplication(ctx context.Context, appID int) error
- func (m *Master) FindCreateGraph(ctx context.Context, req *pb.FCGraphReq) (res *pb.FCGraphRes, err error)
- func (m *Master) FindCreateGroup(ctx context.Context, req *pb.FCGroupReq) (res *pb.FCGroupRes, err error)
- func (m *Master) FindCreateMetric(ctx context.Context, req *pb.FCMetricReq) (res *pb.FCMetricRes, err error)
- func (m *Master) Gauge(ctx context.Context, req *pb.GaugeReq) (*pb.GaugeRes, error)
- func (m *Master) GetHostname() string
- func (m *Master) GetTagByApplication(ctx context.Context, app *ent.Application, tagName string) (*ent.Tag, error)
- func (m *Master) GetTagByID(ctx context.Context, tagID int) (*ent.Tag, error)
- func (m *Master) Histogram(ctx context.Context, req *pb.HistogramReq) (*pb.HistogramRes, error)
- func (m *Master) Logpaths(appID int) (string, string, string)
- func (m *Master) NewApplication(ctx context.Context, name, scenario, gomod, gosum string) (*ent.Application, error)
- func (m *Master) PingDb() error
- func (m *Master) RemoveApplicationTag(ctx context.Context, tag *ent.Tag) error
- func (m *Master) SetApplicationTag(ctx context.Context, appID int, tag string) (*ent.Tag, error)
- func (m *Master) SetIsScheduled(is bool) *Master
- func (m *Master) Start() (err error)
- func (m *Master) WebPort() int
- type Options
Constants ¶
This section is empty.
Variables ¶
var ( ErrAppNotRunning = errors.New("application is not running") ErrAppIsFinished = errors.New("application is finished already") ErrAppIsCanceled = errors.New("application is canceled") ErrCantDeleteApp = errors.New("cannot delete a %s application") )
Error
Functions ¶
This section is empty.
Types ¶
type Master ¶
type Master struct {
// contains filtered or unexported fields
}
func (*Master) CancelApplication ¶
CancelApplication terminates an application if the app is running, send cancel signal if the app is finished/error, return ErrAppIsFinished error if the app is canceled, return with current app status else update app status with cancel
func (*Master) CleanupRunningApps ¶
CleanupRunningApps update last running app status from running -> error It should be called when the master is booted
func (*Master) Counter ¶
func (m *Master) Counter(ctx context.Context, req *pb.CounterReq) (*pb.CounterRes, error)
func (*Master) DeleteApplication ¶
DeleteApplication a pending/finished/canceled/error application
func (*Master) FindCreateGraph ¶
func (m *Master) FindCreateGraph(ctx context.Context, req *pb.FCGraphReq) (res *pb.FCGraphRes, err error)
func (*Master) FindCreateGroup ¶
func (m *Master) FindCreateGroup(ctx context.Context, req *pb.FCGroupReq) (res *pb.FCGroupRes, err error)
FindCreateGroup find or create new group return the existing/new group ent, is created, and error
func (*Master) FindCreateMetric ¶
func (m *Master) FindCreateMetric(ctx context.Context, req *pb.FCMetricReq) (res *pb.FCMetricRes, err error)
func (*Master) GetTagByApplication ¶
func (m *Master) GetTagByApplication(ctx context.Context, app *ent.Application, tagName string) (*ent.Tag, error)
GetTagByApplication get a tag for an application
func (*Master) GetTagByID ¶
GetTagByID get a tag for an application
func (*Master) Histogram ¶
func (m *Master) Histogram(ctx context.Context, req *pb.HistogramReq) (*pb.HistogramRes, error)
func (*Master) Logpaths ¶
Logpaths for an application ID returns folder path, system log filepath, and user log filepath
func (*Master) NewApplication ¶
func (m *Master) NewApplication(ctx context.Context, name, scenario, gomod, gosum string) ( *ent.Application, error, )
NewApplication create a new application with a name and a scenario return the application id and error
func (*Master) RemoveApplicationTag ¶
RemoveApplicationTag remove tag from an application
func (*Master) SetApplicationTag ¶
SetApplicationTag create and new tag and assign it for an application
func (*Master) SetIsScheduled ¶
SetIsScheduled update isScheduled property