access

package
v0.0.0-...-c4f7e29 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Event

type Event struct {
	Timestamp time.Time `json:"time"`
	RemoteIP  string    `json:"ip,omitempty"`
	UserAgent string    `json:"user_agent,omitempty"`
}

func NewEvent

func NewEvent(timestamp time.Time, remoteIP httputil.RemoteIP, userAgentString httputil.UserAgentString) Event

type EventProvider

type EventProvider struct {
	Store EventStore
}

func (*EventProvider) InitStream

func (p *EventProvider) InitStream(sessionID string, initialAccess *Event) error

func (*EventProvider) RecordAccess

func (p *EventProvider) RecordAccess(sessionID string, event *Event) error

type EventStore

type EventStore interface {
	// AppendEvent appends an access event to the session event stream
	AppendEvent(sessionID string, e *Event) error
	// ResetEventStream resets a session event stream
	ResetEventStream(sessionID string) error
}

type EventStoreRedis

type EventStoreRedis struct {
	Redis *appredis.Handle
	AppID config.AppID
}

func (*EventStoreRedis) AppendEvent

func (s *EventStoreRedis) AppendEvent(sessionID string, event *Event) error

func (*EventStoreRedis) ResetEventStream

func (s *EventStoreRedis) ResetEventStream(sessionID string) error

type Info

type Info struct {
	InitialAccess Event `json:"initial_access"`
	LastAccess    Event `json:"last_access"`
}

Jump to

Keyboard shortcuts

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