handler

package
v0.3.0-alpha7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 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 *checkpb.Check) (*check.Check, error)

func ConvertCheckToCheckPb

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

func ConvertCompetitionToCompetitionPB

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

func ConvertDynamicConfigPBToDynamicConfig

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

func ConvertDynamicConfigToDynamicConfigPB

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

func ConvertHostGroupPBtoHostGroup

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

func ConvertHostGroupToHostGroupPb

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

func ConvertHostPBtoHost

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

func ConvertHostToHostPb

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

func ConvertPolicyPBToPolicy

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

func ConvertPolicyToPolicyPB

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

func ConvertPropertyPBtoProperty

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

func ConvertPropertyToPropertyPb

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

func ConvertRoundPBtoRound

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

func ConvertRoundToRoundPb

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

func ConvertServiceGroupPBtoServiceGroup

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

func ConvertServiceGroupToServiceGroupPb

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

func ConvertServicePBtoService

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

func ConvertServiceToServicePb

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

func ConvertTeamPBtoTeam

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

func ConvertTeamToTeamPb

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

func ConvertUserPBtoUser

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

func ConvertUserToUserPb

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

func UserRoleToRolePB

func UserRoleToRolePB(r string) userpb.Role

Types

type AuthController

type AuthController struct {
	authpb.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 {
	checkpb.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 {
	configpb.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 {
	hostpb.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_grouppb.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 {
	policypb.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 {
	propertypb.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 {
	reportpb.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 {
	roundpb.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 {
	servicepb.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_grouppb.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 {
	configpb.UnimplementedStaticConfigServiceServer
	// contains filtered or unexported fields
}

func NewStaticConfigController

func NewStaticConfigController(svc configservice.StaticServ) *StaticConfigController

func (StaticConfigController) Get

type TeamController

type TeamController struct {
	teampb.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 {
	userpb.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