service

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeCursor

func DecodeCursor(after *string) (*string, error)

func EncodeCursor

func EncodeCursor(i *string) graphql.ID

Types

type AuthService

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

func NewAuthService

func NewAuthService(config *context.Config, log *StandardLogger) *AuthService

func (*AuthService) SignJWT

func (a *AuthService) SignJWT(user *model.User) (*string, error)

func (*AuthService) ValidateJWT

func (a *AuthService) ValidateJWT(tokenString *string) (*jwt.Token, error)

type BrokerService

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

func NewBrokerService

func NewBrokerService(config *gcontext.Config, logger *StandardLogger) *BrokerService

func (*BrokerService) GetModule

func (b *BrokerService) GetModule(serviceName string, moduleID string) (*model.Module, error)

GetModule : Sends a GRPC request to the broker for all the properties of the Module

func (*BrokerService) GetModuleActiveJob

func (b *BrokerService) GetModuleActiveJob(serviceName string, moduleID string) (*model.Job, error)

rpc GetModuleActiveJob(ModuleRequest) returns (JobResponse);

func (*BrokerService) GetModuleConfiguration

func (b *BrokerService) GetModuleConfiguration(serviceName string, moduleID string) (*model.Configuration, error)

rpc GetModuleConfiguration(ModuleRequest) returns (ConfigurationResponse);

func (*BrokerService) GetModuleJob

func (b *BrokerService) GetModuleJob(serviceName string, moduleID string, jobID string) (*model.Job, error)

rpc GetModuleJob(ModuleRequest) returns (JobResponse);

func (*BrokerService) GetModuleJobs

func (b *BrokerService) GetModuleJobs(serviceName string, moduleID string) (*[]*model.Job, error)

rpc GetModuleJobs(ModuleRequest) returns (JobsResponse);

func (*BrokerService) GetModuleProperties

func (b *BrokerService) GetModuleProperties(serviceName string, moduleID string, properties []*pb.Property) ([]*model.Property, error)

rpc GetModuleProperties(PropertyRequest) returns (PropertiesResponse);

func (*BrokerService) GetModuleProperty

func (b *BrokerService) GetModuleProperty(serviceName string, moduleID string, propertyName string) (*model.Property, error)

rpc GetModuleProperty(PropertyRequest) returns (PropertyResponse);

func (*BrokerService) GetModuleSettings

func (b *BrokerService) GetModuleSettings(serviceName string, moduleID string) (*[]*model.Property, error)

rpc GetModuleSettings(ModuleRequest) returns (SettingsResponse);

func (*BrokerService) GetModuleStatus

func (b *BrokerService) GetModuleStatus(serviceName string, moduleID string) (*model.Status, error)

rpc GetModuleStatus(ModuleRequest) returns (StatusResponse); GetModuleStatus : Sends a GRPC request to the broker and expects a response that matches the Status model

func (*BrokerService) GetModules

func (b *BrokerService) GetModules(serviceName string) (*[]*model.Module, error)

rpc GetModules(Empty) return (ModulesResponse);

func (*BrokerService) Module

func (b *BrokerService) Module(ctx context.Context, moduleName string) (*model.Module, error)

func (*BrokerService) ModuleAvailableEvents

func (b *BrokerService) ModuleAvailableEvents(serviceName string, moduleID string) (*[]*model.Event, error)

rpc ModuleAvailableEvents(ModuleRequest) returns (EventsResponse);

func (*BrokerService) ModuleCancelJob

func (b *BrokerService) ModuleCancelJob(serviceName string, moduleID string, jobID string) (*model.Job, error)

rpc ModuleCancelJob(ModuleJobRequest) returns (JobResponse);

func (*BrokerService) ModuleSubmitEvent

func (b *BrokerService) ModuleSubmitEvent(serviceName string, moduleID string) (*model.Job, error)

rpc ModuleSubmitEvent(ModuleEventRequest) returns (JobResponse);

func (*BrokerService) ModuleSubmitJob

func (b *BrokerService) ModuleSubmitJob(serviceName string, moduleID string, action string, value string, properties []*pb.Property) (*model.Job, error)

rpc ModuleSubmitJob(ModuleJobRequest) returns (JobResponse);

func (*BrokerService) SetModuleProperties

func (b *BrokerService) SetModuleProperties(serviceName string, moduleID string, properties []*pb.Property) ([]*model.Property, error)

rpc SetModuleProperties(PropertiesRequest) returns (PropertiesResponse);

func (*BrokerService) SetModuleProperty

func (b *BrokerService) SetModuleProperty(serviceName string, moduleID string, property *pb.Property) (*model.Property, error)

rpc SetModuleProperty(PropertyRequest) returns (PropertyResponse);

type ConfigureService

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

func NewConfigureService

func NewConfigureService(client pb.ConfigureEndpointClient, log *StandardLogger) *ConfigureService

func (*ConfigureService) Count

func (c *ConfigureService) Count(confNamespace string) (int, error)

func (*ConfigureService) CreateConfiguration

func (c *ConfigureService) CreateConfiguration(conf *pb.Configuration) (*model.Configuration, error)

func (*ConfigureService) DeleteConfiguration

func (c *ConfigureService) DeleteConfiguration(id string, namespace string) (*model.Configuration, error)

func (*ConfigureService) FindById

func (c *ConfigureService) FindById(confId string, confNamespace string) (*model.Configuration, error)

func (*ConfigureService) List

func (c *ConfigureService) List(confNamespace string, first *int32, after *string) ([]*model.Configuration, error)

func (*ConfigureService) UpdateConfiguration

func (c *ConfigureService) UpdateConfiguration(id string, namespace string, conf *pb.Configuration) (*model.Configuration, error)

type ManagerService

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

func NewManagerService

func NewManagerService(client pb.ManagerClient, log *StandardLogger) *ManagerService

func (*ManagerService) Install

func (c *ManagerService) Install() (*model.Response, error)

Install a plantd system

func (*ManagerService) Restart

func (c *ManagerService) Restart() (*model.Response, error)

Restart configured plantd services

func (*ManagerService) Start

func (c *ManagerService) Start() (*model.Response, error)

Start configured plantd services

func (*ManagerService) Status

func (c *ManagerService) Status() (*[]*model.Property, error)

Check the status of configured plantd services rpc Status (Empty) returns (ServiceResponse) {}

func (*ManagerService) Stop

func (c *ManagerService) Stop() (*model.Response, error)

Stop configured plantd services

func (*ManagerService) Uninstall

func (c *ManagerService) Uninstall() (*model.Response, error)

Uninstall a plantd system

func (*ManagerService) Upgrade

func (c *ManagerService) Upgrade() (*model.Response, error)

Upgrade a plantd system

type RoleService

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

func NewRoleService

func NewRoleService(db *sqlx.DB, log *StandardLogger) *RoleService

func (*RoleService) Count

func (r *RoleService) Count() (int, error)

func (*RoleService) CreateRole

func (r *RoleService) CreateRole(role *model.Role) (*model.Role, error)

func (*RoleService) FindByName

func (r *RoleService) FindByName(name string) (*model.Role, error)

func (*RoleService) FindByUserId

func (r *RoleService) FindByUserId(userId *string) ([]*model.Role, error)

func (*RoleService) List

func (r *RoleService) List(first *int32, after *string) ([]*model.Role, error)

type StandardLogger

type StandardLogger struct {
	*logrus.Logger
}

func NewLogger

func NewLogger(config *context.Config) *StandardLogger

type UserService

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

func NewUserService

func NewUserService(db *sqlx.DB, roleService *RoleService, log *StandardLogger) *UserService

func (*UserService) ComparePassword

func (u *UserService) ComparePassword(userCredentials *model.UserCredentials) (*model.User, error)

func (*UserService) Count

func (u *UserService) Count() (int, error)

func (*UserService) CreateUser

func (u *UserService) CreateUser(user *model.User) (*model.User, error)

func (*UserService) FindByEmail

func (u *UserService) FindByEmail(email string) (*model.User, error)

func (*UserService) FindByID

func (u *UserService) FindByID(id string) (*model.User, error)

func (*UserService) List

func (u *UserService) List(first *int32, after *string) ([]*model.User, error)

Jump to

Keyboard shortcuts

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