store

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.0.8

type Config struct {
	// SkipHook registers store hooks if enabled. This is for testing purposes.
	SkipHooks bool
	// SkipNATS connects to NATS if enabled. This is for testing purposes.
	SkipNATS bool

	SessionDuration time.Duration
}

type Store

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

func New

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

func (*Store) Client

func (s *Store) Client() *ent.Client

func (*Store) Close

func (s *Store) Close() error

func (*Store) CreateProject

func (s *Store) CreateProject(req *oapi.NewProject) (*oapi.Project, error)

func (*Store) CreateRequest

func (s *Store) CreateRequest(user *oapi.User, req *oapi.NewRequest) (*oapi.Request, error)

func (*Store) CreateReview

func (s *Store) CreateReview(requestID uuid.UUID, user *oapi.User, req *oapi.NewReview) (*oapi.Review, error)

func (*Store) CreateService

func (s *Store) CreateService(req *oapi.NewService) (*oapi.Service, error)

func (*Store) CreateTrigger added in v0.0.8

func (s *Store) CreateTrigger(requestID uuid.UUID) (*oapi.Trigger, error)

func (*Store) EndSession added in v0.0.8

func (s *Store) EndSession(uuid uuid.UUID) error

func (*Store) GetSession added in v0.0.8

func (s *Store) GetSession(uuid uuid.UUID) (*oapi.User, error)

func (*Store) HandleNewReview

func (s *Store) HandleNewReview(m *ent.ReviewMutation) error

HandleNewReview is called whenever a new review is added to a request and is responsible for re-evaluating the status of a request

func (*Store) HandleUpdatedRequest added in v0.0.8

func (s *Store) HandleUpdatedRequest(m *ent.RequestMutation) error

HandleUpdatedRequest is called whenever a request is updated (or mutated, in ent terms) and is responsible for triggering a deployment if the request is approved

func (*Store) NewSession added in v0.0.8

func (s *Store) NewSession(user *oapi.User) (uuid.UUID, error)

func (*Store) QueryProjects

func (s *Store) QueryProjects(ps ...predicate.Project) (*oapi.ProjectsResp, error)

func (*Store) QueryRequests

func (s *Store) QueryRequests(ps ...predicate.Request) (*oapi.RequestsResp, error)

func (*Store) QueryServices

func (s *Store) QueryServices(ps ...predicate.Service) (*oapi.ServicesResp, error)

func (*Store) RegisterHooks

func (s *Store) RegisterHooks()

Jump to

Keyboard shortcuts

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