handler

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 73 Imported by: 0

README ¶

#pkg/handler

Every pkg/handler/{model_name}.{server_type(grpc|connect)}.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 ConvertCheckToCheckV1Pb ¶

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

func ConvertCheckToCheckV2Pb ¶

func ConvertCheckToCheckV2Pb(obj *check.Check) *checkv2.Check

func ConvertCheckV1PBtoCheck ¶

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

func ConvertCheckV2PBtoCheck ¶

func ConvertCheckV2PBtoCheck(pb *checkv2.Check) (*check.Check, error)

func ConvertCompetitionToCompetitionV1PB ¶

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

func ConvertCompetitionToCompetitionV2PB ¶

func ConvertCompetitionToCompetitionV2PB(comp *competition.Competition) (*competitionv2.Competition, error)

func ConvertDynamicConfigToDynamicConfigV1PB ¶

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

func ConvertDynamicConfigToDynamicConfigV2PB ¶

func ConvertDynamicConfigToDynamicConfigV2PB(obj *config.DynamicConfig) *configv2.DynamicConfig

func ConvertDynamicConfigV1PBToDynamicConfig ¶

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

func ConvertDynamicConfigV2PBToDynamicConfig ¶

func ConvertDynamicConfigV2PBToDynamicConfig(pb *configv2.DynamicConfig) *config.DynamicConfig

func ConvertHostGroupToHostGroupV1Pb ¶

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

func ConvertHostGroupToHostGroupV2Pb ¶

func ConvertHostGroupToHostGroupV2Pb(obj *hostgroup.HostGroup) *host_groupv2.HostGroup

func ConvertHostGroupV1PBtoHostGroup ¶

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

func ConvertHostGroupV2PBtoHostGroup ¶

func ConvertHostGroupV2PBtoHostGroup(requireID bool, pb *host_groupv2.HostGroup) (*hostgroup.HostGroup, error)

func ConvertHostToHostV1Pb ¶

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

func ConvertHostToHostV2Pb ¶

func ConvertHostToHostV2Pb(obj *host.Host) *hostv2.Host

func ConvertHostV1PBtoHost ¶

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

func ConvertHostV2PBtoHost ¶

func ConvertHostV2PBtoHost(requireID bool, pb *hostv2.Host) (*host.Host, error)

func ConvertPolicyToPolicyV1PB ¶

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

func ConvertPolicyToPolicyV2PB ¶

func ConvertPolicyToPolicyV2PB(obj *policy.Policy) *policyv2.Policy

func ConvertPolicyV1PBToPolicy ¶

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

func ConvertPolicyV2PBToPolicy ¶

func ConvertPolicyV2PBToPolicy(pb *policyv2.Policy) *policy.Policy

func ConvertPropertyToPropertyV1Pb ¶

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

func ConvertPropertyToPropertyV2Pb ¶

func ConvertPropertyToPropertyV2Pb(obj *property.Property) *propertyv2.Property

func ConvertPropertyV1PBtoProperty ¶

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

func ConvertPropertyV2PBtoProperty ¶

func ConvertPropertyV2PBtoProperty(pb *propertyv2.Property) (*property.Property, error)

func ConvertRoundToRoundV1Pb ¶

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

func ConvertRoundToRoundV2Pb ¶

func ConvertRoundToRoundV2Pb(obj *round.Round) *roundv2.Round

func ConvertRoundV1PBtoRound ¶

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

func ConvertRoundV2PBtoRound ¶

func ConvertRoundV2PBtoRound(requireID bool, pb *roundv2.Round) (*round.Round, error)

func ConvertServiceGroupToServiceGroupV1Pb ¶

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

func ConvertServiceGroupToServiceGroupV2Pb ¶

func ConvertServiceGroupToServiceGroupV2Pb(obj *servicegroup.ServiceGroup) *service_groupv2.ServiceGroup

func ConvertServiceGroupV1PBtoServiceGroup ¶

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

func ConvertServiceGroupV2PBtoServiceGroup ¶

func ConvertServiceGroupV2PBtoServiceGroup(requireID bool, sg *service_groupv2.ServiceGroup) (*servicegroup.ServiceGroup, error)

func ConvertServiceToServiceV1Pb ¶

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

func ConvertServiceToServiceV2Pb ¶

func ConvertServiceToServiceV2Pb(obj *service.Service) *servicev2.Service

func ConvertServiceV1PBtoService ¶

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

func ConvertServiceV2PBtoService ¶

func ConvertServiceV2PBtoService(requireID bool, pb *servicev2.Service) (*service.Service, error)

func ConvertTeamToTeamV1Pb ¶

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

func ConvertTeamToTeamV2Pb ¶

func ConvertTeamToTeamV2Pb(obj *team.Team) *teamv2.Team

func ConvertTeamV1PBtoTeam ¶

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

func ConvertTeamV2PBtoTeam ¶

func ConvertTeamV2PBtoTeam(requireID bool, pb *teamv2.Team) (*team.Team, error)

func ConvertUserToUserV1Pb ¶

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

func ConvertUserToUserV2Pb ¶

func ConvertUserToUserV2Pb(obj *user.User) *userv2.User

func ConvertUserV1PBtoUser ¶

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

func ConvertUserV2PBtoUser ¶

func ConvertUserV2PBtoUser(requireID bool, pb *userv2.User) (*user.User, error)

func UserRoleToRoleV1PB ¶

func UserRoleToRoleV1PB(r string) userv1.Role

func UserRoleToRoleV2PB ¶

func UserRoleToRoleV2PB(r string) userv2.Role

Types ¶

type AuthV1Controller ¶

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

func NewAuthV1Controller ¶

func NewAuthV1Controller(svc userservice.Serv, jwtManager *auth.Manager) *AuthV1Controller

func (AuthV1Controller) Login ¶

type AuthV2Controller ¶

type AuthV2Controller struct {
	authv2.UnimplementedAuthServiceServer
	// contains filtered or unexported fields
}

func NewAuthV2Controller ¶

func NewAuthV2Controller(svc userservice.Serv, jwtManager *auth.Manager) *AuthV2Controller

func (AuthV2Controller) Login ¶

type CheckV1Controller ¶

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

func NewCheckV1Controller ¶

func NewCheckV1Controller(svc checkservice.Serv, client *util.Store) *CheckV1Controller

func (*CheckV1Controller) GetAllByRoundID ¶

func (*CheckV1Controller) GetAllByServiceID ¶

func (*CheckV1Controller) GetByRoundServiceID ¶

type CheckV2Controller ¶

type CheckV2Controller struct {
	checkv2.UnimplementedCheckServiceServer
	// contains filtered or unexported fields
}

func NewCheckV2Controller ¶

func NewCheckV2Controller(svc checkservice.Serv, client *util.Store) *CheckV2Controller

type CompetitionV2Controller ¶

type CompetitionV2Controller struct {
	competitionv2.UnimplementedCompetitionServiceServer
	// contains filtered or unexported fields
}

type ConfigV1Controller ¶

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

func NewConfigV1Controller ¶

func NewConfigV1Controller(svc configservice.Serv) *ConfigV1Controller

func (ConfigV1Controller) Get ¶

func (ConfigV1Controller) Update ¶

type ConfigV2Controller ¶

type ConfigV2Controller struct {
	configv2.UnimplementedDynamicConfigServiceServer
	// contains filtered or unexported fields
}

func NewConfigV2Controller ¶

func NewConfigV2Controller(svc configservice.Serv) *ConfigV2Controller

type HealthV1Controller ¶

type HealthV1Controller struct {
	healthv1.UnimplementedHealthServer
}

func NewHealthV1Controller ¶

func NewHealthV1Controller() *HealthV1Controller

func (HealthV1Controller) Check ¶

type HostGroupV1Controller ¶

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

func NewHostGroupV1Controller ¶

func NewHostGroupV1Controller(svc hostgroupservice.Serv) *HostGroupV1Controller

func (HostGroupV1Controller) Delete ¶

func (HostGroupV1Controller) GetAll ¶

func (HostGroupV1Controller) GetByID ¶

func (HostGroupV1Controller) Store ¶

func (HostGroupV1Controller) Update ¶

type HostV1Controller ¶

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

func NewHostV1Controller ¶

func NewHostV1Controller(svc hostservice.Serv, client *util.Store) *HostV1Controller

func (HostV1Controller) Delete ¶

func (HostV1Controller) GetAll ¶

func (HostV1Controller) GetByID ¶

func (HostV1Controller) Store ¶

func (HostV1Controller) Update ¶

type HostV2Controller ¶

type HostV2Controller struct {
	hostv2.UnimplementedHostServiceServer
	// contains filtered or unexported fields
}

func NewHostV2Controller ¶

func NewHostV2Controller(svc hostservice.Serv, client *util.Store) *HostV2Controller

func (HostV2Controller) Store ¶

type PolicyV1Controller ¶

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

func NewPolicyV1Controller ¶

func NewPolicyV1Controller(svc policyservice.Serv, client *policyclient.Client) *PolicyV1Controller

func (PolicyV1Controller) Get ¶

func (PolicyV1Controller) GetUnary ¶

func (PolicyV1Controller) Update ¶

type PolicyV2Controller ¶

type PolicyV2Controller struct {
	policyv2.UnimplementedPolicyServiceServer
	// contains filtered or unexported fields
}

func NewPolicyV2Controller ¶

func NewPolicyV2Controller(svc policyservice.Serv, client *policyclient.Client) *PolicyV2Controller

type PropertyV1Controller ¶

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

func NewPropertyV1Controller ¶

func NewPropertyV1Controller(svc propertyservice.Serv, client *util.Store) *PropertyV1Controller

func (PropertyV1Controller) Delete ¶

func (PropertyV1Controller) GetAll ¶

func (PropertyV1Controller) Store ¶

func (PropertyV1Controller) Update ¶

type PropertyV2Controller ¶

type PropertyV2Controller struct {
	propertyv2.UnimplementedPropertyServiceServer
	// contains filtered or unexported fields
}

func NewPropertyV2Controller ¶

func NewPropertyV2Controller(svc propertyservice.Serv, client *util.Store) *PropertyV2Controller

type ReportV1Controller ¶

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

func NewReportV1Controller ¶

func NewReportV1Controller(svc reportservice.Serv, reportClient *reportclient.Client, client *policyclient.Client) *ReportV1Controller

func (*ReportV1Controller) Get ¶

func (*ReportV1Controller) GetUnary ¶

type ReportV2Controller ¶

type ReportV2Controller struct {
	reportv2.UnimplementedReportServiceServer
	// contains filtered or unexported fields
}

func NewReportV2Controller ¶

func NewReportV2Controller(svc reportservice.Serv, reportClient *reportclient.Client, client *policyclient.Client) *ReportV2Controller

func (*ReportV2Controller) Get ¶

type RoundV1Controller ¶

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

func NewRoundV1Controller ¶

func NewRoundV1Controller(svc roundservice.Serv) *RoundV1Controller

func (RoundV1Controller) GetAll ¶

func (RoundV1Controller) GetByID ¶

func (RoundV1Controller) GetLastRound ¶

type ServiceGroupV1Controller ¶

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

func (ServiceGroupV1Controller) Delete ¶

func (ServiceGroupV1Controller) GetAll ¶

func (ServiceGroupV1Controller) GetByID ¶

func (ServiceGroupV1Controller) Redeploy ¶

func (ServiceGroupV1Controller) Store ¶

func (ServiceGroupV1Controller) Update ¶

type ServiceGroupV2Controller ¶

type ServiceGroupV2Controller struct {
	service_groupv2.UnimplementedServiceGroupServiceServer
	// contains filtered or unexported fields
}

type ServiceV1Controller ¶

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

func NewServiceV1Controller ¶

func NewServiceV1Controller(svc service2.Serv, client *util.Store) *ServiceV1Controller

func (ServiceV1Controller) Delete ¶

func (ServiceV1Controller) GetAll ¶

func (ServiceV1Controller) GetByID ¶

func (ServiceV1Controller) Store ¶

func (ServiceV1Controller) TestService ¶

func (ServiceV1Controller) Update ¶

type StaticConfigV1Controller ¶

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

func (StaticConfigV1Controller) Get ¶

type StaticConfigV2Controller ¶

type StaticConfigV2Controller struct {
	configv2.UnimplementedStaticConfigServiceServer
	// contains filtered or unexported fields
}

type TeamV1Controller ¶

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

func NewTeamV1Controller ¶

func NewTeamV1Controller(svc teamservice.Serv) *TeamV1Controller

func (TeamV1Controller) Delete ¶

func (TeamV1Controller) GetAll ¶

func (TeamV1Controller) GetByID ¶

func (TeamV1Controller) Store ¶

func (TeamV1Controller) Update ¶

type TeamV2Controller ¶

type TeamV2Controller struct {
	teamv2.UnimplementedTeamServiceServer
	// contains filtered or unexported fields
}

func NewTeamV2Controller ¶

func NewTeamV2Controller(svc teamservice.Serv) *TeamV2Controller

func (TeamV2Controller) Store ¶

type UserV1Controller ¶

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

func NewUserV1Controller ¶

func NewUserV1Controller(svc userservice.Serv, policyClient *policyclient.Client) *UserV1Controller

func (UserV1Controller) Delete ¶

func (UserV1Controller) GetAll ¶

func (UserV1Controller) GetByID ¶

func (UserV1Controller) GetByUsername ¶

func (UserV1Controller) Store ¶

func (UserV1Controller) Update ¶

type UserV2Controller ¶

type UserV2Controller struct {
	userv2.UnimplementedUserServiceServer
	// contains filtered or unexported fields
}

func NewUserV2Controller ¶

func NewUserV2Controller(svc userservice.Serv, policyClient *policyclient.Client) *UserV2Controller

func (UserV2Controller) Store ¶

Directories ¶

Path Synopsis

Jump to

Keyboard shortcuts

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