types

package
v0.0.0-...-61a7490 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// mu             sync.RWMutex
	FriendRequests map[uuid.UUID]*pb.FriendRequest
	CurrentChat    ChatSession
}

type ChatSession

type ChatSession struct {
	User         User
	SharedSecret []byte
	EncKey       []byte
	HmacKey      []byte
}

type Client

type Client struct {
	Identity *ClientIdentity
	State    *ClientState
	PBC      pb.StrikeClient
	DB       *ClientDB
}

type ClientDB

type ClientDB struct {
	Friends struct {
		SaveUserDetails *sql.Stmt
		GetUserId       *sql.Stmt
		GetUser         *sql.Stmt
		GetFriends      *sql.Stmt
		GetKeyEx        *sql.Stmt
		ConfirmKeyEx    *sql.Stmt
	}

	ID struct {
		GetID  *sql.Stmt
		GetUID *sql.Stmt
		SaveID *sql.Stmt
	}

	Messages struct {
		SaveMessage *sql.Stmt
		GetMessages *sql.Stmt
	}

	FriendRequest struct {
		SaveFriendRequest   *sql.Stmt
		GetFriendRequests   *sql.Stmt
		DeleteFriendRequest *sql.Stmt
	}
}

Prepared statemnt groups

type ClientIdentity

type ClientIdentity struct {
	Username string
	ID       uuid.UUID
	Keys     map[string][]byte
	Config   *config.ClientConfig
}

type ClientState

type ClientState struct {
	Cache Cache
	Shell *ShellState
}

type Command

type Command struct {
	Name  string
	Desc  string
	CmdFn func(args []string, client *Client) error
	Scope []ShellMode
}

type FriendRequest

type FriendRequest struct {
	FriendId  uuid.UUID
	Username  string
	Enckey    []byte
	Sigkey    []byte
	Direction string
}

type Message

type Message struct {
	Id        uuid.UUID
	FriendId  uuid.UUID
	Direction string
	Content   []byte
	Timestamp int64
}

type ParsedInput

type ParsedInput struct {
	IsCommand bool
	Command   string
	Args      []string
	Raw       string
}

type ShellMode

type ShellMode int
const (
	ModeDefault ShellMode = iota
	ModeChat
)

type ShellState

type ShellState struct {
	Mode ShellMode
}

type User

type User struct {
	Id     uuid.UUID
	Name   string
	Enckey []byte
	Sigkey []byte
	KeyEx  int
}

Jump to

Keyboard shortcuts

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