handler

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 58 Imported by: 0

README

#pkg/proto/handler

Every pkg/proto/handler/{model_name}.go has:

  • A struct that implements API. The struct also embeds in itself interface described in pkg/{model_name}/{model_name}_service/serv.go that it can use in order to communicate with database.
  • A converter method that converts proto representations of models to actual models, and vice versa.
  • A set of methods that outline available API. The also match with respective methods outlined in pkg/{model_name}pb/{model_name}.proto.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertCheckPBtoCheck

func ConvertCheckPBtoCheck(pb *checkv1.Check) (*check.Check, error)

func ConvertCheckToCheckPb

func ConvertCheckToCheckPb(obj *check.Check) *checkv1.Check

func ConvertCompetitionToCompetitionPB

func ConvertCompetitionToCompetitionPB(comp *competition.Competition) (*competitionv1.Competition, error)

func ConvertDynamicConfigPBToDynamicConfig

func ConvertDynamicConfigPBToDynamicConfig(pb *configv1.DynamicConfig) *config.DynamicConfig

func ConvertDynamicConfigToDynamicConfigPB

func ConvertDynamicConfigToDynamicConfigPB(obj *config.DynamicConfig) *configv1.DynamicConfig

func ConvertHostGroupPBtoHostGroup

func ConvertHostGroupPBtoHostGroup(requireID bool, pb *host_groupv1.HostGroup) (*hostgroup.HostGroup, error)

func ConvertHostGroupToHostGroupPb

func ConvertHostGroupToHostGroupPb(obj *hostgroup.HostGroup) *host_groupv1.HostGroup

func ConvertHostPBtoHost

func ConvertHostPBtoHost(requireID bool, pb *hostv1.Host) (*host.Host, error)

func ConvertHostToHostPb

func ConvertHostToHostPb(obj *host.Host) *hostv1.Host

func ConvertPolicyPBToPolicy

func ConvertPolicyPBToPolicy(pb *policyv1.Policy) *policy.Policy

func ConvertPolicyToPolicyPB

func ConvertPolicyToPolicyPB(obj *policy.Policy) *policyv1.Policy

func ConvertPropertyPBtoProperty

func ConvertPropertyPBtoProperty(pb *propertyv1.Property) (*property.Property, error)

func ConvertPropertyToPropertyPb

func ConvertPropertyToPropertyPb(obj *property.Property) *propertyv1.Property

func ConvertRoundPBtoRound

func ConvertRoundPBtoRound(requireID bool, pb *roundv1.Round) (*round.Round, error)

func ConvertRoundToRoundPb

func ConvertRoundToRoundPb(obj *round.Round) *roundv1.Round

func ConvertServiceGroupPBtoServiceGroup

func ConvertServiceGroupPBtoServiceGroup(requireID bool, sg *service_groupv1.ServiceGroup) (*servicegroup.ServiceGroup, error)

func ConvertServiceGroupToServiceGroupPb

func ConvertServiceGroupToServiceGroupPb(obj *servicegroup.ServiceGroup) *service_groupv1.ServiceGroup

func ConvertServicePBtoService

func ConvertServicePBtoService(requireID bool, pb *servicev1.Service) (*service.Service, error)

func ConvertServiceToServicePb

func ConvertServiceToServicePb(obj *service.Service) *servicev1.Service

func ConvertTeamPBtoTeam

func ConvertTeamPBtoTeam(requireID bool, pb *teamv1.Team) (*team.Team, error)

func ConvertTeamToTeamPb

func ConvertTeamToTeamPb(obj *team.Team) *teamv1.Team

func ConvertUserPBtoUser

func ConvertUserPBtoUser(requireID bool, pb *userv1.User) (*user.User, error)

func ConvertUserToUserPb

func ConvertUserToUserPb(obj *user.User) *userv1.User

func UserRoleToRolePB

func UserRoleToRolePB(r string) userv1.Role

Types

type AuthController

type AuthController struct {
	authv1.UnimplementedAuthServiceServer
	// contains filtered or unexported fields
}

func NewAuthController

func NewAuthController(svc userservice.Serv, jwtManager *auth.Manager) *AuthController

func (AuthController) Login

type CheckController

type CheckController struct {
	checkv1.UnimplementedCheckServiceServer
	// contains filtered or unexported fields
}

func NewCheckController

func NewCheckController(svc checkservice.Serv, client *util.Store) *CheckController

func (*CheckController) GetAllByRoundID

func (*CheckController) GetAllByServiceID

func (*CheckController) GetByRoundServiceID

type ConfigController

type ConfigController struct {
	configv1.UnimplementedDynamicConfigServiceServer
	// contains filtered or unexported fields
}

func NewConfigController

func NewConfigController(svc configservice.Serv) *ConfigController

func (ConfigController) Get

func (ConfigController) Update

type HostController

type HostController struct {
	hostv1.UnimplementedHostServiceServer
	// contains filtered or unexported fields
}

func NewHostController

func NewHostController(svc hostservice.Serv, client *util.Store) *HostController

func (HostController) Delete

func (HostController) GetAll

func (HostController) GetByID

func (HostController) Store

func (HostController) Update

type HostGroupController

type HostGroupController struct {
	host_groupv1.UnimplementedHostGroupServiceServer
	// contains filtered or unexported fields
}

func NewHostGroupController

func NewHostGroupController(svc hostgroupservice.Serv) *HostGroupController

func (HostGroupController) Delete

func (HostGroupController) GetAll

func (HostGroupController) GetByID

func (HostGroupController) Store

func (HostGroupController) Update

type PolicyController

type PolicyController struct {
	policyv1.UnimplementedPolicyServiceServer
	// contains filtered or unexported fields
}

func NewPolicyController

func NewPolicyController(svc policyservice.Serv, client *policyclient.Client) *PolicyController

func (PolicyController) Get

func (PolicyController) Update

type PropertyController

type PropertyController struct {
	propertyv1.UnimplementedPropertyServiceServer
	// contains filtered or unexported fields
}

func NewPropertyController

func NewPropertyController(svc propertyservice.Serv, client *util.Store) *PropertyController

func (PropertyController) Delete

func (PropertyController) GetAll

func (PropertyController) Store

func (PropertyController) Update

type ReportController

type ReportController struct {
	reportv1.UnimplementedReportServiceServer
	// contains filtered or unexported fields
}

func NewReportController

func NewReportController(svc reportservice.Serv, reportClient *reportclient.Client, client *policyclient.Client) *ReportController

func (*ReportController) Get

type RoundController

type RoundController struct {
	roundv1.UnimplementedRoundServiceServer
	// contains filtered or unexported fields
}

func NewRoundController

func NewRoundController(svc roundservice.Serv) *RoundController

func (RoundController) GetAll

func (RoundController) GetByID

func (RoundController) GetLastRound

type ServiceController

type ServiceController struct {
	servicev1.UnimplementedServiceServiceServer
	// contains filtered or unexported fields
}

func NewServiceController

func NewServiceController(svc service2.Serv, client *util.Store) *ServiceController

func (ServiceController) Delete

func (ServiceController) GetAll

func (ServiceController) GetByID

func (ServiceController) Store

func (ServiceController) TestService

func (ServiceController) Update

type ServiceGroupController

type ServiceGroupController struct {
	service_groupv1.UnimplementedServiceGroupServiceServer
	// contains filtered or unexported fields
}

func NewServiceGroupController

func NewServiceGroupController(svc servicegroupservice.Serv) *ServiceGroupController

func (ServiceGroupController) Delete

func (ServiceGroupController) GetAll

func (ServiceGroupController) GetByID

func (ServiceGroupController) Redeploy

func (ServiceGroupController) Store

func (ServiceGroupController) Update

type StaticConfigController

type StaticConfigController struct {
	configv1.UnimplementedStaticConfigServiceServer
	// contains filtered or unexported fields
}

func NewStaticConfigController

func NewStaticConfigController(svc configservice.StaticServ) *StaticConfigController

func (StaticConfigController) Get

type TeamController

type TeamController struct {
	teamv1.UnimplementedTeamServiceServer
	// contains filtered or unexported fields
}

func NewTeamController

func NewTeamController(svc teamservice.Serv) *TeamController

func (TeamController) Delete

func (TeamController) GetAll

func (TeamController) GetByID

func (TeamController) Store

func (TeamController) Update

type UserController

type UserController struct {
	userv1.UnimplementedUserServiceServer
	// contains filtered or unexported fields
}

func NewUserController

func NewUserController(svc userservice.Serv, policyClient *policyclient.Client) *UserController

func (UserController) Delete

func (UserController) GetAll

func (UserController) GetByID

func (UserController) GetByUsername

func (UserController) Store

func (UserController) Update

Jump to

Keyboard shortcuts

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