Documentation ¶
Index ¶
- func AddInt(a, b int) int
- func Append(list []interface{}, value interface{}) []interface{}
- func ConnectDB(dbType string, connection string, maxOpenConn int) (db.DB, error)
- func Contains(list []interface{}, value interface{}) bool
- func Copy(list []interface{}) []interface{}
- func CounterAdd(counter *util.Counter, value int)
- func CounterValue(counter *util.Counter) int
- func DBBegin(connection db.DB) (transaction.Transaction, error)
- func DBClose(tx transaction.Transaction) error
- func DBColumn(schemaID string, join bool) (string, error)
- func DBCommit(tx transaction.Transaction) error
- func DBCreate(tx transaction.Transaction, schemaID string, data map[string]interface{}) error
- func DBDelete(tx transaction.Transaction, schemaID string, id string) error
- func DBExec(tx transaction.Transaction, sql string, arguments []interface{}) error
- func DBGet(tx transaction.Transaction, schemaID string, id string, tenantID string) (map[string]interface{}, error)
- func DBList(tx transaction.Transaction, schemaID string, filter map[string]interface{}) ([]interface{}, error)
- func DBQuery(tx transaction.Transaction, schemaID string, sql string, ...) ([]interface{}, error)
- func DBUpdate(tx transaction.Transaction, schemaID string, data map[string]interface{}) error
- func Delete(list []interface{}, index int) []interface{}
- func DivInt(a, b int) int
- func Env() map[string]interface{}
- func Error(code int, name, message string) error
- func FetchContent(path string) (interface{}, error)
- func First(list []interface{}) interface{}
- func FloatToInt(value float64) int
- func ForceStop(queue *job.Queue)
- func FormatUUID(uuid string) (string, error)
- func GetConfig(key string, defaultValue interface{}) interface{}
- func GetOpenstackClient(authURL, userName, password, domainName, tenantName, tenantID, version string) (*gophercloud.ServiceClient, error)
- func GetTestServerURL(server *httptest.Server) string
- func GohanLoadSchema(src string) (interface{}, error)
- func GohanPolicies() []*schema.Policy
- func GohanSchema(schemaID string) (*schema.Schema, error)
- func GohanSchemas() schema.Map
- func GohanServer(configFile string, test bool) (interface{}, error)
- func HTTPDelete(url string, headers map[string]interface{}) (interface{}, error)
- func HTTPGet(url string, headers map[string]interface{}) (map[string]interface{}, error)
- func HTTPPatch(url string, headers map[string]interface{}, postData map[string]interface{}) (map[string]interface{}, error)
- func HTTPPost(url string, headers map[string]interface{}, postData map[string]interface{}) (map[string]interface{}, error)
- func HTTPPut(url string, headers map[string]interface{}, postData map[string]interface{}) (map[string]interface{}, error)
- func HTTPRequest(url string, method string, headers map[string]interface{}, ...) (map[string]interface{}, error)
- func IPAdd(ip string, value int) string
- func IPToInt(ip string) int
- func InitDB(dbType string, connection string, dropOnCreate bool, cascade bool) error
- func IntToIP(value int) string
- func Join(value []interface{}, sep string) (interface{}, error)
- func Last(list []interface{}) interface{}
- func MakeCounter(value int) *util.Counter
- func MakeMap() cmap.ConcurrentMap
- func MakeQueue(workers int) *job.Queue
- func MapGet(m cmap.ConcurrentMap, key string) interface{}
- func MapHas(m cmap.ConcurrentMap, key string) bool
- func MapRemove(m cmap.ConcurrentMap, key string)
- func MapSet(m cmap.ConcurrentMap, key string, value interface{})
- func MulInt(a, b int) int
- func NormalizeMap(data map[string]interface{}) map[string]interface{}
- func OpenstackDelete(client *gophercloud.ServiceClient, url string) (interface{}, error)
- func OpenstackEndpoint(client *gophercloud.ServiceClient, ...) (interface{}, error)
- func OpenstackEnsure(client *gophercloud.ServiceClient, url string, postURL string, ...) (interface{}, error)
- func OpenstackGet(client *gophercloud.ServiceClient, url string) (interface{}, error)
- func OpenstackPost(client *gophercloud.ServiceClient, url string, data interface{}) (interface{}, error)
- func OpenstackPut(client *gophercloud.ServiceClient, url string, data interface{}) (interface{}, error)
- func OpenstackToken(client *gophercloud.ServiceClient) string
- func ParseCidr(cidr string) (string, int, int)
- func ReadConfig(path string) error
- func SaveContent(path string, data interface{}) error
- func Shift(list []interface{}) (interface{}, []interface{})
- func Size(list []interface{}) int
- func Split(value, sep string) (interface{}, error)
- func Stop(queue *job.Queue)
- func StopTestServer(server *httptest.Server)
- func SubInt(a, b int) int
- func UUID() string
- func Unshift(list []interface{}, value interface{}) []interface{}
- func WaitQueue(queue *job.Queue)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Append ¶
func Append(list []interface{}, value interface{}) []interface{}
Append add element to the list and return new list.
func Contains ¶
func Contains(list []interface{}, value interface{}) bool
Contains checks if a value is in a list.
func CounterAdd ¶
CounterAdd makes thread safe counter
func CounterValue ¶
CounterValue makes thread safe counter
func DBBegin ¶
func DBBegin(connection db.DB) (transaction.Transaction, error)
DBBegin starts transaction
func DBCreate ¶
func DBCreate(tx transaction.Transaction, schemaID string, data map[string]interface{}) error
DBCreate creates a resource in a db.
func DBDelete ¶
func DBDelete(tx transaction.Transaction, schemaID string, id string) error
DBDelete deletes a resource in a db.
func DBExec ¶
func DBExec(tx transaction.Transaction, sql string, arguments []interface{}) error
DBExec closes a transaction.
func DBGet ¶
func DBGet(tx transaction.Transaction, schemaID string, id string, tenantID string) (map[string]interface{}, error)
DBGet get resource from a db.
func DBList ¶
func DBList(tx transaction.Transaction, schemaID string, filter map[string]interface{}) ([]interface{}, error)
DBList lists data from database.
func DBQuery ¶
func DBQuery(tx transaction.Transaction, schemaID string, sql string, arguments []interface{}) ([]interface{}, error)
DBQuery fetchs data from db with additional query
func DBUpdate ¶
func DBUpdate(tx transaction.Transaction, schemaID string, data map[string]interface{}) error
DBUpdate updates a resource in a db.
func Delete ¶
func Delete(list []interface{}, index int) []interface{}
Delete deletes an item from list
func FetchContent ¶
FetchContent fetch contents from arbitrary path
func GetConfig ¶
func GetConfig(key string, defaultValue interface{}) interface{}
GetConfig returns config by key.
func GetOpenstackClient ¶
func GetOpenstackClient(authURL, userName, password, domainName, tenantName, tenantID, version string) (*gophercloud.ServiceClient, error)
GetOpenstackClient makes openstack client
func GetTestServerURL ¶
GetTestServerURL returns URL of ts
func GohanLoadSchema ¶
GohanLoadSchema loads schema from path.
func GohanSchema ¶
GohanSchema returns gohan schema object by schemaID.
func GohanServer ¶
GohanServer starts gohan server from configFile
func HTTPDelete ¶
HTTPDelete deletes data using HTTP.
func HTTPPatch ¶
func HTTPPatch(url string, headers map[string]interface{}, postData map[string]interface{}) (map[string]interface{}, error)
HTTPPatch patches data using HTTP.
func HTTPPost ¶
func HTTPPost(url string, headers map[string]interface{}, postData map[string]interface{}) (map[string]interface{}, error)
HTTPPost posts data using HTTP.
func HTTPPut ¶
func HTTPPut(url string, headers map[string]interface{}, postData map[string]interface{}) (map[string]interface{}, error)
HTTPPut puts data using HTTP.
func HTTPRequest ¶
func HTTPRequest(url string, method string, headers map[string]interface{}, postData map[string]interface{}) (map[string]interface{}, error)
HTTPRequest request HTTP.
func MapSet ¶
func MapSet(m cmap.ConcurrentMap, key string, value interface{})
MapSet set value to map
func NormalizeMap ¶
NormalizeMap normalizes data which can't be used for standard yaml or json
func OpenstackDelete ¶
func OpenstackDelete(client *gophercloud.ServiceClient, url string) (interface{}, error)
OpenstackDelete deletes a resource using OpenStack API
func OpenstackEndpoint ¶
func OpenstackEndpoint(client *gophercloud.ServiceClient, endpointType, name, region, availability string) (interface{}, error)
OpenstackEndpoint returns API endpoint for each service name
func OpenstackEnsure ¶
func OpenstackEnsure(client *gophercloud.ServiceClient, url string, postURL string, data interface{}) (interface{}, error)
OpenstackEnsure keep resource status to sync
func OpenstackGet ¶
func OpenstackGet(client *gophercloud.ServiceClient, url string) (interface{}, error)
OpenstackGet gets a resource using OpenStack API
func OpenstackPost ¶
func OpenstackPost(client *gophercloud.ServiceClient, url string, data interface{}) (interface{}, error)
OpenstackPost posts a resource using OpenStack API
func OpenstackPut ¶
func OpenstackPut(client *gophercloud.ServiceClient, url string, data interface{}) (interface{}, error)
OpenstackPut puts a resource using OpenStack API
func OpenstackToken ¶
func OpenstackToken(client *gophercloud.ServiceClient) string
OpenstackToken get auth token from client
func SaveContent ¶
SaveContent saves data for path
func Shift ¶
func Shift(list []interface{}) (interface{}, []interface{})
Shift retrives first element and left
Types ¶
This section is empty.