Documentation
¶
Index ¶
- type ApigatewayData
- type AuthDTO
- type Deployment
- type Entity
- type EntityLog
- type EnvironmentVariable
- type ErrorResponse
- type Event
- type Function
- type FunctionContainerLogDTO
- type FunctionContainerLogOptions
- type FunctionCreateOptions
- type FunctionDTO
- type FunctionIdleState
- type FunctionLife
- type FunctionSourceFile
- type FunctionTest
- type FunctionTestResponse
- type HeaderMappingTemplate
- type JWTToken
- type Log
- type ManagerComponent
- type RequestMappingTemplate
- type RequestTracker
- type RequestTrackerMessage
- type RequestTrackerResponse
- type Resource
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApigatewayData ¶
type ApigatewayData struct {
ManagerComponents []ManagerComponent `json:"managerComponents"`
Resources []Resource `json:"resources"`
}
ApigatewayData used to get data from manager to apigateway
type Deployment ¶
Deployment deployment details
type Entity ¶
type Entity interface {
GetReflectObject() reflect.Value
GetID() string
SetID(id string)
SetModifiedAt()
}
Entity is used as Base for every models ######################################
type EntityLog ¶
type EntityLog struct {
Time string `json:"time"`
State string `json:"state"`
Message string `json:"message"`
}
EntityLog log entity is used to describe states of each entities ######################################
type EnvironmentVariable ¶ added in v0.1.2
type EnvironmentVariable struct {
Name string `json:"name" yaml:"name"`
Value string `json:"value" yaml:"value"`
}
EnvironmentVariable environmentVariable
type ErrorResponse ¶
type ErrorResponse struct {
Status int `json:"status"`
Cause string `json:"cause"`
Message interface{} `json:"message"`
}
ErrorResponse errorResponse
type Event ¶
type Event struct {
ID string `json:"id"`
Group string `json:"group"`
Name string `json:"name"`
CreatedAt string `json:"createdAt" yaml:"createdAt"` //created time
ModifiedAt string `json:"modifiedAt" yaml:"modifiedAt"` //modified time
}
Event model ###################################### ID => <prefix>.Group.Name
func (*Event) GetReflectObject ¶
GetReflectObject get Reflect Object
type Function ¶
type Function struct {
Name string `json:"name" yaml:"name"`
Version string `json:"version" yaml:"version"` //current version
Versions []string `json:"versions" yaml:"versions"`
DockerImageID string `json:"dockerImageID" yaml:"dockerImageID"`
Source string `json:"source" yaml:"source"`
Handler string `json:"handler" yaml:"handler"`
HandlerPath string `json:"handlerPath" yaml:"handlerPath"`
HandlerFile string `json:"handlerFile" yaml:"handlerFile"`
Runtime string `json:"runtime" yaml:"runtime"`
Events []string `json:"events" yaml:"events"`
Replicas int `json:"replicas" yaml:"replicas"`
EnvironmentVariables []EnvironmentVariable `json:"env" yaml:"env"`
SecretKey string `json:"secretKey"`
Route string `json:"route"`
Life FunctionLife `json:"life"`
Log EntityLog `json:"log"`
ModifiedAt string `json:"modifiedAt" yaml:"modifiedAt"` //modified time
Status string `json:"status" yaml:"status"`
}
Function model ###################################### Source : code / artifact stored file location FunctionPath :
Runtime java : class path of handler Runtime node : myHandler
FunctionFile :
Runtime jsvs : const value eg : function.jar Runtime node : const value eg : handler.js Runtime node package : user defined
Route : function invoker route id. nor required
func (*Function) GetReflectObject ¶
GetReflectObject get Reflect Object
type FunctionContainerLogDTO ¶
type FunctionContainerLogDTO struct {
Options FunctionContainerLogOptions `json:"options" yaml:"options"`
Function Function `json:"function" yaml:"function"`
}
FunctionContainerLogDTO dto
type FunctionContainerLogOptions ¶
type FunctionContainerLogOptions struct {
ShowStdout bool `json:"showStdout"`
ShowStderr bool `json:"showStderr"`
Since string `json:"since"`
Until string `json:"until"`
Timestamps bool `json:"timestamps"`
Follow bool `json:"follow"`
Tail string `json:"tail"`
Details bool `json:"details"`
}
FunctionContainerLogOptions extra options
type FunctionCreateOptions ¶
type FunctionCreateOptions struct {
Publish bool `json:"publish"`
}
FunctionCreateOptions extra options
type FunctionDTO ¶
type FunctionDTO struct {
Options FunctionCreateOptions `json:"options" yaml:"options"`
Function Function `json:"function" yaml:"function"`
Route Resource `json:"route" yaml:"route"`
SourceFile FunctionSourceFile `json:"sourceFile" yaml:"sourceFile"`
}
FunctionDTO dto
type FunctionIdleState ¶ added in v0.1.3
type FunctionIdleState struct {
Timeunit string `json:"timeunit" yaml:"timeunit"` //eg: seconds, minutes, hours
Timeout int `json:"timeout" yaml:"timeout"` //eg: 45
}
FunctionIdleState function's idle state
type FunctionLife ¶ added in v0.1.3
type FunctionLife struct {
Awake string `json:"awake" yaml:"awake"` //eg: default or request
IdleState FunctionIdleState `json:"idleState" yaml:"idleState"`
}
FunctionLife function's life controller
type FunctionSourceFile ¶
type FunctionSourceFile struct {
File multipart.File `json:"file" yaml:"file"`
FileHeader *multipart.FileHeader `json:"fileHeader" yaml:"fileHeader"`
}
FunctionSourceFile extra options
type FunctionTest ¶ added in v0.1.2
type FunctionTest struct {
Name string `json:"name" yaml:"name"`
Payload map[string]interface{} `json:"payload" yaml:"payload"`
}
FunctionTest function test
type FunctionTestResponse ¶ added in v0.1.2
type FunctionTestResponse struct {
Status int `json:"status"`
Message interface{} `json:"message"`
}
FunctionTestResponse functionTestResponse
type HeaderMappingTemplate ¶
type HeaderMappingTemplate struct {
EventAttribute string `json:"eventAttribute" yaml:"eventAttribute"`
HeaderAttribute string `json:"headerAttribute" yaml:"headerAttribute"`
}
HeaderMappingTemplate model ######################################
type JWTToken ¶
type JWTToken struct {
Token string `json:"token"`
}
JWTToken ######################################
type Log ¶
type Log struct {
Type string `json:"type"`
Message string `json:"message"`
Source string `json:"source"` //executed by function-container-id or app-id
Time string `json:"time"` //executed time
}
Log log
type ManagerComponent ¶
type ManagerComponent struct {
ID string `json:"id"`
DockerImageID string `json:"dockerImageID"`
DockerContainerID string `json:"dockerContainerID"`
AccessKey string `json:"accessKey"`
Deployment Deployment `json:"deployment"`
Log EntityLog `json:"log"`
CreatedAt string `json:"createdAt" yaml:"createdAt"` //created time
ModifiedAt string `json:"modifiedAt" yaml:"modifiedAt"` //modified time
}
ManagerComponent components handle by manager ###################################### ID + AccessKey => JWT => store in dockerimage => later that JWT token will use to authenticate resource access
func (*ManagerComponent) GetReflectObject ¶
func (o *ManagerComponent) GetReflectObject() reflect.Value
GetReflectObject get Reflect Object
func (*ManagerComponent) SetModifiedAt ¶
func (o *ManagerComponent) SetModifiedAt()
SetModifiedAt set modified date
type RequestMappingTemplate ¶
type RequestMappingTemplate struct {
EventAttribute string `json:"eventAttribute" yaml:"eventAttribute"`
RequestAttribute string `json:"requestAttribute" yaml:"requestAttribute"`
}
RequestMappingTemplate model ######################################
type RequestTracker ¶
type RequestTracker struct {
RequestID string `json:"requestID"`
Source string `json:"source"` //created by
Response RequestTrackerResponse `json:"response"` //response set by function
CreatedAt string `json:"createdAt"` //created time
CompletedAt string `json:"completedAt"` //completed time
Logs []Log `json:"logs"` //logs created by function
}
RequestTracker requestTracker
func (*RequestTracker) GetReflectObject ¶
func (o *RequestTracker) GetReflectObject() reflect.Value
GetReflectObject get Reflect Object
func (*RequestTracker) SetModifiedAt ¶
func (o *RequestTracker) SetModifiedAt()
SetModifiedAt set modified date
type RequestTrackerMessage ¶
type RequestTrackerMessage struct {
RequestID string `json:"requestID"`
Response RequestTrackerResponse `json:"response"`
Log Log `json:"log"`
Completed bool `json:"completed"`
}
RequestTrackerMessage use to communtication
type RequestTrackerResponse ¶
type RequestTrackerResponse struct {
Status int `json:"status"`
Message interface{} `json:"message"`
}
RequestTrackerResponse requestTrackerResponse
type Resource ¶
type Resource struct {
ID string `json:"id"`
Name string `json:"name" yaml:"name"`
RequestMethod string `json:"requestMethod" yaml:"requestMethod"`
URL string `json:"url" yaml:"url"`
Async bool `json:"async" yaml:"async"`
RequestTimeout int `json:"requestTimeout" yaml:"requestTimeout"` //in second
SuccessResponseStatus int `json:"successResponseStatus" yaml:"successResponseStatus"`
Event string `json:"event" yaml:"event"`
RequestMapping []RequestMappingTemplate `json:"requestMapping" yaml:"requestMapping"`
HeaderMapping []HeaderMappingTemplate `json:"headerMapping" yaml:"headerMapping"`
HeadersToPass []string `json:"headersToPass" yaml:"headersToPass"` //header list pass to endpoint
CreatedAt string `json:"createdAt" yaml:"createdAt"` //created time
ModifiedAt string `json:"modifiedAt" yaml:"modifiedAt"` //modified time
}
Resource model ###################################### ID => URL:RequestMethod
func (*Resource) GetReflectObject ¶
GetReflectObject get Reflect Object
type User ¶
type User struct {
Username string `json:"username"`
Firstname string `json:"firstname"`
Password string `json:"password"`
CreatedAt string `json:"createdAt" yaml:"createdAt"` //created time
ModifiedAt string `json:"modifiedAt" yaml:"modifiedAt"` //modified time
}
User model ######################################
func (*User) GetReflectObject ¶
GetReflectObject get Reflect Object