internal

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-1.1 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event int

Event is an abstraction for session events.

const (
	// PeerTimeout indicates the session peer has become unresponsive.
	PeerTimeout Event = iota
	// NeedHeartbeat indicates the session should send a heartbeat.
	NeedHeartbeat
	// LogonTimeout indicates the peer has not sent a logon request.
	LogonTimeout
	// LogoutTimeout indicates the peer has not sent a logout request.
	LogoutTimeout
)

type EventTimer

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

func NewEventTimer added in v0.6.0

func NewEventTimer(task func()) *EventTimer

func (*EventTimer) Reset

func (t *EventTimer) Reset(timeout time.Duration)

func (*EventTimer) Stop

func (t *EventTimer) Stop()

type SessionSettings

type SessionSettings struct {
	ResetOnLogon                 bool
	RefreshOnLogon               bool
	ResetOnLogout                bool
	ResetOnDisconnect            bool
	HeartBtInt                   time.Duration
	HeartBtIntOverride           bool
	SessionTime                  *TimeRange
	InitiateLogon                bool
	ResendRequestChunkSize       int
	EnableLastMsgSeqNumProcessed bool
	SkipCheckLatency             bool
	MaxLatency                   time.Duration
	DisableMessagePersist        bool

	// Required on logon for FIX.T.1 messages.
	DefaultApplVerID string

	// Specific to initiators.
	ReconnectInterval    time.Duration
	LogoutTimeout        time.Duration
	LogonTimeout         time.Duration
	SocketConnectAddress []string
}

SessionSettings stores all of the configuration for a given session.

type TimeOfDay

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

TimeOfDay represents the time of day.

func NewTimeOfDay

func NewTimeOfDay(hour, minute, second int) TimeOfDay

NewTimeOfDay returns a newly initialized TimeOfDay.

func ParseTimeOfDay

func ParseTimeOfDay(str string) (TimeOfDay, error)

ParseTimeOfDay parses a TimeOfDay from a string in the format HH:MM:SS.

type TimeRange

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

TimeRange represents a time band in a given time zone.

func NewTimeRangeInLocation

func NewTimeRangeInLocation(start, end TimeOfDay, loc *time.Location) *TimeRange

NewTimeRangeInLocation returns a time range in a given location.

func NewUTCTimeRange

func NewUTCTimeRange(start, end TimeOfDay) *TimeRange

NewUTCTimeRange returns a time range in UTC.

func NewUTCWeekRange

func NewUTCWeekRange(startTime, endTime TimeOfDay, startDay, endDay time.Weekday) *TimeRange

NewUTCWeekRange returns a weekly TimeRange.

func NewWeekRangeInLocation

func NewWeekRangeInLocation(startTime, endTime TimeOfDay, startDay, endDay time.Weekday, loc *time.Location) *TimeRange

NewWeekRangeInLocation returns a time range in a given location.

func (*TimeRange) IsInRange

func (r *TimeRange) IsInRange(t time.Time) bool

IsInRange returns true if time t is within in the time range.

func (*TimeRange) IsInSameRange

func (r *TimeRange) IsInSameRange(t1, t2 time.Time) bool

IsInSameRange determines if two points in time are in the same time range.

Jump to

Keyboard shortcuts

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