api

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryParamFrom  = "dateFrom"
	QueryParamTo    = "dateTo"
	QueryParamMax   = "max"
	QueryParamType  = "type"
	EventMax        = "999999"
	EventDateLayout = "2006-01-02"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventRepresentation

type EventRepresentation struct {
	Time      int64             `json:"time,omitempty"`
	Type      *string           `json:"type,omitempty"`
	RealmID   *string           `json:"realmId,omitempty"`
	ClientID  *string           `json:"clientId,omitempty"`
	UserID    *string           `json:"userId,omitempty"`
	SessionID *string           `json:"sessionId,omitempty"`
	IPAddress *string           `json:"ipAddress,omitempty"`
	Details   map[string]string `json:"details,omitempty"`
}

EventRepresentation is a representation of an event

func (*EventRepresentation) GetDetail

func (r *EventRepresentation) GetDetail(key, defaultValue string) string

GetDetail returns value if given key exists in details. Returns defaultValue otherwise.

func (*EventRepresentation) HasDetail

func (r *EventRepresentation) HasDetail(key string) bool

HasDetail returns true if given key exists in details

func (*EventRepresentation) HasIdentity added in v1.0.1

func (r *EventRepresentation) HasIdentity() bool

func (*EventRepresentation) IsLogin added in v1.0.1

func (r *EventRepresentation) IsLogin() bool

type HubAPI

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

HubAPI is used to handle OAuth2 requests against core-events endpoint

func NewAPI

func NewAPI(clientID, clientSecret, tokenURL, contextURL string) (*HubAPI, error)

func (*HubAPI) QueryClientEvents

func (api *HubAPI) QueryClientEvents(params url.Values) ([]EventRepresentation, error)

QueryClientEvents builds and executes request from params

Jump to

Keyboard shortcuts

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