types

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

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 AuthDTO

type AuthDTO struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

AuthDTO ######################################

type Deployment

type Deployment struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

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) GetID

func (o *Event) GetID() string

GetID get ID

func (*Event) GetReflectObject

func (o *Event) GetReflectObject() reflect.Value

GetReflectObject get Reflect Object

func (*Event) SetID

func (o *Event) SetID(id string)

SetID get ID

func (*Event) SetModifiedAt

func (o *Event) SetModifiedAt()

SetModifiedAt set modified date

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) GetID

func (o *Function) GetID() string

GetID get ID

func (*Function) GetReflectObject

func (o *Function) GetReflectObject() reflect.Value

GetReflectObject get Reflect Object

func (*Function) SetID

func (o *Function) SetID(id string)

SetID get ID

func (*Function) SetModifiedAt

func (o *Function) SetModifiedAt()

SetModifiedAt set modified date

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) GetID

func (o *ManagerComponent) GetID() string

GetID get ID

func (*ManagerComponent) GetReflectObject

func (o *ManagerComponent) GetReflectObject() reflect.Value

GetReflectObject get Reflect Object

func (*ManagerComponent) SetID

func (o *ManagerComponent) SetID(id string)

SetID get ID

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) GetID

func (o *RequestTracker) GetID() string

GetID get ID

func (*RequestTracker) GetReflectObject

func (o *RequestTracker) GetReflectObject() reflect.Value

GetReflectObject get Reflect Object

func (*RequestTracker) SetID

func (o *RequestTracker) SetID(id string)

SetID get ID

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) GetID

func (o *Resource) GetID() string

GetID get ID

func (*Resource) GetReflectObject

func (o *Resource) GetReflectObject() reflect.Value

GetReflectObject get Reflect Object

func (*Resource) SetDefault

func (o *Resource) SetDefault()

SetDefault set default values

func (*Resource) SetID

func (o *Resource) SetID(id string)

SetID get ID

func (*Resource) SetModifiedAt

func (o *Resource) SetModifiedAt()

SetModifiedAt set modified date

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) GetID

func (o *User) GetID() string

GetID get ID

func (*User) GetReflectObject

func (o *User) GetReflectObject() reflect.Value

GetReflectObject get Reflect Object

func (*User) SetID

func (o *User) SetID(id string)

SetID get ID

func (*User) SetModifiedAt

func (o *User) SetModifiedAt()

SetModifiedAt set modified date

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL