ngsilib

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LogOff is ...
	LogOff = iota
	// LogErr is ...
	LogErr
	// LogWarn is ...
	LogWarn
	// LogInfo is ...
	LogInfo
	// LogDebug is ...
	LogDebug
	// LogTrace is ...
	LogTrace
)
View Source
const (
	CPasswordCredentials  = "password"
	CKeyrock              = "keyrock"
	CKeyrocktokenprovider = "keyrocktokenprovider"
	CTokenproxy           = "tokenproxy"
	CKeyrockIDM           = "idm"
	CThinkingCities       = "thinkingcities"
	CBasic                = "basic"
	CKeycloak             = "keycloak"
	CWSO2                 = "wso2"
	CKong                 = "kong"
	CApikey               = "apikey"
)

Variables

This section is empty.

Functions

func Contains

func Contains(a []string, e string) bool

Contains is ...

func GetApikeyHeader added in v0.9.0

func GetApikeyHeader(client *Client) (string, string)

func GetDateTime added in v0.10.0

func GetDateTime(dateTime string) (string, error)

GetDateTime

func GetExpirationDate

func GetExpirationDate(s string) (string, error)

GetExpirationDate is ...

func GetJSONArray added in v0.4.0

func GetJSONArray(b []byte, v interface{}) error

GetJSONArray is ...

func GetTime added in v0.10.0

func GetTime(ngsi *NGSI, v int64) string

GetTime

func HumanizeUptime added in v0.10.0

func HumanizeUptime(t int64) string

HumanizeUptime

func InitServerList added in v0.6.0

func InitServerList()

InitServerList is ...

func IsHTTP

func IsHTTP(url string) bool

IsHTTP is ...

func IsJSON

func IsJSON(b []byte) bool

IsJSON is ...

func IsJSONArray added in v0.5.0

func IsJSONArray(b []byte) bool

IsJSONArray is ...

func IsNameString

func IsNameString(s string) bool

IsNameString is ...

func IsNgsiLd added in v0.2.0

func IsNgsiLd(s string) bool

IsNgsiLd is ...

func IsNgsiV2 added in v0.2.0

func IsNgsiV2(s string) bool

IsNgsiV2 is ...

func IsOrionDateTime

func IsOrionDateTime(s string) bool

IsOrionDateTime is ...

func JSONMarshal

func JSONMarshal(v interface{}) ([]byte, error)

JSONMarshal is ...

func JSONMarshalDecode

func JSONMarshalDecode(v interface{}, safeString bool) ([]byte, error)

JSONMarshalDecode is ...

func JSONMarshalEncode

func JSONMarshalEncode(v interface{}, safeString bool) ([]byte, error)

JSONMarshalEncode is ...

func JSONSafeStringDecode

func JSONSafeStringDecode(data []byte) ([]byte, error)

JSONSafeStringDecode is ...

func JSONSafeStringEncode

func JSONSafeStringEncode(data []byte) ([]byte, error)

JSONSafeStringEncode is ...

func JSONUnmarshal

func JSONUnmarshal(data []byte, v interface{}) error

JSONUnmarshal is ...

func JSONUnmarshalDecode

func JSONUnmarshalDecode(data []byte, v interface{}, safeString bool) error

JSONUnmarshalDecode is ...

func JSONUnmarshalEncode

func JSONUnmarshalEncode(data []byte, v interface{}, safeString bool) error

JSONUnmarshalEncode is ...

func LogLevel

func LogLevel(s string) (int, error)

LogLevel is ...

func NewNetLib added in v0.10.0

func NewNetLib() *netLib

func ReadAll added in v0.10.0

func ReadAll(s string) (bytes []byte, err error)

func Reset

func Reset()

Reset is ...

func SafeStringDecode

func SafeStringDecode(s string) string

SafeStringDecode is ...

func SafeStringEncode

func SafeStringEncode(s string) string

SafeStringEncode is ...

Types

type Client

type Client struct {
	Server        *Server
	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
	Path          string
}

Client is

func (*Client) CheckScope

func (client *Client) CheckScope(scope string) error

CheckScope is ...

func (*Client) CheckTenant

func (client *Client) CheckTenant(tenant string) error

CheckTenant is ...

func (*Client) HTTPDelete

func (client *Client) HTTPDelete(body interface{}) (*http.Response, []byte, error)

HTTPDelete is

func (*Client) HTTPGet

func (client *Client) HTTPGet() (*http.Response, []byte, error)

HTTPGet is ...

func (*Client) HTTPPatch

func (client *Client) HTTPPatch(body interface{}) (*http.Response, []byte, error)

HTTPPatch is ...

func (*Client) HTTPPost

func (client *Client) HTTPPost(body interface{}) (*http.Response, []byte, error)

HTTPPost is ...

func (*Client) HTTPPut

func (client *Client) HTTPPut(body interface{}) (*http.Response, []byte, error)

HTTPPut is ...

func (*Client) InitHeader

func (client *Client) InitHeader() error

InitHeader is ...

func (*Client) IsNgsiLd

func (client *Client) IsNgsiLd() bool

IsNgsiLd is

func (*Client) IsNgsiV2

func (client *Client) IsNgsiV2() bool

IsNgsiV2 is

func (*Client) IsSafeString

func (client *Client) IsSafeString() bool

IsSafeString is ...

func (*Client) OpUpdate

func (client *Client) OpUpdate(entities interface{}, actionType string, keyValues bool, safeString bool) (*http.Response, []byte, error)

OpUpdate is ...

func (*Client) RemoveHeader

func (client *Client) RemoveHeader(key string)

RemoveHeader is ...

func (*Client) ResultsCount

func (client *Client) ResultsCount(res *http.Response) (int, error)

ResultsCount is ...

func (*Client) SetAcceptGeoJSON added in v0.8.0

func (client *Client) SetAcceptGeoJSON()

SetAcceptGeoJSON is ...

func (*Client) SetAcceptJSON added in v0.5.0

func (client *Client) SetAcceptJSON()

SetAcceptJSON is ...

func (*Client) SetContentJSON added in v0.7.0

func (client *Client) SetContentJSON()

SetContentJSON is ...

func (*Client) SetContentLdJSON added in v0.8.0

func (client *Client) SetContentLdJSON()

SetContentLdJSON is ...

func (*Client) SetContentType

func (client *Client) SetContentType()

SetContentType is ...

func (*Client) SetHeader

func (client *Client) SetHeader(key string, value string)

SetHeader is ...

func (*Client) SetHeaders

func (client *Client) SetHeaders(headers map[string]string)

SetHeaders is ...

func (*Client) SetPath

func (client *Client) SetPath(urlPath string)

SetPath is ...

func (*Client) SetQuery

func (client *Client) SetQuery(values *url.Values)

SetQuery is ...

type CmdFlags

type CmdFlags struct {
	Token      *string
	Tenant     *string
	Scope      *string
	SafeString *string
	XAuthToken bool
	Link       *string
}

CmdFlags is ...

type ContextsInfo

type ContextsInfo map[string]interface{}

ContextsInfo is ...

type EntitiesRespose added in v0.10.0

type EntitiesRespose []map[string]interface{}

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() bufio.Reader
}

FileLib is ...

func GetReader added in v0.10.0

func GetReader(s string) (FileLib, error)

type FilePathLib added in v0.9.0

type FilePathLib interface {
	FilePathAbs(path string) (string, error)
	FilePathJoin(elem ...string) string
	FilePathBase(path string) string
}

FilePathLib is ...

type GetReaderFunc added in v0.10.0

type GetReaderFunc func(s string) (FileLib, error)

type HTTPRequest

type HTTPRequest interface {
	Request(method string, url *url.URL, headers map[string]string, body interface{}) (*http.Response, []byte, error)
}

HTTPRequest is ...

func NewHTTPRequet

func NewHTTPRequet() HTTPRequest

NewHTTPRequet is ...

type IdmParams added in v0.9.0

type IdmParams struct {
	IdmType        string
	IdmHost        string
	Username       string
	Password       string
	ClientID       string
	ClientSecret   string
	HeaderName     string
	HeaderValue    string
	HeaderEnvValue string
	TokenScope     string
}

IdmParam 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 IoutilLib added in v0.9.0

type IoutilLib interface {
	Copy(dst io.Writer, src io.Reader) (int64, error)
	ReadFull(r io.Reader, buf []byte) (n int, err error)
	WriteFile(filename string, data []byte, perm os.FileMode) error
	ReadFile(filename string) ([]byte, error)
}

IoutilLib is ...

type JSONLib

type JSONLib interface {
	Decode(r io.Reader, v interface{}) error
	Encode(w io.Writer, v interface{}) error
	Indent(dst *bytes.Buffer, src []byte, prefix, indent string) error
	Valid(data []byte) bool
}

JSONLib is

type JsonBuffer added in v0.10.0

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

func NewJsonBuffer added in v0.10.0

func NewJsonBuffer() *JsonBuffer

func (*JsonBuffer) BufferClose added in v0.10.0

func (j *JsonBuffer) BufferClose()

func (*JsonBuffer) BufferOpen added in v0.10.0

func (j *JsonBuffer) BufferOpen(w io.Writer, geoJSON, pretty bool)

func (*JsonBuffer) BufferWrite added in v0.10.0

func (j *JsonBuffer) BufferWrite(b []byte)

type KeyStoneToken added in v0.8.1

type KeyStoneToken struct {
	Token struct {
		Domain struct {
			ID   string `json:"id"`
			Name string `json:"name"`
		} `json:"domain"`
		Methods   []string          `json:"methods"`
		Roles     []keyStoneRole    `json:"roles"`
		ExpiresAt string            `json:"expires_at"`
		Catalog   []keyStoneCatalog `json:"catalog"`
		Extras    struct {
			PasswordCreationTime   string `json:"password_creation_time"`
			LastLoginAttemptTime   string `json:"last_login_attempt_time"`
			PwdUserInBlacklist     bool   `json:"pwd_user_in_blacklist"`
			PasswordExpirationTime string `json:"password_expiration_time"`
		} `json:"extras"`
		User struct {
			PasswordExpiresAt string `json:"password_expires_at"`
			Domain            struct {
				ID   string `json:"id"`
				Name string `json:"name"`
			} `json:"domain"`
			ID   string `json:"id"`
			Name string `json:"name"`
		} `json:"user"`
		AuditIds []string `json:"audit_ids"`
		IssuedAt string   `json:"issued_at"`
	} `json:"token"`
}

KeyStoneToken is ...

type KeycloakToken added in v0.9.0

type KeycloakToken struct {
	AccessToken      string `json:"access_token"`
	ExpiresIn        int    `json:"expires_in"`
	RefreshExpiresIn int    `json:"refresh_expires_in"`
	RefreshToken     string `json:"refresh_token"`
	TokenType        string `json:"token_type"`
	IDToken          string `json:"id_token"`
	NotBeforePolicy  int    `json:"not-before-policy"`
	SessionState     string `json:"session_state"`
	Scope            string `json:"scope"`
}

type KeyrockIDMToken added in v0.9.0

type KeyrockIDMToken struct {
	Token struct {
		Methods   []string `json:"methods"`
		ExpiresAt string   `json:"expires_at"`
	} `json:"token"`
	IdmAuthorizationConfig struct {
		Level      string `json:"level"`
		Authzforce bool   `json:"authzforce"`
	} `json:"idm_authorization_config"`
}

KeyrockToken is ...

type KeyrockToken added in v0.7.0

type KeyrockToken struct {
	AccessToken  string   `json:"access_token"`
	ExpiresIn    int64    `json:"expires_in"`
	RefreshToken string   `json:"refresh_token"`
	Scope        []string `json:"scope"`
	TokenType    string   `json:"token_type"`
}

KeyrockToken is ...

type KongToken added in v0.9.0

type KongToken struct {
	ExpiresIn   int64  `json:"expires_in"`
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
}

KongToken is ...

type LogWriter

type LogWriter struct {
	Writer   io.Writer
	LogLevel int
}

LogWriter is ...

func (*LogWriter) Write

func (w *LogWriter) Write(p []byte) (n int, err error)

type MultiPart added in v0.9.0

type MultiPart interface {
	NewWriter(w io.Writer) MultiPartLib
}

MultiPart is ...

type MultiPartLib added in v0.9.0

type MultiPartLib interface {
	CreatePart(header textproto.MIMEHeader) (io.Writer, error)
	FormDataContentType() string
	Close() error
}

MultiPartLib is ...

type NGSI

type NGSI struct {
	ServerList ServerList

	ConfigDir     *string
	ConfigFile    IoLib
	CacheFile     IoLib
	StdReader     io.Reader
	StdWriter     io.Writer
	LogWriter     io.Writer
	FileReader    FileLib
	JSONConverter JSONLib
	FilePath      FilePathLib
	Ioutil        IoutilLib
	ZipLib        ZipLib
	SyslogLib     SyslogLib
	TimeLib       TimeLib
	MultiPart     MultiPart
	ReadAll       ReadAllFunc
	GetReader     GetReaderFunc
	HTTP          HTTPRequest
	NetLib        NetLib

	Host               string
	Destination        string
	LogLevel           int
	Margin             int64
	Maxsize            int64
	Timeout            time.Duration
	PreviousArgs       *Settings
	Updated            bool
	Stderr             io.Writer
	OsType             string
	BatchFlag          *bool
	InsecureSkipVerify bool
	// contains filtered or unexported fields
}

NGSI is ...

func NewNGSI

func NewNGSI() *NGSI

NewNGSI is ...

func (*NGSI) AddContext

func (ngsi *NGSI) AddContext(key string, value string) error

AddContext is ...

func (*NGSI) AllServersList added in v0.6.0

func (ngsi *NGSI) AllServersList() *ServerList

AllServersList is ...

func (*NGSI) BoolFlag

func (ngsi *NGSI) BoolFlag(s string) (bool, error)

BoolFlag is ...

func (*NGSI) BrokerTypeArgs added in v0.7.0

func (ngsi *NGSI) BrokerTypeArgs() []string

BrokerTypeArgs is ...

func (*NGSI) Close

func (ngsi *NGSI) Close()

Close is ...

func (*NGSI) CreateServer added in v0.6.0

func (ngsi *NGSI) CreateServer(name string, brokerParam map[string]string) error

CreateServer is ...

func (*NGSI) DeleteContext

func (ngsi *NGSI) DeleteContext(key string) error

DeleteContext is ...

func (*NGSI) DeleteItem

func (ngsi *NGSI) DeleteItem(host string, item string) error

DeleteItem is ...

func (*NGSI) DeleteServer added in v0.6.0

func (ngsi *NGSI) DeleteServer(host string) error

DeleteServer is ...

func (*NGSI) ExistsBrokerHost

func (ngsi *NGSI) ExistsBrokerHost(host string) bool

ExistsBrokerHost is ...

func (*NGSI) GetAtContext added in v0.10.0

func (ngsi *NGSI) GetAtContext(context string) (interface{}, error)

func (*NGSI) GetAuthHeader added in v0.9.0

func (ngsi *NGSI) GetAuthHeader(client *Client) (string, string, error)

GetAuthHeader is ...

func (*NGSI) GetContext

func (ngsi *NGSI) GetContext(key string) (string, error)

GetContext is ...

func (*NGSI) GetContextHTTP added in v0.5.0

func (ngsi *NGSI) GetContextHTTP(key string) (string, error)

GetContextHTTP is ...

func (*NGSI) GetContextList

func (ngsi *NGSI) GetContextList() ContextsInfo

GetContextList is ...

func (*NGSI) GetPreviousArgs

func (ngsi *NGSI) GetPreviousArgs() *Settings

GetPreviousArgs is ...

func (*NGSI) GetServerInfo added in v0.10.0

func (ngsi *NGSI) GetServerInfo(host string, skipRefHost bool) (*Server, error)

func (*NGSI) GetToken

func (ngsi *NGSI) GetToken(client *Client) (string, error)

GetToken is ...

func (*NGSI) GetTokenInfo added in v0.9.0

func (ngsi *NGSI) GetTokenInfo(tokenInfo *TokenInfo) ([]byte, error)

func (*NGSI) InitConfig

func (ngsi *NGSI) InitConfig(file *string) error

InitConfig is ...

func (*NGSI) InitLog

func (ngsi *NGSI) InitLog(stdin io.Reader, stdout, stderr io.Writer) *NGSI

InitLog is ...

func (*NGSI) InitTokenMgr

func (ngsi *NGSI) InitTokenMgr(file *string) error

InitTokenMgr is ..

func (*NGSI) InsertAtContext added in v0.10.0

func (ngsi *NGSI) InsertAtContext(payload []byte, context string) (b []byte, err error)

func (*NGSI) IsContextReferenced

func (ngsi *NGSI) IsContextReferenced(context string) error

IsContextReferenced is ...

func (*NGSI) IsHostReferenced

func (ngsi *NGSI) IsHostReferenced(host string) error

IsHostReferenced is ...

func (*NGSI) Logging

func (ngsi *NGSI) Logging(level int, s string)

Logging is ...

func (*NGSI) NewClient

func (ngsi *NGSI) NewClient(name string, cmdFlags *CmdFlags, isHTTPVerb bool, skipGetToken bool) (client *Client, err error)

NewClient is ...

func (*NGSI) RevokeToken added in v0.9.0

func (ngsi *NGSI) RevokeToken(client *Client) error

RevokeToken is ...

func (*NGSI) SavePreviousArgs

func (ngsi *NGSI) SavePreviousArgs() error

SavePreviousArgs is ...

func (*NGSI) ServerInfoArgs

func (ngsi *NGSI) ServerInfoArgs() []string

ServerInfoArgs is ...

func (*NGSI) ServerTypeArgs added in v0.6.0

func (ngsi *NGSI) ServerTypeArgs() []string

ServerTypeArgs is ...

func (*NGSI) StdoutFlush added in v0.8.0

func (ngsi *NGSI) StdoutFlush()

StdoutFlush is ...

func (*NGSI) TokenInfo

func (ngsi *NGSI) TokenInfo(client *Client) (*TokenInfo, error)

TokenInfo is ...

func (*NGSI) TokenList

func (ngsi *NGSI) TokenList() string

TokenList is ...

func (*NGSI) UpdateContext

func (ngsi *NGSI) UpdateContext(key string, value string) error

UpdateContext is ...

func (*NGSI) UpdateServer added in v0.6.0

func (ngsi *NGSI) UpdateServer(host string, brokerParam map[string]string) error

UpdateServer is ...

type NetLib added in v0.10.0

type NetLib interface {
	InterfaceAddrs() ([]net.Addr, error)
	ListenAndServe(addr string, handler http.Handler) error
	ListenAndServeTLS(addr, certFile, keyFile string, handler http.Handler) error
}

NetLib is ...

type NgsiConfig

type NgsiConfig struct {
	Version           string       `json:"version"`
	DefaultValues     Settings     `json:"settings"`
	DeprecatedBrokers ServerList   `json:"brokers,omitempty"`
	Servers           ServerList   `json:"servers"`
	Contexts          ContextsInfo `json:"contexts"`
}

NgsiConfig is ...

type NgsiEntities added in v0.10.0

type NgsiEntities []NgsiEntity

type NgsiEntity added in v0.10.0

type NgsiEntity map[string]interface{}

type OAuthToken added in v0.9.0

type OAuthToken struct {
	AccessToken  string   `json:"access_token"`
	ExpiresIn    int64    `json:"expires_in"`
	RefreshToken string   `json:"refresh_token"`
	Scope        []string `json:"scope"`
	TokenType    string   `json:"token_type"`
}

OauthToken is ...

type Option added in v0.10.0

type Option struct {
	Name        string
	Description string
}

type ReadAllFunc added in v0.10.0

type ReadAllFunc func(s string) (bytes []byte, err error)

type Server added in v0.6.0

type Server struct {
	ServerType           string `json:"serverType,omitempty"`
	DeprecatedBrokerHost string `json:"brokerHost,omitempty"`
	ServerHost           string `json:"serverHost,omitempty"`
	BrokerType           string `json:"brokerType,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"`
	HeaderName           string `json:"headerName,omitempty"`
	HeaderValue          string `json:"headerValue,omitempty"`
	HeaderEnvValue       string `json:"headerEnvValue,omitempty"`
	TokenScope           string `json:"tokenScope,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"`
}

Server is

type ServerList added in v0.6.0

type ServerList map[string]*Server

ServerList is ...

func (*ServerList) BrokerInfo added in v0.6.0

func (info *ServerList) BrokerInfo(name string) (*Server, error)

BrokerInfo is ...

func (*ServerList) BrokerInfoJSON added in v0.6.0

func (info *ServerList) BrokerInfoJSON(name string) (*string, error)

BrokerInfoJSON is ...

func (*ServerList) BrokerList added in v0.6.0

func (info *ServerList) BrokerList() ServerList

BrokerList is ...

func (*ServerList) List added in v0.6.0

func (info *ServerList) List(singleLine bool) string

List is ...

func (*ServerList) ServerInfo added in v0.6.0

func (info *ServerList) ServerInfo(name, filter string) (*Server, error)

ServerInfo is ...

func (*ServerList) ServerInfoJSON added in v0.6.0

func (info *ServerList) ServerInfoJSON(name, filter string) (*string, error)

ServerInfoJSON is ...

func (*ServerList) ServerList added in v0.6.0

func (info *ServerList) ServerList(filter string, all bool) ServerList

ServerList is ...

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

type SyslogLib

type SyslogLib interface {
	New() (io.Writer, error)
}

SyslogLib is ...

type TimeLib

type TimeLib interface {
	Now() time.Time
	NowUnix() int64
	Unix(sec int64, nsec int64) time.Time
	Format(layout string) string
}

TimeLib is ...

type TokenInfo

type TokenInfo struct {
	Type          string           `json:"type"`
	Token         string           `json:"token"`
	RefreshToken  string           `json:"refresh_token"`
	Expires       time.Time        `json:"expires"`
	OAuth         *OAuthToken      `json:"oauth,omitempty"`
	KeyrockIDM    *KeyrockIDMToken `json:"keyrock_idm,omitempty"`
	Keyrock       *KeyrockToken    `json:"keyrock,omitempty"`
	TokenProxy    *TokenProxy      `json:"tokenproxy,omitempty"`
	TokenProvider *TokenProvider   `json:"tokenprovider,omitempty"`
	Keystone      *KeyStoneToken   `json:"keystone,omitempty"`
	Keycloak      *KeycloakToken   `json:"keycloak,omitempty"`
	WSO2          *WSO2Token       `json:"wso2,omitempty"`
	Kong          *KongToken       `json:"kong,omitempty"`
}

TokenInfo is ...

type TokenPlugin added in v0.9.0

type TokenPlugin interface {
	// contains filtered or unexported methods
}

TokenPlugin interface

TokenPlugin is ...

type TokenProvider added in v0.9.0

type TokenProvider struct {
	AccessToken string `json:"access_token"`
}

TokenProvider is ...

type TokenProxy added in v0.9.0

type TokenProxy struct {
	AccessToken  string   `json:"access_token"`
	ExpiresIn    int64    `json:"expires_in"`
	RefreshToken string   `json:"refresh_token"`
	Scope        []string `json:"scope"`
	TokenType    string   `json:"token_type"`
}

Token proxy is a proxy for Keyrock TokenProxy is ...

type V1ContextElement added in v0.10.0

type V1ContextElement map[string]interface{}

type V1Request added in v0.10.0

type V1Request struct {
	ContextElements []V1ContextElement `json:"contextElements"`
	UpdateAction    string             `json:"updateAction"`
}

type V1Response added in v0.10.0

type V1Response struct {
	ContextResponses []struct {
		ContextElement V1ContextElement `json:"contextElement"`
		StatusCode     struct {
			Code         string `json:"code"`
			ReasonPhrase string `json:"reasonPhrase"`
		} `json:"statusCode"`
	} `json:"contextResponses"`
	ErrorCode struct {
		Code         string `json:"code"`
		ReasonPhrase string `json:"reasonPhrase"`
		Details      string `json:"details"`
	} `json:"errorCode"`
}

type WSO2Token added in v0.9.0

type WSO2Token struct {
	AccessToken  string      `json:"access_token"`
	ExpiresIn    int64       `json:"expires_in"`
	RefreshToken string      `json:"refresh_token"`
	Scope        interface{} `json:"scope"`
	TokenType    string      `json:"token_type"`
}

WSO2Token is ...

type ZipLib added in v0.9.0

type ZipLib interface {
	NewReader(r io.ReaderAt, size int64) (*zip.Reader, error)
}

ZipLib is ...

Jump to

Keyboard shortcuts

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