mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Largely a removal job, however many tests, particularly system level ones relied on Routes. These have been migrated to use Fns. * Add 410 response to swagger * No app names in log tags * Adding constraint in GetCall for FnID * Adding test to check FnID is required on call * Add fn_id to call selector * Fix text in docker mem warning * Correct buildConfig func name * Test fix up * Removing CPU setting from Agent test CPU setting has been deprecated, but the code base is still riddled with it. This just removes it from this layer. Really we need to remove it from Call. * Remove fn id check on calls * Reintroduce fn id required on call * Adding fnID to calls for execute test * Correct setting of app id in middleware * Removes root middlewares ability to redirect fun invocations * Add over sized test check * Removing call fn id check
38 lines
1.2 KiB
Go
38 lines
1.2 KiB
Go
package models
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
)
|
|
|
|
type LogStore interface {
|
|
// InsertLog will insert the log at callID, overwriting if it previously
|
|
// existed.
|
|
InsertLog(ctx context.Context, call *Call, callLog io.Reader) error
|
|
|
|
// GetLog will return the log at callID, an error will be returned if the log
|
|
// cannot be found.
|
|
GetLog(ctx context.Context, fnID, callID string) (io.Reader, error)
|
|
|
|
// TODO we should probably allow deletion of a range of logs (also calls)?
|
|
// common cases for deletion will be:
|
|
// * fn gets nuked
|
|
// * app gets nuked
|
|
// * call+logs getting cleaned up periodically
|
|
|
|
// InsertCall inserts a call into the datastore, it will error if the call already
|
|
// exists.
|
|
InsertCall(ctx context.Context, call *Call) error
|
|
|
|
// GetCall2 returns a call at a certain id
|
|
GetCall(ctx context.Context, fnID, callID string) (*Call, error)
|
|
|
|
// GetCalls returns a list of calls that satisfy the given CallFilter. If no
|
|
// calls exist, an empty list and a nil error are returned.
|
|
GetCalls(ctx context.Context, filter *CallFilter) (*CallList, error)
|
|
|
|
// Close will close any underlying connections as needed.
|
|
// Close is not safe to be called from multiple threads.
|
|
io.Closer
|
|
}
|