Initial cloud-services repo - gateway service + pkg modules
This commit is contained in:
26
pkg/common/apicalls.go
Normal file
26
pkg/common/apicalls.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package common
|
||||
|
||||
import "time"
|
||||
|
||||
type AccessType string
|
||||
|
||||
const AccessTypeJWT = "jwt"
|
||||
const AccessTypeAPIToken = "api_token"
|
||||
|
||||
type APICall struct {
|
||||
// ClientID can be email or api_token.
|
||||
ClientID string `json:"client_id" pg:"client_id"`
|
||||
|
||||
// Check allowed access types above.
|
||||
AccessType string `json:"access_type" pg:"access_type"`
|
||||
Method string `json:"method" pg:"method"`
|
||||
Endpoint string `json:"endpoint" pg:"endpoint"`
|
||||
CreatedAt *time.Time `json:"created_at" pg:"default:now()"`
|
||||
}
|
||||
|
||||
// APICallsSearch is supposed to be used for calls only.
|
||||
type APICallsSearch struct {
|
||||
Search string
|
||||
From *time.Time
|
||||
To *time.Time
|
||||
}
|
||||
Reference in New Issue
Block a user