service

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonService

type CommonService[T serviceable] struct {
	// contains filtered or unexported fields
}

func NewCommonService

func NewCommonService[T serviceable](ctx context.Context, tableName string) *CommonService[T]

func (*CommonService[T]) All

func (s *CommonService[T]) All() ([]*T, error)

func (*CommonService[T]) ByID

func (s *CommonService[T]) ByID(id *string) (*T, error)

func (*CommonService[T]) ByIDWithLoader

func (s *CommonService[T]) ByIDWithLoader(id *string) (*T, error)

func (*CommonService[T]) ByIDs

func (s *CommonService[T]) ByIDs(ids []*string) ([]*T, error)

func (*CommonService[T]) ByIDsWithLoader

func (s *CommonService[T]) ByIDsWithLoader(ids []*string) ([]*T, error)

type MachineService

type MachineService struct {
	CommonService[model.Machine]
	SaveService[*model.MachineInput]
}

func NewMachineService

func NewMachineService(ctx context.Context) *MachineService

type ProjectService

type ProjectService struct {
	CommonService[model.Project]
	SaveService[*model.ProjectInput]
}

func NewProjectService

func NewProjectService(ctx context.Context) *ProjectService

func (*ProjectService) SyncProjectRoute

func (svc *ProjectService) SyncProjectRoute(projectID *string) ([]*model.SyncResult, error)

type RouteService

type RouteService struct {
	CommonService[model.Route]
	SaveService[*model.RouteInput]
}

func NewRouteService

func NewRouteService(ctx context.Context) *RouteService

func (*RouteService) ProjectRoutes

func (svc *RouteService) ProjectRoutes(projectId *string) ([]*model.Route, error)

type SaveService

type SaveService[T db.Saveable] struct {
	// contains filtered or unexported fields
}

func NewSaveService

func NewSaveService[T db.Saveable](ctx context.Context, tableName string) *SaveService[T]

func (*SaveService[T]) Delete

func (s *SaveService[T]) Delete(id string) (int64, error)

func (*SaveService[T]) Save

func (s *SaveService[T]) Save(t T) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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