services

package
v0.0.0-...-56fa9d4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSessionStoreWithDefaults

func NewSessionStoreWithDefaults() *sessions.CookieStore

Types

type Postgres

type Postgres struct {
	*sqlx.DB
}

func NewPostgres

func NewPostgres(config PostgresConfig) (*Postgres, error)

New creates a new Postgres

func NewPostgresWithDefaults

func NewPostgresWithDefaults() (*Postgres, error)

func (*Postgres) ClearTables

func (pg *Postgres) ClearTables() error

func (*Postgres) NewMigration

func (pg *Postgres) NewMigration() (*migrate.Migrate, error)

NewMigration runs another migration

func (*Postgres) RunMigration

func (pg *Postgres) RunMigration() error

RunMigration runs migrations

type PostgresConfig

type PostgresConfig struct {
	URL     string
	Migrate bool
}

Config is configuration of the

type Service

type Service struct {
	Postgres     *Postgres
	SessionStore *sessions.CookieStore
}

func NewWithDefaults

func NewWithDefaults() (*Service, error)

func (Service) GetCurrentUser

func (service Service) GetCurrentUser(ctx context.Context) (*models.User, error)

func (Service) LogIn

func (service Service) LogIn(ctx context.Context, input graphql.UserInput) (*models.User, error)

func (Service) LogOut

func (service Service) LogOut(ctx context.Context) (*bool, error)

func (Service) SignUp

func (service Service) SignUp(ctx context.Context, input graphql.UserInput) (*models.User, error)

Jump to

Keyboard shortcuts

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