koiclient

package module
v0.0.0-...-14a6481 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2019 License: MIT Imports: 7 Imported by: 0

README

KOI GO CLIENT

Build Status codecov Go Report Card

A golang client for KOI.

CONTRIBUTORS

Faris

LICENSE

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ICreate

type ICreate interface {
	SetSchema(schema string) ICreate
	GetSchema() string
	SetValue(value map[string]interface{}) ICreate
	GetValue() map[string]interface{}
	ToJSON() ([]byte, error)
}

ICreate represents create command for koi client

func NewCreate

func NewCreate() ICreate

NewCreate initiates create feature

type IDelete

type IDelete interface {
	SetSchema(schema string) IDelete
	GetSchema() string
	SetQuery(query map[string]interface{}) IDelete
	GetQuery() map[string]interface{}
	ToJSON() ([]byte, error)
}

IDelete represents delete command for koi client

func NewDelete

func NewDelete() IDelete

NewDelete initiates delete feature

type IKoiClient

type IKoiClient interface {
	SetAPIUrl(url string) IKoiClient
	SetParams(param interface{}) IKoiClient
	Exec() ([]byte, error)
}

IKoiClient represents available method for koi client

func New

func New(apiKey string) IKoiClient

New initiates koi client

type IRead

type IRead interface {
	SetSchema(schema string) IRead
	GetSchema() string
	SetAs(resultAs string) IRead
	GetAs() string
	SetField(fields []string) IRead
	GetField() []string
	SetQuery(query map[string]interface{}) IRead
	GetQuery() map[string]interface{}
	SetLimit(limit int64) IRead
	GetLimit() int64
	SetOffset(offset int64) IRead
	GetOffset() int64
	SetOrderBy(orderBy []map[string]interface{}) IRead
	GetOrderBy() []map[string]interface{}
	ToJSON() ([]byte, error)
}

IRead represents read command for koi client

func NewRead

func NewRead() IRead

NewRead initiates read feature

type IResult

type IResult interface {
	Status() string
	Data() interface{}
	DataAsList() []interface{}
}

IResult represents interface for result

func NewResult

func NewResult(resp []byte) (IResult, error)

NewResult initiates result object

type IUpdate

type IUpdate interface {
	SetSchema(schema string) IUpdate
	GetSchema() string
	SetQuery(query map[string]interface{}) IUpdate
	GetQuery() map[string]interface{}
	SetValue(value map[string]interface{}) IUpdate
	GetValue() map[string]interface{}
	ToJSON() ([]byte, error)
}

IUpdate represents update command for koi client

func NewUpdate

func NewUpdate() IUpdate

NewUpdate initiates update feature

Jump to

Keyboard shortcuts

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