Documentation ¶
Index ¶
- Constants
- func Contains(a []string, e string) bool
- func GetExpirationDate(s string) (string, error)
- func GetJSONArray(b []byte, v interface{}) error
- func InitBrokerList()
- func IsHTTP(url string) bool
- func IsJSON(b []byte) bool
- func IsNameString(s string) bool
- func IsNgsiLd(s string) bool
- func IsNgsiV2(s string) bool
- func IsOrionDateTime(s string) bool
- func JSONMarshal(v interface{}) ([]byte, error)
- func JSONMarshalDecode(v interface{}, safeString bool) ([]byte, error)
- func JSONMarshalEncode(v interface{}, safeString bool) ([]byte, error)
- func JSONSafeStringDecode(data []byte) ([]byte, error)
- func JSONSafeStringEncode(data []byte) ([]byte, error)
- func JSONUnmarshal(data []byte, v interface{}) error
- func JSONUnmarshalDecode(data []byte, v interface{}, safeString bool) error
- func JSONUnmarshalEncode(data []byte, v interface{}, safeString bool) error
- func LogLevel(s string) (int, error)
- func Reset()
- func SafeStringDecode(s string) string
- func SafeStringEncode(s string) string
- type Broker
- type BrokerList
- type Client
- func (client *Client) CheckScope(scope string) error
- func (client *Client) CheckTenant(tenant string) error
- func (client *Client) HTTPDelete() (*http.Response, []byte, error)
- func (client *Client) HTTPGet() (*http.Response, []byte, error)
- func (client *Client) HTTPPatch(body interface{}) (*http.Response, []byte, error)
- func (client *Client) HTTPPost(body interface{}) (*http.Response, []byte, error)
- func (client *Client) HTTPPut(body interface{}) (*http.Response, []byte, error)
- func (client *Client) InitHeader() error
- func (client *Client) IsNgsiLd() bool
- func (client *Client) IsNgsiV2() bool
- func (client *Client) IsSafeString() bool
- func (client *Client) OpUpdate(entities interface{}, actionType string, keyValues bool, safeString bool) (*http.Response, []byte, error)
- func (client *Client) RemoveHeader(key string)
- func (client *Client) ResultsCount(res *http.Response) (int, error)
- func (client *Client) SetContentType()
- func (client *Client) SetHeader(key string, value string)
- func (client *Client) SetHeaders(headers map[string]string)
- func (client *Client) SetPath(path string)
- func (client *Client) SetQuery(values *url.Values)
- type CmdFlags
- type ContextsInfo
- type FileLib
- type HTTPRequest
- type IoLib
- type JSONLib
- type LogWriter
- type NGSI
- func (ngsi *NGSI) AddContext(key string, value string) error
- func (ngsi *NGSI) BoolFlag(s string) (bool, error)
- func (ngsi *NGSI) BrokerList() *BrokerList
- func (ngsi *NGSI) Close()
- func (ngsi *NGSI) CreateBroker(name string, brokerParam map[string]string) error
- func (ngsi *NGSI) DeleteBroker(host string) error
- func (ngsi *NGSI) DeleteContext(key string) error
- func (ngsi *NGSI) DeleteItem(host string, item string) error
- func (ngsi *NGSI) ExistsBrokerHost(host string) bool
- func (ngsi *NGSI) GetContext(key string) (string, error)
- func (ngsi *NGSI) GetContextList() ContextsInfo
- func (ngsi *NGSI) GetPreviousArgs() *Settings
- func (ngsi *NGSI) GetToken(client *Client) (string, error)
- func (ngsi *NGSI) InitConfig(file *string) error
- func (ngsi *NGSI) InitLog(stdin io.Reader, stdout, stderr io.Writer) *NGSI
- func (ngsi *NGSI) InitTokenMgr(file *string) error
- func (ngsi *NGSI) IsContextReferenced(context string) error
- func (ngsi *NGSI) IsHostReferenced(host string) error
- func (ngsi *NGSI) Logging(level int, s string) (n int, err error)
- func (ngsi *NGSI) NewClient(name string, cmdFlags *CmdFlags, isHTTPVerb bool) (client *Client, err error)
- func (ngsi *NGSI) SavePreviousArgs() error
- func (ngsi *NGSI) ServerInfoArgs() []string
- func (ngsi *NGSI) TokenInfo(client *Client) (*TokenInfo, error)
- func (ngsi *NGSI) TokenList() string
- func (ngsi *NGSI) UpdateBroker(host string, brokerParam map[string]string) error
- func (ngsi *NGSI) UpdateContext(key string, value string) error
- type NgsiConfig
- type NgsiLibError
- type Settings
- type SyslogLib
- type TimeLib
- type Token
- type TokenInfo
Constants ¶
View Source
const ( // LogOff is ... LogOff = iota // LogErr is ... LogErr // LogWarn is ... LogWarn // LogInfo is ... LogInfo // LogDebug is ... LogDebug // LogTrace is ... LogTrace )
Variables ¶
This section is empty.
Functions ¶
func JSONMarshalDecode ¶
JSONMarshalDecode is ...
func JSONMarshalEncode ¶
JSONMarshalEncode is ...
func JSONSafeStringDecode ¶
JSONSafeStringDecode is ...
func JSONSafeStringEncode ¶
JSONSafeStringEncode is ...
func JSONUnmarshalDecode ¶
JSONUnmarshalDecode is ...
func JSONUnmarshalEncode ¶
JSONUnmarshalEncode is ...
Types ¶
type Broker ¶
type Broker struct { BrokerHost string `json:"brokerHost,omitempty"` NgsiType string `json:"ngsiType,omitempty"` APIPath string `json:"apiPath,omitempty"` IdmType string `json:"idmType,omitempty"` IdmHost string `json:"idmHost,omitempty"` Token string `json:"token,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` ClientID string `json:"clientId,omitempty"` ClientSecret string `json:"clientSecret,omitempty"` Context string `json:"context,omitempty"` Tenant string `json:"tenant,omitempty"` Scope string `json:"scope,omitempty"` SafeString string `json:"safeString,omitempty"` XAuthToken string `json:"xAuthToken,omitempty"` }
Broker is
type BrokerList ¶
BrokerList is ...
func (*BrokerList) BrokerInfo ¶
func (info *BrokerList) BrokerInfo(name string) (*Broker, error)
BrokerInfo is ...
func (*BrokerList) BrokerInfoJSON ¶
func (info *BrokerList) BrokerInfoJSON(name string) (*string, error)
BrokerInfoJSON is ...
type Client ¶
type Client struct { Broker *Broker URL *url.URL Headers map[string]string Token string Tenant string Scope string APIPathBefore string APIPathAfter string NgsiType int SafeString bool XAuthToken bool Link *string HTTP HTTPRequest }
Client is
func (*Client) CheckTenant ¶
CheckTenant is ...
func (*Client) HTTPDelete ¶
HTTPDelete is
func (*Client) OpUpdate ¶
func (client *Client) OpUpdate(entities interface{}, actionType string, keyValues bool, safeString bool) (*http.Response, []byte, error)
OpUpdate is ...
func (*Client) ResultsCount ¶
ResultsCount is ...
func (*Client) SetHeaders ¶
SetHeaders is ...
type CmdFlags ¶
type CmdFlags struct { Token *string Tenant *string Scope *string SafeString *string XAuthToken bool Link *string }
CmdFlags is ...
type FileLib ¶
type FileLib interface { Open(path string) error Close() error FilePathAbs(path string) (string, error) ReadAll(r io.Reader) ([]byte, error) ReadFile(filename string) ([]byte, error) SetReader(r io.Reader) File() io.Reader }
FileLib is ...
type HTTPRequest ¶
type HTTPRequest interface {
Request(method string, url *url.URL, headers map[string]string, body interface{}) (*http.Response, []byte, error)
}
HTTPRequest is ...
type IoLib ¶
type IoLib interface { Open() error OpenFile(flag int, perm os.FileMode) error Truncate(size int64) error Close() error Decode(v interface{}) error Encode(v interface{}) error MkdirAll(path string, perm os.FileMode) error Stat(name string) (os.FileInfo, error) UserConfigDir() (string, error) UserHomeDir() (string, error) SetFileName(filename *string) FileName() *string Getenv(key string) string FilePathAbs(path string) (string, error) FilePathJoin(elem ...string) string }
IoLib is ...
type JSONLib ¶
type JSONLib interface { Decode(r io.Reader, v interface{}) error Encode(w io.Writer, v interface{}) error }
JSONLib is
type NGSI ¶
type NGSI struct { LogLevel int ConfigFile IoLib CacheFile IoLib StdReader io.Reader StdWriter io.Writer LogWriter io.Writer FileReader FileLib JSONConverter JSONLib Host string Destination string Margin int64 Maxsize int Timeout time.Duration PreviousArgs *Settings Updated bool HTTP HTTPRequest Stderr *os.File OsType string SyslogLib SyslogLib TimeLib TimeLib BatchFlag *bool // contains filtered or unexported fields }
NGSI is ...
func (*NGSI) AddContext ¶
AddContext is ...
func (*NGSI) CreateBroker ¶
CreateBroker is ...
func (*NGSI) DeleteItem ¶
DeleteItem is ...
func (*NGSI) ExistsBrokerHost ¶
ExistsBrokerHost is ...
func (*NGSI) GetContext ¶
GetContext is ...
func (*NGSI) IsContextReferenced ¶
IsContextReferenced is ...
func (*NGSI) IsHostReferenced ¶
IsHostReferenced is ...
func (*NGSI) NewClient ¶
func (ngsi *NGSI) NewClient(name string, cmdFlags *CmdFlags, isHTTPVerb bool) (client *Client, err error)
NewClient is ...
func (*NGSI) UpdateBroker ¶
UpdateBroker is ...
type NgsiConfig ¶
type NgsiConfig struct { DefaultValues Settings `json:"settings"` Brokers BrokerList `json:"brokers"` Contexts ContextsInfo `json:"contexts"` }
NgsiConfig is ...
type NgsiLibError ¶
NgsiLibError is ...
func (*NgsiLibError) Error ¶
func (e *NgsiLibError) Error() string
func (*NgsiLibError) String ¶
func (e *NgsiLibError) String() string
func (*NgsiLibError) Unwrap ¶
func (e *NgsiLibError) Unwrap() error
type Settings ¶
type Settings struct { UsePreviousArgs bool `json:"usePreviousArgs"` Syslog string `json:"syslog"` Stderr string `json:"stderr"` Logfile string `json:"logfile"` Loglevel string `json:"loglevel"` CacheFile string `json:"cachefile"` Host string `json:"host"` Tenant string `json:"tenant"` Scope string `json:"scope"` Token string `json:"token"` }
Settings is ...
Click to show internal directories.
Click to hide internal directories.