types

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

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.

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

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

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 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"`
}

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

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

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

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

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

type User

type User struct {
	Username  string `json:"username"`
	Firstname string `json:"firstname"`
	Password  string `json:"password"`
}

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

Jump to

Keyboard shortcuts

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