identities

package
v0.0.0-...-7341660 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnnouncedEvent

type AnnouncedEvent struct {
	ID          string `json:"id"`
	EventID     string `json:"eventid"`
	AnnouncedAt string `json:"announced_at"`
	DeleteAt    string `json:"delete_at"`
}

type Channel

type Channel struct {
	ID          string           `json:"id"`
	ChannelName string           `json:"channelname"`
	Type        string           `json:"type"` // "directmessage" or "group"
	Specifics   ChannelSpecifics `json:"specifics"`
}

type ChannelSpecifics

type ChannelSpecifics struct {
	ChatID string `json:"chatId"`
}

type Identity

type Identity struct {
	Sub             string           `json:"sub"`
	Name            string           `json:"name"`
	Location        string           `json:"location"`
	Interests       []string         `json:"interests"`
	Channels        []Channel        `json:"channels"`
	AnnouncedEvents []AnnouncedEvent `json:"announcedEvents"`
}

type IdentityHandler

type IdentityHandler struct {
	Config *configuration.Config
	Store  *IdentityStore
}

func NewIdentityHandler

func NewIdentityHandler(config *configuration.Config, store *IdentityStore) *IdentityHandler

func (*IdentityHandler) GetAllIdentities

func (h *IdentityHandler) GetAllIdentities(w http.ResponseWriter, r *http.Request)

func (*IdentityHandler) GetIdentity

func (h *IdentityHandler) GetIdentity(w http.ResponseWriter, r *http.Request)

func (*IdentityHandler) PostIdentity

func (h *IdentityHandler) PostIdentity(w http.ResponseWriter, r *http.Request)

type IdentityStore

type IdentityStore struct {
	Config     *configuration.Config
	Identities []Identity
}

func NewIdentityStore

func NewIdentityStore(config *configuration.Config) (*IdentityStore, error)

func (*IdentityStore) GetIdentity

func (s *IdentityStore) GetIdentity(ctx context.Context, sub string) (*Identity, error)

func (*IdentityStore) InsertIdentity

func (s *IdentityStore) InsertIdentity(ctx context.Context, identity Identity) (*Identity, error)

func (*IdentityStore) ReadAllIdentities

func (s *IdentityStore) ReadAllIdentities() ([]Identity, error)

func (*IdentityStore) ReadIdentityByChatId

func (s *IdentityStore) ReadIdentityByChatId(chatId string) (*Identity, error)

func (*IdentityStore) SaveDataToJsonFile

func (s *IdentityStore) SaveDataToJsonFile() error

Jump to

Keyboard shortcuts

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