engine

package
v0.0.0-...-2a3249f Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2019 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package apis for common interfaces MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package stores for all sgbd operation MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package interfaces for common interfaces MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package business for business interface MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package business for business interface MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package interfaces for common interfaces MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package apis for common apis MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package apis for all exposed api MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package business for business interface MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package engine for all sgbd operation MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package engine for all sgbd operation MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package apis for all exposed api MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Tables Fix tables names
	Tables = []string{"Node"}
)

Functions

func Call

func Call(params ...interface{}) []reflect.Value

Call params

Types

type API

type API struct {
	*winter.Bean

	// Router with injection mecanism
	Router IRouter `@autowired:"router"`
	// SqlCrudBusiness with injection mecanism
	SQLCrudBusiness ICrudBusiness `@autowired:"sql-crud-business"`
	// GraphBusiness with injection mecanism
	GraphBusiness ILinkBusiness `@autowired:"graph-crud-business"`
	// Factory
	Factory          func() models.IPersistent
	Factories        func() models.IPersistents
	HandlerTasks     func(name string, body string) (interface{}, int, error)
	HandlerTasksByID func(id string, name string, body string) (interface{}, int, error)
	// Adapters
	GetByIDListener []func(models.IPersistent) models.IPersistent
	PutByIDListener []func(models.IPersistent) models.IPersistent
	// contains filtered or unexported fields
}

API base class

func (*API) Declare

func (p *API) Declare(data APIMethod, intf interface{}) error

Declare a new interface

func (*API) GenericDeleteByID

func (p *API) GenericDeleteByID(id string, toDelete models.IPersistent) (interface{}, error)

GenericDeleteByID default method

func (*API) GenericGetAll

func (p *API) GenericGetAll(toGet models.IPersistent, toGets models.IPersistents) ([]models.IPersistent, error)

GenericGetAll default method

func (*API) GenericGetByID

func (p *API) GenericGetByID(id string, toGet models.IPersistent) (models.IPersistent, error)

GenericGetByID default method

func (*API) GenericLinkDeleteByID

func (p *API) GenericLinkDeleteByID(assoc models.IEdgeBean) (interface{}, error)

GenericLinkDeleteByID default method

func (*API) GenericLinkGetAll

func (p *API) GenericLinkGetAll(id string, links []models.IEdgeBean, targetType IAPI) ([]models.IPersistent, error)

GenericLinkGetAll default method

func (*API) GenericLinkPostByID

func (p *API) GenericLinkPostByID(assoc models.IEdgeBean) (interface{}, error)

GenericLinkPutByID default method

func (*API) GenericLinkPutByID

func (p *API) GenericLinkPutByID(assoc models.IEdgeBean) (interface{}, error)

GenericLinkPutByID default method

func (*API) GenericPatchByID

func (p *API) GenericPatchByID(id string, body string, toPatch models.IPersistent) (interface{}, error)

GenericPatchByID default method

func (*API) GenericPost

func (p *API) GenericPost(body string, toCreate models.IPersistent) (interface{}, error)

GenericPost adefault method

func (*API) GenericPutByID

func (p *API) GenericPutByID(id string, body string, toUpdate models.IPersistent) (models.IPersistent, error)

GenericPutByID default method

func (*API) GetAll

func (p *API) GetAll() ([]models.IPersistent, error)

GetAll get all

func (p *API) GetAllLinks(id string, targetType IAPI) ([]models.IPersistent, error)

GetAllLinks get all

func (*API) GetByID

func (p *API) GetByID(id string) (models.IPersistent, error)

GetByID get by id

func (*API) GetFactories

func (p *API) GetFactories() models.IPersistents

GetFactories return a bean list

func (*API) GetFactory

func (p *API) GetFactory() models.IPersistent

GetFactory return on new bean

func (*API) HandlerDeleteByID

func (p *API) HandlerDeleteByID(id string) (interface{}, error)

HandlerDeleteByID delete by id

func (*API) HandlerFilter

func (p *API) HandlerFilter(body map[string]string) (models.IPersistents, error)

HandlerFilter task handler for filter

func (*API) HandlerLinkDeleteByID

func (p *API) HandlerLinkDeleteByID(src string, dst string, body string, targetType IAPI, instance string) (interface{}, error)

HandlerLinkDeleteByID update by id

func (*API) HandlerLinkPostByID

func (p *API) HandlerLinkPostByID(src string, dst string, body string, targetType IAPI) (models.IPersistent, error)

HandlerLinkPostByID update by id

func (*API) HandlerLinkPutByID

func (p *API) HandlerLinkPutByID(src string, dst string, body string, targetType IAPI, instance string) (models.IPersistent, error)

HandlerLinkPutByID update by id

func (*API) HandlerLinkStaticDeleteByID

func (p *API) HandlerLinkStaticDeleteByID() func(c IHttpContext, targetType IAPI)

HandlerLinkStaticDeleteByID is the DELETE by ID handler

func (*API) HandlerLinkStaticGetAll

func (p *API) HandlerLinkStaticGetAll() func(c IHttpContext, targetType IAPI)

HandlerLinkStaticGetAll is the GET by ID handler

func (*API) HandlerLinkStaticGetByID

func (p *API) HandlerLinkStaticGetByID() func(c IHttpContext, targetType IAPI)

HandlerLinkStaticGetByID is the GET by ID handler

func (*API) HandlerLinkStaticPostByID

func (p *API) HandlerLinkStaticPostByID() func(c IHttpContext, targetType IAPI)

HandlerLinkStaticPostByID is the PUT by ID handler

func (*API) HandlerLinkStaticPutByID

func (p *API) HandlerLinkStaticPutByID() func(c IHttpContext, targetType IAPI)

HandlerLinkStaticPutByID is the PUT by ID handler

func (*API) HandlerPatchByID

func (p *API) HandlerPatchByID(id string, body string) (interface{}, error)

HandlerPatchByID pach by id

func (*API) HandlerPost

func (p *API) HandlerPost(body string) (interface{}, error)

HandlerPost create handler

func (*API) HandlerPutByID

func (p *API) HandlerPutByID(id string, body string) (models.IPersistent, error)

HandlerPutByID update by id

func (*API) HandlerStaticDeleteByID

func (p *API) HandlerStaticDeleteByID() func(c IHttpContext)

HandlerStaticDeleteByID is the DELETE by ID handler

func (*API) HandlerStaticGetAll

func (p *API) HandlerStaticGetAll() func(c IHttpContext)

HandlerStaticGetAll is the GET by ID handler

func (*API) HandlerStaticGetByID

func (p *API) HandlerStaticGetByID() func(c IHttpContext)

HandlerStaticGetByID is the GET by ID handler

func (*API) HandlerStaticPatchByID

func (p *API) HandlerStaticPatchByID() func(c IHttpContext)

HandlerStaticPatchByID is the PATCH by ID handler

func (*API) HandlerStaticPost

func (p *API) HandlerStaticPost() func(c IHttpContext)

HandlerStaticPost is the POST handler

func (*API) HandlerStaticPostByID

func (p *API) HandlerStaticPostByID() func(c IHttpContext)

HandlerStaticPostByID is the POST handler

func (*API) HandlerStaticPutByID

func (p *API) HandlerStaticPutByID() func(c IHttpContext)

HandlerStaticPutByID is the PUT by ID handler

func (*API) Init

func (p *API) Init() error

Init initialize the APIf

func (p *API) LoadAllLinks(name string, factory func() models.IPersistent, targetType IAPI) (interface{}, int, error)

LoadAllLinks read all views and all data

func (*API) PostConstruct

func (p *API) PostConstruct(name string) error

PostConstruct this API

func (*API) ScanHandler

func (p *API) ScanHandler(swagger ISwaggerService, ptr interface{})

ScanHandler this API

func (*API) Validate

func (p *API) Validate(name string) error

Validate this API

func (*API) XTotalCount

func (p *API) XTotalCount(c IHttpContext, count int)

XTotalCount handle X-Total-Count

type APIManager

type APIManager struct {
	*winter.Service

	// Inject
	Router IRouter `@autowired:"router"`
	// contains filtered or unexported fields
}

APIManager interface

func (*APIManager) CommandLine

func (m *APIManager) CommandLine() error

CommandLine Init

func (*APIManager) HTTP

func (m *APIManager) HTTP(port int) error

HTTP declare http listener

func (*APIManager) HTTPS

func (m *APIManager) HTTPS(port int) error

HTTPS declare http listener

func (*APIManager) Init

func (m *APIManager) Init() error

Init a single bean

func (*APIManager) New

func (m *APIManager) New() IAPIManager

New constructor

func (*APIManager) Validate

func (m *APIManager) Validate(name string) error

Validate Init this manager

type APIMethod

type APIMethod struct {
	// contains filtered or unexported fields
}

APIMethod single structure to modelise api declaration

type CrudHandler

type CrudHandler interface {
	HandlerPost(body string) (interface{}, error)
}

CrudHandler single structure to modelise api declaration

type Graph

type Graph struct {
	// members
	*winter.Service

	// Db path
	DbPath string
	// contains filtered or unexported fields
}

Graph internal members

func (*Graph) All

func (p *Graph) All() ([]IQuad, error)

All get all element of database

func (*Graph) Clear

func (p *Graph) Clear() error

Clear Init this bean

func (p *Graph) CreateLink(data models.IEdgeBean) error

CreateLink in graph db

func (p *Graph) DeleteLink(toDelete models.IEdgeBean) error

DeleteLink this persistent bean

func (*Graph) Export

func (p *Graph) Export() (map[string][]map[string]interface{}, error)

Export some statistics

func (p *Graph) GetAllLink(model string, id string, array *[]models.IEdgeBean, targetType string) error

GetAllLink this persistent bean

func (p *Graph) GetLink(entity models.IEdgeBean) error

GetLink this persistent bean

func (*Graph) Init

func (p *Graph) Init() error

Init Init this bean

func (*Graph) New

func (p *Graph) New(dbpath string) IGraphStore

New constructor

func (*Graph) PostConstruct

func (p *Graph) PostConstruct(name string) error

PostConstruct this bean

func (*Graph) QueryGizmo

func (p *Graph) QueryGizmo(text string, tag string) ([]models.IEdgeBean, error)

QueryGizmo query gizmo

func (*Graph) Statistics

func (p *Graph) Statistics() ([]IStats, error)

Statistics some statistics

func (p *Graph) TruncateLink(entity models.IPersistent) error

TruncateLink method

func (p *Graph) UpdateLink(data models.IEdgeBean) error

UpdateLink in graph db

func (*Graph) Validate

func (p *Graph) Validate(name string) error

Validate Init this bean

type GraphCrudBusiness

type GraphCrudBusiness struct {
	*winter.Service
	// Store with injection mecanism
	Store IGraphStore `@autowired:"cayley-manager"`
}

GraphCrudBusiness internal members

func (*GraphCrudBusiness) All

func (p *GraphCrudBusiness) All() ([]IQuad, error)

Statistics some statistics

func (*GraphCrudBusiness) Clear

func (p *GraphCrudBusiness) Clear() error

Clear this bean

func (p *GraphCrudBusiness) CreateLink(toCreate models.IEdgeBean) (models.IEdgeBean, error)

CreateLink retrieve this link

func (p *GraphCrudBusiness) DeleteLink(toDelete models.IEdgeBean) (models.IEdgeBean, error)

DeleteLink a bean

func (*GraphCrudBusiness) Export

func (p *GraphCrudBusiness) Export() (map[string][]map[string]interface{}, error)

Export some values

func (p *GraphCrudBusiness) GetAllLink(model string, id string, toGets []models.IEdgeBean, targetType string) ([]models.IEdgeBean, error)

GetAllLink retrieve this bean by its id

func (*GraphCrudBusiness) Init

func (p *GraphCrudBusiness) Init() error

Init this bean

func (*GraphCrudBusiness) New

New constructor

func (p *GraphCrudBusiness) PatchLink(toPatch models.IEdgeBean) (models.IEdgeBean, error)

PatchLink a bean

func (*GraphCrudBusiness) PostConstruct

func (p *GraphCrudBusiness) PostConstruct(name string) error

PostConstruct this bean

func (*GraphCrudBusiness) Statistics

func (p *GraphCrudBusiness) Statistics() ([]IStats, error)

Statistics some statistics

func (p *GraphCrudBusiness) TruncateLink(toTruncate models.IPersistent) (models.IPersistent, error)

TruncateLink a bean

func (p *GraphCrudBusiness) UpdateLink(toUpdate models.IEdgeBean) (models.IEdgeBean, error)

UpdateLink retrieve this link

func (*GraphCrudBusiness) Validate

func (p *GraphCrudBusiness) Validate(name string) error

Validate this bean

type IAPI

type IAPI interface {
	winter.IBean
	Declare(APIMethod, interface{}) error
	// Data handled by this API
	GetFactory() models.IPersistent
	GetFactories() models.IPersistents
	// All
	GetAll() ([]models.IPersistent, error)
	// Links
	GetAllLinks(id string, targetType IAPI) ([]models.IPersistent, error)
	LoadAllLinks(name string, factory func() models.IPersistent, targetType IAPI) (interface{}, int, error)
}

IAPI all package methods

type IAPIManager

type IAPIManager interface {
	winter.IService
	// Method
	CommandLine() error
}

IAPIManager interface

type ICrudBusiness

ICrudBusiness interface

type IDataStore

type IDataStore interface {
	winter.IBean
	Create(entity models.IPersistent) error
	Update(id string, entity models.IPersistent) error
	Delete(id string, entity models.IPersistent) error
	Truncate(entity models.IPersistent) error
	Get(id string, entity models.IPersistent) error
	GetAll(entity models.IPersistent, array models.IPersistents) error
	Clear([]string) error
	Statistics() ([]IStats, error)
}

IDataStore interface

type IGraphStore

type IGraphStore interface {
	winter.IBean
	CreateLink(data models.IEdgeBean) error
	UpdateLink(data models.IEdgeBean) error
	DeleteLink(entity models.IEdgeBean) error
	TruncateLink(entity models.IPersistent) error
	GetLink(entity models.IEdgeBean) error
	GetAllLink(model string, id string, collection *[]models.IEdgeBean, targetType string) error
	Clear() error
	All() ([]IQuad, error)
	Statistics() ([]IStats, error)
	Export() (map[string][]map[string]interface{}, error)
}

IGraphStore interface

type IHttpContext

type IHttpContext interface {
	Header(key, value string)
	IndentedJSON(code int, obj interface{})
	String(code int, format string, values ...interface{})
	Status(code int)
	Param(key string) string
	Query(key string) string
	GetQuery(key string) (string, bool)
	GetRawData() ([]byte, error)
}

IHttpContext map GIN context

type ILinkBusiness

type ILinkBusiness interface {
	winter.IBean
	// Linked nodes
	CreateLink(toCreate models.IEdgeBean) (models.IEdgeBean, error)
	UpdateLink(toUpdate models.IEdgeBean) (models.IEdgeBean, error)
	DeleteLink(toCreate models.IEdgeBean) (models.IEdgeBean, error)
	PatchLink(toPatch models.IEdgeBean) (models.IEdgeBean, error)
	GetAllLink(model string, id string, toGets []models.IEdgeBean, targetType string) ([]models.IEdgeBean, error)
	// Models admin
	Clear() error
	All() ([]IQuad, error)
	Statistics() ([]IStats, error)
	Export() (map[string][]map[string]interface{}, error)
}

ILinkBusiness interface

type INode

type INode interface {
	IAPI
}

INode implements IBean

type IQuad

type IQuad interface {
	SubjectID() string
	Subject() string
	PredicateID() string
	Predicate() string
	ObjectID() string
	Object() string
	Label() string
}

IQuad model

type IRouter

type IRouter interface {
	winter.IService
	// Http boot
	HTTP(port int) error
	// Https boot
	HTTPS(port int, certFile string, keyFile string) error
	// Swagger
	SwaggerModel() func(*gin.Context)
	// HandleFunc
	HandleFunc(path string, f func(c IHttpContext), method string, content string)
	// HandleFunc
	HandleFuncLink(path string, f func(c IHttpContext, target IAPI), method string, content string, target IAPI)
	// HandleFuncString declare a string handler
	HandleFuncString(path string, f func() (string, error), method string, content string)
	// HandleRequest declare a string handler
	HandleRequest(path string, f http.Handler, method string)
	// HandleFuncStringWithId declare a string handler
	HandleFuncStringWithId(path string, f func(string) (string, error), method string, content string)
}

IRouter Test all package methods

type IStats

type IStats interface {
	GetKey() string
	GetValue() string
}

IStats stats

type ISwaggerService

type ISwaggerService interface {
	winter.IService
	// Swagger
	SwaggerModel() *models.SwaggerModel
	Version(string) string
	BasePath(string) string
	// swagger method
	AddPaths(tags string, route string, method string, sumary string, description string, args map[string]interface{}, params map[string]interface{}, in []interface{}, out map[string]interface{})
}

ISwaggerService Test all package methods

type Node

type Node struct {
	// Base component
	*API
	// internal members
	Name string
	// mounts
	Crud interface{} `@crud:"/api/nodes"`
	Link INode       `@autowired:"NodeBean" @link:"/api/nodes" @href:"nodes"`
	// Swagger with injection mecanism
	Swagger ISwaggerService `@autowired:"swagger"`
}

Node internal members

func (*Node) Init

func (p *Node) Init() error

Init this API

func (*Node) New

func (p *Node) New() INode

New constructor

func (*Node) PostConstruct

func (p *Node) PostConstruct(name string) error

PostConstruct this API

func (*Node) Validate

func (p *Node) Validate(name string) error

Validate this API

type SqlCrudBusiness

type SqlCrudBusiness struct {
	// members
	*winter.Service
	// Store with injection mecanism
	Store IDataStore `@autowired:"sqllite-manager"`
}

SqlCrudBusiness internal members

func (*SqlCrudBusiness) Clear

func (p *SqlCrudBusiness) Clear(excp []string) error

Clear this bean

func (*SqlCrudBusiness) Create

func (p *SqlCrudBusiness) Create(toCreate models.IPersistent) (models.IPersistent, error)

Create create a new persistent bean

func (*SqlCrudBusiness) Delete

func (p *SqlCrudBusiness) Delete(toDelete models.IPersistent) (models.IPersistent, error)

Delete a bean

func (*SqlCrudBusiness) Get

Get retrieve this bean by its id

func (*SqlCrudBusiness) GetAll

GetAll retrieve this bean by its id

func (*SqlCrudBusiness) Init

func (p *SqlCrudBusiness) Init() error

Init this bean

func (*SqlCrudBusiness) New

func (p *SqlCrudBusiness) New() ICrudBusiness

New constructor

func (*SqlCrudBusiness) Patch

Patch a bean

func (*SqlCrudBusiness) PostConstruct

func (p *SqlCrudBusiness) PostConstruct(name string) error

PostConstruct this bean

func (*SqlCrudBusiness) Statistics

func (p *SqlCrudBusiness) Statistics() ([]IStats, error)

Statistics some statistics

func (*SqlCrudBusiness) Truncate

func (p *SqlCrudBusiness) Truncate(toTruncate models.IPersistent) (models.IPersistent, error)

Delete a bean

func (*SqlCrudBusiness) Update

func (p *SqlCrudBusiness) Update(toUpdate models.IPersistent) (models.IPersistent, error)

Update an existing bean

func (*SqlCrudBusiness) Validate

func (p *SqlCrudBusiness) Validate(name string) error

Validate this bean

type Store

type Store struct {
	*winter.Service

	// Tables
	Tables []string
	// Db path
	DbPath string
	// Manager with injection mecanism
	APIManager IAPIManager `@autowired:"APIManager"`
	// contains filtered or unexported fields
}

Store internal members

func (*Store) Clear

func (p *Store) Clear(excp []string) error

Clear Init this bean

func (*Store) Create

func (p *Store) Create(entity models.IPersistent) error

Create this persistent bean n store

func (*Store) Delete

func (p *Store) Delete(id string, entity models.IPersistent) error

Delete this persistent bean

func (*Store) Get

func (p *Store) Get(id string, entity models.IPersistent) error

Get this persistent bean

func (*Store) GetAll

func (p *Store) GetAll(entity models.IPersistent, array models.IPersistents) error

GetAll this persistent bean

func (*Store) Init

func (p *Store) Init() error

Init Init this bean

func (*Store) New

func (p *Store) New(dbpath string) IDataStore

New constructor

func (*Store) PostConstruct

func (p *Store) PostConstruct(name string) error

PostConstruct this bean

func (*Store) Statistics

func (p *Store) Statistics() ([]IStats, error)

Statistics some statistics

func (*Store) Truncate

func (p *Store) Truncate(entity models.IPersistent) error

Truncate method

func (*Store) Update

func (p *Store) Update(id string, entity models.IPersistent) error

Update this persistent bean

func (*Store) Validate

func (p *Store) Validate(name string) error

Validate Init this bean

type StoreStats

type StoreStats struct {
	Key   string
	Value string
}

StoreStats statss

func (*StoreStats) GetKey

func (p *StoreStats) GetKey() string

GetKey some statistics

func (*StoreStats) GetValue

func (p *StoreStats) GetValue() string

GetValue some statistics

type SwaggerService

type SwaggerService struct {
	// members
	*winter.Service
	// swagger model
	Swagger *models.SwaggerModel
}

SwaggerService internal members

func (*SwaggerService) AddDefinition

func (p *SwaggerService) AddDefinition(name string, ptr interface{}) string

AddDefinition method

func (*SwaggerService) AddPaths

func (p *SwaggerService) AddPaths(tags string, route string, method string, summary string, description string, args map[string]interface{}, query map[string]interface{}, in []interface{}, out map[string]interface{})

AddPaths method

func (*SwaggerService) AddSchemes

func (p *SwaggerService) AddSchemes()

AddSchemes method

func (*SwaggerService) AddTags

func (p *SwaggerService) AddTags()

AddTags method

func (*SwaggerService) BasePath

func (p *SwaggerService) BasePath(base string) string

BasePath method

func (*SwaggerService) Init

func (p *SwaggerService) Init() error

Init Init this API

func (*SwaggerService) New

New constructor

func (*SwaggerService) PostConstruct

func (p *SwaggerService) PostConstruct(name string) error

PostConstruct Init this API

func (*SwaggerService) SwaggerModel

func (p *SwaggerService) SwaggerModel() *models.SwaggerModel

SwaggerModel method

func (*SwaggerService) Validate

func (p *SwaggerService) Validate(name string) error

Validate Init this API

func (*SwaggerService) Version

func (p *SwaggerService) Version(vers string) string

Version method

Jump to

Keyboard shortcuts

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