stores

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FSChannelStore

type FSChannelStore struct {
	StoragePath string
}

FSChannelStore stores channels as JSON files

func NewFSChannelStore

func NewFSChannelStore(storagePath string) *FSChannelStore

func (*FSChannelStore) GetChannel

func (s *FSChannelStore) GetChannel(provider string, identityKey string, createIfMissing bool) (*oa.Channel, bool, error)

func (*FSChannelStore) GetChannelsByIdentity

func (s *FSChannelStore) GetChannelsByIdentity(identityKey string) ([]*oa.Channel, error)

func (*FSChannelStore) SaveChannel

func (s *FSChannelStore) SaveChannel(channel *oa.Channel) error

type FSIdentityStore

type FSIdentityStore struct {
	StoragePath string
}

FSIdentityStore stores identities as JSON files

func NewFSIdentityStore

func NewFSIdentityStore(storagePath string) *FSIdentityStore

func (*FSIdentityStore) GetIdentity

func (s *FSIdentityStore) GetIdentity(identityType, identityValue string, createIfMissing bool) (*oa.Identity, bool, error)

func (*FSIdentityStore) GetUserIdentities

func (s *FSIdentityStore) GetUserIdentities(userId string) ([]*oa.Identity, error)

func (*FSIdentityStore) MarkIdentityVerified

func (s *FSIdentityStore) MarkIdentityVerified(identityType, identityValue string) error

func (*FSIdentityStore) SaveIdentity

func (s *FSIdentityStore) SaveIdentity(identity *oa.Identity) error

func (*FSIdentityStore) SetUserForIdentity

func (s *FSIdentityStore) SetUserForIdentity(identityType, identityValue string, newUserId string) error

type FSTokenStore

type FSTokenStore struct {
	StoragePath string
}

FSTokenStore stores verification and reset tokens as JSON files

func NewFSTokenStore

func NewFSTokenStore(storagePath string) *FSTokenStore

func (*FSTokenStore) CreateToken

func (s *FSTokenStore) CreateToken(userID, email string, tokenType oa.TokenType, expiryDuration time.Duration) (*oa.AuthToken, error)

func (*FSTokenStore) DeleteToken

func (s *FSTokenStore) DeleteToken(token string) error

func (*FSTokenStore) DeleteUserTokens

func (s *FSTokenStore) DeleteUserTokens(userID string, tokenType oa.TokenType) error

func (*FSTokenStore) GetToken

func (s *FSTokenStore) GetToken(token string) (*oa.AuthToken, error)

type FSUser

type FSUser struct {
	UserId      string         `json:"user_id"`
	IsActive    bool           `json:"is_active"`
	UserProfile map[string]any `json:"profile"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
}

FSUser implements the oneauth.User interface

func (*FSUser) Id

func (u *FSUser) Id() string

func (*FSUser) Profile

func (u *FSUser) Profile() map[string]any

type FSUserStore

type FSUserStore struct {
	StoragePath string
}

FSUserStore stores users as JSON files

func NewFSUserStore

func NewFSUserStore(storagePath string) *FSUserStore

func (*FSUserStore) CreateUser

func (s *FSUserStore) CreateUser(userId string, isActive bool, profile map[string]any) (oa.User, error)

func (*FSUserStore) GetUserById

func (s *FSUserStore) GetUserById(userId string) (oa.User, error)

func (*FSUserStore) SaveUser

func (s *FSUserStore) SaveUser(user oa.User) error

Directories

Path Synopsis
gae module
gorm module

Jump to

Keyboard shortcuts

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