session

package
v0.0.0-...-9572309 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ExpirationDelta = 5 * time.Minute

Variables

This section is empty.

Functions

This section is empty.

Types

type Assets

type Assets struct {
	AvatarImage         string
	AvatarImageOriginal string

	RpmModelUri         string
	RpmImageUriPortrait string
	RpmImageUriPosture  string
}

type Character

type Character struct {
	Id           string
	ResourceName string
	DisplayName  string
	Assets       *Assets
}

type Connection

type Connection struct {
	OnDisconnect func()
	OnError      func(err error) // maybe make it so all errors go to this function
	OnMessage    func(packet *goinworld.InworldPacket)
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection() *Connection

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) GenerateSessionToken

func (c *Connection) GenerateSessionToken(ctx context.Context) (*Token, error)

func (*Connection) GetCharactersList

func (c *Connection) GetCharactersList(ctx context.Context) ([]*Character, error)

func (*Connection) IsActive

func (c *Connection) IsActive() bool

func (*Connection) IsAutoReconnect

func (c *Connection) IsAutoReconnect() bool

func (*Connection) Open

func (c *Connection) Open(ctx context.Context) error

func (*Connection) SendAudio

func (c *Connection) SendAudio(chunk []byte) error

func (*Connection) SendText

func (c *Connection) SendText(text string) error

func (*Connection) SendTrigger

func (c *Connection) SendTrigger(name string, parameters ...goinworld.TriggerParameter) error

func (*Connection) SetCurrentCharacter

func (c *Connection) SetCurrentCharacter(characterId string)

SetCurrentCharacter sets which character you are currently talking to

type Scene

type Scene struct {
	Key        string
	Characters []*Character
}

type Token

type Token struct {
	Token          string
	Type           string
	ExpirationTime time.Time
	SessionId      string
}

func (*Token) Equal

func (s *Token) Equal(o *Token) bool

func (*Token) IsExpired

func (s *Token) IsExpired() bool

Jump to

Keyboard shortcuts

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