Documentation
¶
Overview ¶
Copyright 2018 Tharanga Nilupul Thennakoon
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 Tharanga Nilupul Thennakoon ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type ApigatewayData
- type AuthDTO
- type Deployment
- type Entity
- type EntityLog
- type ErrorResponse
- type Event
- type Function
- type FunctionContainer
- type FunctionContainerLogDTO
- type FunctionContainerLogOptions
- type FunctionCreateOptions
- type FunctionDTO
- type HeaderMappingTemplate
- type JWTToken
- type Log
- type Machine
- 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 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 ErrorResponse ¶
type ErrorResponse struct {
Status int `json:"status"`
Cause string `json:"cause"`
Message interface{} `json:"message"`
}
ErrorResponse errorResponse
type Event ¶
Event model ###################################### ID => <prefix>.Group.Name
func (*Event) GetReflectObject ¶
GetReflectObject get Reflect Object
type Function ¶
type Function struct {
Name string `json:"name" yaml:"name"`
DockerImageID string `json:"dockerImageID" yaml:"dockerImageID"`
ArtifactStoredLocation string `json:"artifactStoredLocation" yaml:"artifactStoredLocation"`
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"`
SecretKey string `json:"secretKey"`
Route string `json:"route"`
Log EntityLog `json:"log"`
}
Function model ###################################### ArtifactStoredLocation : artifact stored file location of the user machine 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 FunctionContainer ¶
type FunctionContainer struct {
ID string `json:"id"`
}
FunctionContainer model ######################################
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"`
}
FunctionDTO dto
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 Machine ¶
type Machine struct {
Address string `json:"address"`
Host string `json:"host"`
Port string `json:"port"`
}
Machine model ######################################
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"`
}
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
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
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
}
Resource model ###################################### ID => URL:RequestMethod
func (*Resource) GetReflectObject ¶
GetReflectObject get Reflect Object