Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ApiVersion string
NOTE: these 2 vars are set during compilation in gitlab CI build (see Makefile)
View Source
var GitHash string
Functions ¶
This section is empty.
Types ¶
type APIServices ¶
type APIServices struct { // Configuration read in on startup Config config.APIConfig // Default logger Log logger.ILogger // This is configured on startup to talk to the configured AWSCloudwatchRegion AWSSessionCW *session.Session // Anything talking to S3 should use this S3 s3iface.S3API // Anything accessing files should use this FS fileaccess.FileAccess // For Event Logging ES esutil.Connection // Validation of JWT tokens JWTReader IJWTReader // ID generator IDGen IDGenerator // URL signer for S3 Signer URLSigner // Zip File Generator Exporter ExportZipper // Notification Handler Notifications notifications.NotificationManager // Timestamp retriever - so can be mocked for unit tests TimeStamper ITimeStamper SecretsManager *secretcache.Cache }
APIServices contains any services that HTTP handlers would want to use, like logging/config reading
func InitAPIServices ¶
func InitAPIServices(cfg config.APIConfig, jwtReader IJWTReader, idGen IDGenerator, signer URLSigner, exporter ExportZipper, notifications notifications.NotificationManager) APIServices
InitAPIServices sets up a new APIServices instance
type ExportZipper ¶
type ExportZipper interface {
MakeExportFilesZip(*APIServices, string, string, string, string, string, []string, []string) ([]byte, error)
}
ExportZipper - Interface for creating an export zip file
type IDGenerator ¶
type IDGenerator interface {
GenObjectID() string
}
IDGenerator - Generates ID strings
type IJWTReader ¶
IJWTReader - User ID getter from HTTP request
type ITimeStamper ¶
type ITimeStamper interface {
GetTimeNowSec() int64
}
type MockTimeNowStamper ¶
type MockTimeNowStamper struct {
QueuedTimeStamps []int64
}
func (*MockTimeNowStamper) GetTimeNowSec ¶
func (ts *MockTimeNowStamper) GetTimeNowSec() int64
GetTimeNowSec - Returns unix time now in seconds
type URLSigner ¶
type URLSigner interface {
GetSignedURL(s3iface.S3API, string, string, time.Duration) (string, error)
}
URLSigner - Generates AWS S3 signed URLs
type UnixTimeNowStamper ¶
type UnixTimeNowStamper struct { }
func (*UnixTimeNowStamper) GetTimeNowSec ¶
func (ts *UnixTimeNowStamper) GetTimeNowSec() int64
GetTimeNowSec - Returns unix time now in seconds
Click to show internal directories.
Click to hide internal directories.