service

package
v1.3.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAccessible = errors.New("not Accessible")

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 HeadscaleService added in v1.3.0

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

func NewHeadscaleService added in v1.3.0

func NewHeadscaleService(ctx context.Context) *HeadscaleService

func (*HeadscaleService) CreateUser added in v1.3.1

func (service *HeadscaleService) CreateUser(name string) (*model.HUser, error)

func (*HeadscaleService) DeleteMachine added in v1.3.0

func (service *HeadscaleService) DeleteMachine(machineId uint64) error

func (*HeadscaleService) DeleteUser added in v1.3.1

func (service *HeadscaleService) DeleteUser(name string) (bool, error)

func (*HeadscaleService) GenerateACL added in v1.3.1

func (svc *HeadscaleService) GenerateACL() (*policy.ACLPolicy, error)

func (*HeadscaleService) GetMachine added in v1.3.0

func (service *HeadscaleService) GetMachine(machineId uint64) (*model.HMachine, error)

func (*HeadscaleService) ListMachines added in v1.3.0

func (service *HeadscaleService) ListMachines() ([]*model.HMachine, error)

func (*HeadscaleService) RenameMachine added in v1.3.0

func (service *HeadscaleService) RenameMachine(machineId uint64, name string) (*model.HMachine, error)

func (*HeadscaleService) RenameUser added in v1.3.1

func (service *HeadscaleService) RenameUser(oldName string, newName string) (*model.HUser, error)

func (*HeadscaleService) SetMachineTags added in v1.3.3

func (service *HeadscaleService) SetMachineTags(machineId uint64, tags []string) (*model.HMachine, error)

func (*HeadscaleService) TriggerUpdate added in v1.3.1

func (svc *HeadscaleService) TriggerUpdate() 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