store

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright © 2023 Verifa <info@verifa.io> SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SessionDuration  time.Duration
	PostgresUser     string `split_words:"true"`
	PostgresPassword string `split_words:"true"`
	PostgresDbName   string `default:"verinotes" split_words:"true"`
	PostgresHost     string `split_words:"true"`
	PostgresPort     string `default:"5432" split_words:"true"`
	PostgresSslMode  string `default:"disable" split_words:"true"`
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, config *Config) (*Store, error)

func NewTest

func NewTest(ctx context.Context, name string) (*Store, error)

for tests to create a store which is unique per test, idea is to pass in the name of the test as the name of the file

func (*Store) Close

func (s *Store) Close() error

TODO never called, should I defer it somewhere (after creating New store?)

func (*Store) CreateNote

func (s *Store) CreateNote(note *ent.Note) (*ent.Note, error)

func (*Store) DeleteNote

func (s *Store) DeleteNote(id int) error

func (*Store) QueryAllNotes

func (s *Store) QueryAllNotes() ([]*ent.Note, error)

func (*Store) QueryNote

func (s *Store) QueryNote(id int) (*ent.Note, error)

func (*Store) UpdateNote

func (s *Store) UpdateNote(id int, note *ent.Note) (*ent.Note, error)

Jump to

Keyboard shortcuts

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