inmemory

package
v0.0.0-...-381a539 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package memory implements foodtinder.Server using on-memory maps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewID

func NewID(order int) foodtinder.ID

NewID creates a new ID with the given order.

func NewServer

func NewServer(state State) foodtinder.Server

NewServer creates a new on-memory data server using the given store.

Types

type Session

type Session struct {
	Username string
	Metadata foodtinder.LoginMetadata
}

type State

type State struct {
	Users     []User
	Posts     []foodtinder.Post
	Sessions  []foodtinder.Session
	AssetURLs []string
}

State describes the initial state of the memory store.

type User

type User struct {
	foodtinder.Self
	Password    string
	Preferences foodtinder.FoodPreferences
	LikedPosts  []foodtinder.ID
}

User describes an on-memory user.

Jump to

Keyboard shortcuts

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