All of the changes for func logs

This commit is contained in:
James
2017-06-19 11:38:11 -07:00
parent 8f753b779c
commit 8a3edb8309
39 changed files with 783 additions and 140 deletions

View File

@@ -22,7 +22,6 @@ var (
ErrAppsUpdate = errors.New("Could not update app")
ErrDeleteAppsWithRoutes = errors.New("Cannot remove apps with routes")
ErrUsableImage = errors.New("Image not found")
ErrCallNotFound = errors.New("Call not found")
ErrTaskInvalidAppAndRoute = errors.New("Unable to get call for given app and route")
)

12
api/models/logs.go Normal file
View File

@@ -0,0 +1,12 @@
package models
import (
"context"
)
type FnLog interface {
InsertLog(ctx context.Context, callID string, callLog string) error
GetLog(ctx context.Context, callID string) (*FnCallLog, error)
DeleteLog(ctx context.Context, callID string) error
}

View File

@@ -4,6 +4,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
apierrors "errors"
"encoding/json"
strfmt "github.com/go-openapi/strfmt"
@@ -28,6 +29,12 @@ const (
FormatHTTP = "http"
)
var (
ErrCallNotFound = apierrors.New("Call not found")
ErrCallLogNotFound = apierrors.New("Call log not found")
ErrCallLogRemoving = apierrors.New("Could not remove call log")
)
type FnCall struct {
IDStatus
CompletedAt strfmt.DateTime `json:"completed_at,omitempty"`
@@ -38,6 +45,12 @@ type FnCall struct {
}
type FnCallLog struct {
CallID string `json:"call_id"`
Log string `json:"log"`
}
func (fnCall *FnCall) FromTask(task *Task) *FnCall {
return &FnCall{
CreatedAt:task.CreatedAt,