diff --git a/client.go b/client.go index c210bdd5..72e1099e 100644 --- a/client.go +++ b/client.go @@ -18,9 +18,9 @@ import ( cfhttp "code.cloudfoundry.org/cfhttp/v2" "code.cloudfoundry.org/lager/v3" "code.cloudfoundry.org/tlsconfig" - "github.com/gogo/protobuf/proto" "github.com/tedsuo/rata" "github.com/vito/go-sse/sse" + "google.golang.org/protobuf/proto" ) const ( @@ -326,20 +326,21 @@ type client struct { } func (c *client) Ping(logger lager.Logger, traceID string) bool { - response := models.PingResponse{} - err := c.doRequest(logger, traceID, PingRoute_r0, nil, nil, nil, &response) + protoResponse := models.ProtoPingResponse{} + err := c.doRequest(logger, traceID, PingRoute_r0, nil, nil, nil, &protoResponse) if err != nil { return false } - return response.Available + return protoResponse.Available } func (c *client) Domains(logger lager.Logger, traceID string) ([]string, error) { - response := models.DomainsResponse{} - err := c.doRequest(logger, traceID, DomainsRoute_r0, nil, nil, nil, &response) + protoResponse := models.ProtoDomainsResponse{} + err := c.doRequest(logger, traceID, DomainsRoute_r0, nil, nil, nil, &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.Domains, response.Error.ToError() } @@ -348,11 +349,12 @@ func (c *client) UpsertDomain(logger lager.Logger, traceID string, domain string Domain: domain, Ttl: uint32(ttl.Seconds()), } - response := models.UpsertDomainResponse{} - err := c.doRequest(logger, traceID, UpsertDomainRoute_r0, nil, nil, &request, &response) + protoResponse := models.ProtoUpsertDomainResponse{} + err := c.doRequest(logger, traceID, UpsertDomainRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return err } + response := protoResponse.FromProto() return response.Error.ToError() } @@ -363,14 +365,15 @@ func (c *client) ActualLRPs(logger lager.Logger, traceID string, filter models.A ProcessGuid: filter.ProcessGuid, } if filter.Index != nil { - request.SetIndex(*filter.Index) + request.SetIndex(filter.Index) } - response := models.ActualLRPsResponse{} - err := c.doRequest(logger, traceID, ActualLRPsRoute_r0, nil, nil, &request, &response) + protoResponse := models.ProtoActualLRPsResponse{} + err := c.doRequest(logger, traceID, ActualLRPsRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.ActualLrps, response.Error.ToError() } @@ -380,12 +383,13 @@ func (c *client) ActualLRPGroups(logger lager.Logger, traceID string, filter mod Domain: filter.Domain, CellId: filter.CellID, } - response := models.ActualLRPGroupsResponse{} - err := c.doRequest(logger, traceID, ActualLRPGroupsRoute_r0, nil, nil, &request, &response) + protoResponse := models.ProtoActualLRPGroupsResponse{} + err := c.doRequest(logger, traceID, ActualLRPGroupsRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.ActualLrpGroups, response.Error.ToError() } @@ -394,12 +398,13 @@ func (c *client) ActualLRPGroupsByProcessGuid(logger lager.Logger, traceID strin request := models.ActualLRPGroupsByProcessGuidRequest{ ProcessGuid: processGuid, } - response := models.ActualLRPGroupsResponse{} - err := c.doRequest(logger, traceID, ActualLRPGroupsByProcessGuidRoute_r0, nil, nil, &request, &response) + protoResponse := models.ProtoActualLRPGroupsResponse{} + err := c.doRequest(logger, traceID, ActualLRPGroupsByProcessGuidRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.ActualLrpGroups, response.Error.ToError() } @@ -409,12 +414,13 @@ func (c *client) ActualLRPGroupByProcessGuidAndIndex(logger lager.Logger, traceI ProcessGuid: processGuid, Index: int32(index), } - response := models.ActualLRPGroupResponse{} - err := c.doRequest(logger, traceID, ActualLRPGroupByProcessGuidAndIndexRoute_r0, nil, nil, &request, &response) + protoResponse := models.ProtoActualLRPGroupResponse{} + err := c.doRequest(logger, traceID, ActualLRPGroupByProcessGuidAndIndexRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.ActualLrpGroup, response.Error.ToError() } @@ -424,11 +430,13 @@ func (c *client) ClaimActualLRP(logger lager.Logger, traceID string, key *models Index: key.Index, ActualLrpInstanceKey: instanceKey, } - response := models.ActualLRPLifecycleResponse{} - err := c.doRequest(logger, traceID, ClaimActualLRPRoute_r0, nil, nil, &request, &response) + protoResponse := models.ProtoActualLRPLifecycleResponse{} + err := c.doRequest(logger, traceID, ClaimActualLRPRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return err } + + response := protoResponse.FromProto() return response.Error.ToError() } @@ -442,7 +450,7 @@ func (c *client) StartActualLRP(logger lager.Logger, routable bool, availabilityZone string, ) error { - response := models.ActualLRPLifecycleResponse{} + protoResponse := models.ProtoActualLRPLifecycleResponse{} request := &models.StartActualLRPRequest{ ActualLrpKey: key, ActualLrpInstanceKey: instanceKey, @@ -451,19 +459,22 @@ func (c *client) StartActualLRP(logger lager.Logger, MetricTags: metricTags, AvailabilityZone: availabilityZone, } - request.SetRoutable(routable) - err := c.doRequest(logger, traceID, StartActualLRPRoute_r1, nil, nil, request, &response) + request.SetRoutable(&routable) + err := c.doRequest(logger, traceID, StartActualLRPRoute_r1, nil, nil, request.ToProto(), &protoResponse) if err != nil && err == EndpointNotFoundErr { - err = c.doRequest(logger, traceID, StartActualLRPRoute_r0, nil, nil, &models.StartActualLRPRequest{ + startActualLrpRequest := &models.StartActualLRPRequest{ ActualLrpKey: key, ActualLrpInstanceKey: instanceKey, ActualLrpNetInfo: netInfo, - }, &response) + } + err = c.doRequest(logger, traceID, StartActualLRPRoute_r0, nil, nil, startActualLrpRequest.ToProto(), &protoResponse) } if err != nil { return err } + + response := protoResponse.FromProto() return response.Error.ToError() } @@ -473,12 +484,14 @@ func (c *client) CrashActualLRP(logger lager.Logger, traceID string, key *models ActualLrpInstanceKey: instanceKey, ErrorMessage: errorMessage, } - response := models.ActualLRPLifecycleResponse{} - err := c.doRequest(logger, traceID, CrashActualLRPRoute_r0, nil, nil, &request, &response) + protoResponse := models.ProtoActualLRPLifecycleResponse{} + err := c.doRequest(logger, traceID, CrashActualLRPRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return err } + + response := protoResponse.FromProto() return response.Error.ToError() } @@ -487,12 +500,14 @@ func (c *client) FailActualLRP(logger lager.Logger, traceID string, key *models. ActualLrpKey: key, ErrorMessage: errorMessage, } - response := models.ActualLRPLifecycleResponse{} - err := c.doRequest(logger, traceID, FailActualLRPRoute_r0, nil, nil, &request, &response) + protoResponse := models.ProtoActualLRPLifecycleResponse{} + err := c.doRequest(logger, traceID, FailActualLRPRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return err } + + response := protoResponse.FromProto() return response.Error.ToError() } @@ -500,12 +515,14 @@ func (c *client) RetireActualLRP(logger lager.Logger, traceID string, key *model request := models.RetireActualLRPRequest{ ActualLrpKey: key, } - response := models.ActualLRPLifecycleResponse{} - err := c.doRequest(logger, traceID, RetireActualLRPRoute_r0, nil, nil, &request, &response) + protoResponse := models.ProtoActualLRPLifecycleResponse{} + err := c.doRequest(logger, traceID, RetireActualLRPRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return err } + + response := protoResponse.FromProto() return response.Error.ToError() } @@ -516,34 +533,39 @@ func (c *client) RemoveActualLRP(logger lager.Logger, traceID string, key *model ActualLrpInstanceKey: instanceKey, } - response := models.ActualLRPLifecycleResponse{} - err := c.doRequest(logger, traceID, RemoveActualLRPRoute_r0, nil, nil, &request, &response) + protoResponse := models.ProtoActualLRPLifecycleResponse{} + err := c.doRequest(logger, traceID, RemoveActualLRPRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return err } + + response := protoResponse.FromProto() return response.Error.ToError() } func (c *client) EvacuateClaimedActualLRP(logger lager.Logger, traceID string, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey) (bool, error) { - return c.doEvacRequest(logger, traceID, EvacuateClaimedActualLRPRoute_r0, KeepContainer, &models.EvacuateClaimedActualLRPRequest{ + request := &models.EvacuateClaimedActualLRPRequest{ ActualLrpKey: key, ActualLrpInstanceKey: instanceKey, - }) + } + return c.doEvacRequest(logger, traceID, EvacuateClaimedActualLRPRoute_r0, KeepContainer, request.ToProto()) } func (c *client) EvacuateCrashedActualLRP(logger lager.Logger, traceID string, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey, errorMessage string) (bool, error) { - return c.doEvacRequest(logger, traceID, EvacuateCrashedActualLRPRoute_r0, DeleteContainer, &models.EvacuateCrashedActualLRPRequest{ + request := &models.EvacuateCrashedActualLRPRequest{ ActualLrpKey: key, ActualLrpInstanceKey: instanceKey, ErrorMessage: errorMessage, - }) + } + return c.doEvacRequest(logger, traceID, EvacuateCrashedActualLRPRoute_r0, DeleteContainer, request.ToProto()) } func (c *client) EvacuateStoppedActualLRP(logger lager.Logger, traceID string, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey) (bool, error) { - return c.doEvacRequest(logger, traceID, EvacuateStoppedActualLRPRoute_r0, DeleteContainer, &models.EvacuateStoppedActualLRPRequest{ + request := &models.EvacuateStoppedActualLRPRequest{ ActualLrpKey: key, ActualLrpInstanceKey: instanceKey, - }) + } + return c.doEvacRequest(logger, traceID, EvacuateStoppedActualLRPRoute_r0, DeleteContainer, request.ToProto()) } func (c *client) EvacuateRunningActualLRP(logger lager.Logger, @@ -564,14 +586,15 @@ func (c *client) EvacuateRunningActualLRP(logger lager.Logger, MetricTags: metricTags, AvailabilityZone: availabilityZone, } - request.SetRoutable(routable) - keepContainer, err := c.doEvacRequest(logger, traceID, EvacuateRunningActualLRPRoute_r1, KeepContainer, request) + request.SetRoutable(&routable) + keepContainer, err := c.doEvacRequest(logger, traceID, EvacuateRunningActualLRPRoute_r1, KeepContainer, request.ToProto()) if err != nil && err == EndpointNotFoundErr { - keepContainer, err = c.doEvacRequest(logger, traceID, EvacuateRunningActualLRPRoute_r0, KeepContainer, &models.EvacuateRunningActualLRPRequest{ + evacRunningActualLrpRequest := &models.EvacuateRunningActualLRPRequest{ ActualLrpKey: key, ActualLrpInstanceKey: instanceKey, ActualLrpNetInfo: netInfo, - }) + } + keepContainer, err = c.doEvacRequest(logger, traceID, EvacuateRunningActualLRPRoute_r0, KeepContainer, evacRunningActualLrpRequest.ToProto()) } return keepContainer, err @@ -583,23 +606,25 @@ func (c *client) RemoveEvacuatingActualLRP(logger lager.Logger, traceID string, ActualLrpInstanceKey: instanceKey, } - response := models.RemoveEvacuatingActualLRPResponse{} - err := c.doRequest(logger, traceID, RemoveEvacuatingActualLRPRoute_r0, nil, nil, &request, &response) + protoResponse := models.ProtoRemoveEvacuatingActualLRPResponse{} + err := c.doRequest(logger, traceID, RemoveEvacuatingActualLRPRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return err } + response := protoResponse.FromProto() return response.Error.ToError() } func (c *client) DesiredLRPs(logger lager.Logger, traceID string, filter models.DesiredLRPFilter) ([]*models.DesiredLRP, error) { request := models.DesiredLRPsRequest(filter) - response := models.DesiredLRPsResponse{} - err := c.doRequest(logger, traceID, DesiredLRPsRoute_r3, nil, nil, &request, &response) + protoResponse := models.ProtoDesiredLRPsResponse{} + err := c.doRequest(logger, traceID, DesiredLRPsRoute_r3, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.DesiredLrps, response.Error.ToError() } @@ -607,23 +632,25 @@ func (c *client) DesiredLRPByProcessGuid(logger lager.Logger, traceID string, pr request := models.DesiredLRPByProcessGuidRequest{ ProcessGuid: processGuid, } - response := models.DesiredLRPResponse{} - err := c.doRequest(logger, traceID, DesiredLRPByProcessGuidRoute_r3, nil, nil, &request, &response) + protoResponse := models.ProtoDesiredLRPResponse{} + err := c.doRequest(logger, traceID, DesiredLRPByProcessGuidRoute_r3, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.DesiredLrp, response.Error.ToError() } func (c *client) DesiredLRPSchedulingInfos(logger lager.Logger, traceID string, filter models.DesiredLRPFilter) ([]*models.DesiredLRPSchedulingInfo, error) { request := models.DesiredLRPsRequest(filter) - response := models.DesiredLRPSchedulingInfosResponse{} - err := c.doRequest(logger, traceID, DesiredLRPSchedulingInfosRoute_r0, nil, nil, &request, &response) + protoResponse := models.ProtoDesiredLRPSchedulingInfosResponse{} + err := c.doRequest(logger, traceID, DesiredLRPSchedulingInfosRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.DesiredLrpSchedulingInfos, response.Error.ToError() } @@ -631,32 +658,36 @@ func (c *client) DesiredLRPSchedulingInfoByProcessGuid(logger lager.Logger, trac request := models.DesiredLRPByProcessGuidRequest{ ProcessGuid: processGuid, } - response := models.DesiredLRPSchedulingInfoByProcessGuidResponse{} - err := c.doRequest(logger, traceID, DesiredLRPSchedulingInfoByProcessGuid_r0, nil, nil, &request, &response) + protoResponse := models.ProtoDesiredLRPSchedulingInfoByProcessGuidResponse{} + err := c.doRequest(logger, traceID, DesiredLRPSchedulingInfoByProcessGuid_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.DesiredLrpSchedulingInfo, response.Error.ToError() } func (c *client) DesiredLRPRoutingInfos(logger lager.Logger, traceID string, filter models.DesiredLRPFilter) ([]*models.DesiredLRP, error) { request := models.DesiredLRPsRequest(filter) - response := models.DesiredLRPsResponse{} - err := c.doRequest(logger, traceID, DesiredLRPRoutingInfosRoute_r0, nil, nil, &request, &response) + protoResponse := models.ProtoDesiredLRPsResponse{} + err := c.doRequest(logger, traceID, DesiredLRPRoutingInfosRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.DesiredLrps, response.Error.ToError() } func (c *client) doDesiredLRPLifecycleRequest(logger lager.Logger, traceID string, route string, request proto.Message) error { - response := models.DesiredLRPLifecycleResponse{} - err := c.doRequest(logger, traceID, route, nil, nil, request, &response) + protoResponse := models.ProtoDesiredLRPLifecycleResponse{} + err := c.doRequest(logger, traceID, route, nil, nil, request, &protoResponse) if err != nil { return err } + + response := protoResponse.FromProto() return response.Error.ToError() } @@ -664,7 +695,7 @@ func (c *client) DesireLRP(logger lager.Logger, traceID string, desiredLRP *mode request := models.DesireLRPRequest{ DesiredLrp: desiredLRP, } - return c.doDesiredLRPLifecycleRequest(logger, traceID, DesireDesiredLRPRoute_r2, &request) + return c.doDesiredLRPLifecycleRequest(logger, traceID, DesireDesiredLRPRoute_r2, request.ToProto()) } func (c *client) UpdateDesiredLRP(logger lager.Logger, traceID string, processGuid string, update *models.DesiredLRPUpdate) error { @@ -672,24 +703,25 @@ func (c *client) UpdateDesiredLRP(logger lager.Logger, traceID string, processGu ProcessGuid: processGuid, Update: update, } - return c.doDesiredLRPLifecycleRequest(logger, traceID, UpdateDesiredLRPRoute_r0, &request) + return c.doDesiredLRPLifecycleRequest(logger, traceID, UpdateDesiredLRPRoute_r0, request.ToProto()) } func (c *client) RemoveDesiredLRP(logger lager.Logger, traceID string, processGuid string) error { request := models.RemoveDesiredLRPRequest{ ProcessGuid: processGuid, } - return c.doDesiredLRPLifecycleRequest(logger, traceID, RemoveDesiredLRPRoute_r0, &request) + return c.doDesiredLRPLifecycleRequest(logger, traceID, RemoveDesiredLRPRoute_r0, request.ToProto()) } func (c *client) Tasks(logger lager.Logger, traceID string) ([]*models.Task, error) { request := models.TasksRequest{} - response := models.TasksResponse{} - err := c.doRequest(logger, traceID, TasksRoute_r3, nil, nil, &request, &response) + protoResponse := models.ProtoTasksResponse{} + err := c.doRequest(logger, traceID, TasksRoute_r3, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.Tasks, response.Error.ToError() } @@ -698,11 +730,13 @@ func (c *client) TasksWithFilter(logger lager.Logger, traceID string, filter mod Domain: filter.Domain, CellId: filter.CellID, } - response := models.TasksResponse{} - err := c.doRequest(logger, traceID, TasksRoute_r3, nil, nil, &request, &response) + protoResponse := models.ProtoTasksResponse{} + err := c.doRequest(logger, traceID, TasksRoute_r3, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + + response := protoResponse.FromProto() return response.Tasks, response.Error.ToError() } @@ -710,12 +744,13 @@ func (c *client) TasksByDomain(logger lager.Logger, traceID string, domain strin request := models.TasksRequest{ Domain: domain, } - response := models.TasksResponse{} - err := c.doRequest(logger, traceID, TasksRoute_r3, nil, nil, &request, &response) + protoResponse := models.ProtoTasksResponse{} + err := c.doRequest(logger, traceID, TasksRoute_r3, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.Tasks, response.Error.ToError() } @@ -723,12 +758,13 @@ func (c *client) TasksByCellID(logger lager.Logger, traceID string, cellId strin request := models.TasksRequest{ CellId: cellId, } - response := models.TasksResponse{} - err := c.doRequest(logger, traceID, TasksRoute_r3, nil, nil, &request, &response) + protoResponse := models.ProtoTasksResponse{} + err := c.doRequest(logger, traceID, TasksRoute_r3, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.Tasks, response.Error.ToError() } @@ -736,21 +772,24 @@ func (c *client) TaskByGuid(logger lager.Logger, traceID string, taskGuid string request := models.TaskByGuidRequest{ TaskGuid: taskGuid, } - response := models.TaskResponse{} - err := c.doRequest(logger, traceID, TaskByGuidRoute_r3, nil, nil, &request, &response) + protoResponse := models.ProtoTaskResponse{} + err := c.doRequest(logger, traceID, TaskByGuidRoute_r3, nil, nil, request.ToProto(), &protoResponse) if err != nil { return nil, err } + response := protoResponse.FromProto() return response.Task, response.Error.ToError() } func (c *client) doTaskLifecycleRequest(logger lager.Logger, traceID string, route string, request proto.Message) error { - response := models.TaskLifecycleResponse{} - err := c.doRequest(logger, traceID, route, nil, nil, request, &response) + protoResponse := models.ProtoTaskLifecycleResponse{} + err := c.doRequest(logger, traceID, route, nil, nil, request, &protoResponse) if err != nil { return err } + + response := protoResponse.FromProto() return response.Error.ToError() } @@ -761,7 +800,7 @@ func (c *client) DesireTask(logger lager.Logger, traceID string, taskGuid, domai Domain: domain, TaskDefinition: taskDef, } - return c.doTaskLifecycleRequest(logger, traceID, route, &request) + return c.doTaskLifecycleRequest(logger, traceID, route, request.ToProto()) } func (c *client) StartTask(logger lager.Logger, traceID string, taskGuid string, cellId string) (bool, error) { @@ -769,11 +808,13 @@ func (c *client) StartTask(logger lager.Logger, traceID string, taskGuid string, TaskGuid: taskGuid, CellId: cellId, } - response := &models.StartTaskResponse{} - err := c.doRequest(logger, traceID, StartTaskRoute_r0, nil, nil, request, response) + protoResponse := models.ProtoStartTaskResponse{} + err := c.doRequest(logger, traceID, StartTaskRoute_r0, nil, nil, request.ToProto(), &protoResponse) if err != nil { return false, err } + + response := protoResponse.FromProto() return response.ShouldStart, response.Error.ToError() } @@ -782,7 +823,7 @@ func (c *client) CancelTask(logger lager.Logger, traceID string, taskGuid string TaskGuid: taskGuid, } route := CancelTaskRoute_r0 - return c.doTaskLifecycleRequest(logger, traceID, route, &request) + return c.doTaskLifecycleRequest(logger, traceID, route, request.ToProto()) } func (c *client) ResolvingTask(logger lager.Logger, traceID string, taskGuid string) error { @@ -790,7 +831,7 @@ func (c *client) ResolvingTask(logger lager.Logger, traceID string, taskGuid str TaskGuid: taskGuid, } route := ResolvingTaskRoute_r0 - return c.doTaskLifecycleRequest(logger, traceID, route, &request) + return c.doTaskLifecycleRequest(logger, traceID, route, request.ToProto()) } func (c *client) DeleteTask(logger lager.Logger, traceID string, taskGuid string) error { @@ -798,7 +839,7 @@ func (c *client) DeleteTask(logger lager.Logger, traceID string, taskGuid string TaskGuid: taskGuid, } route := DeleteTaskRoute_r0 - return c.doTaskLifecycleRequest(logger, traceID, route, &request) + return c.doTaskLifecycleRequest(logger, traceID, route, request.ToProto()) } // Deprecated: use CancelTask instead @@ -808,7 +849,7 @@ func (c *client) FailTask(logger lager.Logger, traceID string, taskGuid string, FailureReason: failureReason, } route := FailTaskRoute_r0 - return c.doTaskLifecycleRequest(logger, traceID, route, &request) + return c.doTaskLifecycleRequest(logger, traceID, route, request.ToProto()) } func (c *client) RejectTask(logger lager.Logger, traceID string, taskGuid string, rejectionReason string) error { @@ -817,7 +858,7 @@ func (c *client) RejectTask(logger lager.Logger, traceID string, taskGuid string RejectionReason: rejectionReason, } route := RejectTaskRoute_r0 - return c.doTaskLifecycleRequest(logger, traceID, route, &request) + return c.doTaskLifecycleRequest(logger, traceID, route, request.ToProto()) } func (c *client) CompleteTask(logger lager.Logger, traceID string, taskGuid string, cellId string, failed bool, failureReason, result string) error { @@ -829,14 +870,14 @@ func (c *client) CompleteTask(logger lager.Logger, traceID string, taskGuid stri Result: result, } route := CompleteTaskRoute_r0 - return c.doTaskLifecycleRequest(logger, traceID, route, &request) + return c.doTaskLifecycleRequest(logger, traceID, route, request.ToProto()) } func (c *client) subscribeToEvents(route string, cellId string) (events.EventSource, error) { request := models.EventsByCellId{ CellId: cellId, } - messageBody, err := proto.Marshal(&request) + messageBody, err := proto.Marshal(request.ToProto()) if err != nil { return nil, err } @@ -888,11 +929,13 @@ func (c *client) SubscribeToInstanceEventsByCellID(logger lager.Logger, cellId s } func (c *client) Cells(logger lager.Logger, traceID string) ([]*models.CellPresence, error) { - response := models.CellsResponse{} - err := c.doRequest(logger, traceID, CellsRoute_r0, nil, nil, nil, &response) + protoResponse := models.ProtoCellsResponse{} + err := c.doRequest(logger, traceID, CellsRoute_r0, nil, nil, nil, &protoResponse) if err != nil { return nil, err } + + response := protoResponse.FromProto() return response.Cells, response.Error.ToError() } @@ -919,12 +962,13 @@ func (c *client) createRequest(traceID string, requestName string, params rata.P } func (c *client) doEvacRequest(logger lager.Logger, traceID string, route string, defaultKeepContainer bool, request proto.Message) (bool, error) { - var response models.EvacuationResponse - err := c.doRequest(logger, traceID, route, nil, nil, request, &response) + protoResponse := models.ProtoEvacuationResponse{} + err := c.doRequest(logger, traceID, route, nil, nil, request, &protoResponse) if err != nil { return defaultKeepContainer, err } + response := protoResponse.FromProto() return response.KeepContainer, response.Error.ToError() } diff --git a/client_test.go b/client_test.go index 37bc9968..02456a73 100644 --- a/client_test.go +++ b/client_test.go @@ -61,33 +61,36 @@ var _ = Describe("Client", func() { It("populates the request", func() { actualLRP := model_helpers.NewValidActualLRP("some-guid", 0) request := models.StartActualLRPRequest{ - ActualLrpKey: &actualLRP.ActualLRPKey, - ActualLrpInstanceKey: &actualLRP.ActualLRPInstanceKey, - ActualLrpNetInfo: &actualLRP.ActualLRPNetInfo, + ActualLrpKey: &actualLRP.ActualLrpKey, + ActualLrpInstanceKey: &actualLRP.ActualLrpInstanceKey, + ActualLrpNetInfo: &actualLRP.ActualLrpNetInfo, ActualLrpInternalRoutes: actualLRP.ActualLrpInternalRoutes, MetricTags: actualLRP.MetricTags, AvailabilityZone: actualLRP.AvailabilityZone, } - request.SetRoutable(false) + routable := false + request.SetRoutable(&routable) + response := &models.ActualLRPLifecycleResponse{Error: nil} bbsServer.AppendHandlers( ghttp.CombineHandlers( ghttp.VerifyRequest("POST", "/v1/actual_lrps/start.r1"), ghttp.VerifyHeader(http.Header{"X-Vcap-Request-Id": []string{"some-trace-id"}}), - ghttp.VerifyProtoRepresenting(&request), - ghttp.RespondWithProto(200, &models.ActualLRPLifecycleResponse{Error: nil}), + ghttp.VerifyProtoRepresenting(request.ToProto()), + ghttp.RespondWithProto(200, response.ToProto()), ), ) - err := internalClient.StartActualLRP(logger, "some-trace-id", &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, false, actualLRP.AvailabilityZone) + err := internalClient.StartActualLRP(logger, "some-trace-id", &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, false, actualLRP.AvailabilityZone) Expect(err).NotTo(HaveOccurred()) }) It("Calls the current endpoint", func() { + response := &models.ActualLRPLifecycleResponse{Error: nil} bbsServer.AppendHandlers( ghttp.CombineHandlers( ghttp.VerifyRequest("POST", "/v1/actual_lrps/start.r1"), ghttp.VerifyHeader(http.Header{"X-Vcap-Request-Id": []string{"some-trace-id"}}), - ghttp.RespondWithProto(200, &models.ActualLRPLifecycleResponse{Error: nil}), + ghttp.RespondWithProto(200, response.ToProto()), ), ) @@ -97,6 +100,15 @@ var _ = Describe("Client", func() { It("Falls back to the deprecated endpoint if the current endpoint returns a 404", func() { actualLRP := model_helpers.NewValidActualLRP("some-guid", 0) + request := &models.StartActualLRPRequest{ + ActualLrpKey: &actualLRP.ActualLrpKey, + ActualLrpInstanceKey: &actualLRP.ActualLrpInstanceKey, + ActualLrpNetInfo: &actualLRP.ActualLrpNetInfo, + ActualLrpInternalRoutes: nil, + MetricTags: nil, + AvailabilityZone: "", + } + response := &models.ActualLRPLifecycleResponse{Error: nil} bbsServer.AppendHandlers( ghttp.CombineHandlers( ghttp.VerifyRequest("POST", "/v1/actual_lrps/start.r1"), @@ -106,19 +118,12 @@ var _ = Describe("Client", func() { ghttp.CombineHandlers( ghttp.VerifyRequest("POST", "/v1/actual_lrps/start"), ghttp.VerifyHeader(http.Header{"X-Vcap-Request-Id": []string{"some-trace-id"}}), - ghttp.VerifyProtoRepresenting(&models.StartActualLRPRequest{ - ActualLrpKey: &actualLRP.ActualLRPKey, - ActualLrpInstanceKey: &actualLRP.ActualLRPInstanceKey, - ActualLrpNetInfo: &actualLRP.ActualLRPNetInfo, - ActualLrpInternalRoutes: nil, - MetricTags: nil, - AvailabilityZone: "", - }), - ghttp.RespondWithProto(200, &models.ActualLRPLifecycleResponse{Error: nil}), + ghttp.VerifyProtoRepresenting(request.ToProto()), + ghttp.RespondWithProto(200, response.ToProto()), ), ) - err := internalClient.StartActualLRP(logger, "some-trace-id", &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, actualLRP.GetRoutable(), actualLRP.AvailabilityZone) + err := internalClient.StartActualLRP(logger, "some-trace-id", &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, *actualLRP.GetRoutable(), actualLRP.AvailabilityZone) Expect(err).NotTo(HaveOccurred()) }) @@ -157,32 +162,35 @@ var _ = Describe("Client", func() { Context("evacuateRunningActualLrp", func() { It("populates the request", func() { actualLRP := model_helpers.NewValidActualLRP("some-guid", 0) + request := &models.EvacuateRunningActualLRPRequest{ + ActualLrpKey: &actualLRP.ActualLrpKey, + ActualLrpInstanceKey: &actualLRP.ActualLrpInstanceKey, + ActualLrpNetInfo: &actualLRP.ActualLrpNetInfo, + ActualLrpInternalRoutes: actualLRP.ActualLrpInternalRoutes, + MetricTags: actualLRP.MetricTags, + AvailabilityZone: actualLRP.AvailabilityZone, + Routable: actualLRP.GetRoutable(), + } + response := &models.EvacuationResponse{KeepContainer: true, Error: nil} bbsServer.AppendHandlers( ghttp.CombineHandlers( ghttp.VerifyRequest("POST", "/v1/actual_lrps/evacuate_running.r1"), ghttp.VerifyHeader(http.Header{"X-Vcap-Request-Id": []string{"some-trace-id"}}), - ghttp.VerifyProtoRepresenting(&models.EvacuateRunningActualLRPRequest{ - ActualLrpKey: &actualLRP.ActualLRPKey, - ActualLrpInstanceKey: &actualLRP.ActualLRPInstanceKey, - ActualLrpNetInfo: &actualLRP.ActualLRPNetInfo, - ActualLrpInternalRoutes: actualLRP.ActualLrpInternalRoutes, - MetricTags: actualLRP.MetricTags, - AvailabilityZone: actualLRP.AvailabilityZone, - OptionalRoutable: &models.EvacuateRunningActualLRPRequest_Routable{Routable: actualLRP.GetRoutable()}, - }), - ghttp.RespondWithProto(200, &models.EvacuationResponse{KeepContainer: true, Error: nil}), + ghttp.VerifyProtoRepresenting(request.ToProto()), + ghttp.RespondWithProto(200, response.ToProto()), ), ) - _, err := internalClient.EvacuateRunningActualLRP(logger, "some-trace-id", &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, actualLRP.GetRoutable(), actualLRP.AvailabilityZone) + _, err := internalClient.EvacuateRunningActualLRP(logger, "some-trace-id", &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, *actualLRP.GetRoutable(), actualLRP.AvailabilityZone) Expect(err).NotTo(HaveOccurred()) }) It("Calls the current endpoint", func() { + response := &models.EvacuationResponse{KeepContainer: true, Error: nil} bbsServer.AppendHandlers( ghttp.CombineHandlers( ghttp.VerifyRequest("POST", "/v1/actual_lrps/evacuate_running.r1"), ghttp.VerifyHeader(http.Header{"X-Vcap-Request-Id": []string{"some-trace-id"}}), - ghttp.RespondWithProto(200, &models.EvacuationResponse{KeepContainer: true, Error: nil}), + ghttp.RespondWithProto(200, response.ToProto()), ), ) @@ -192,6 +200,16 @@ var _ = Describe("Client", func() { It("Falls back to the deprecated endpoint if the current endpoint returns a 404", func() { actualLRP := model_helpers.NewValidActualLRP("some-guid", 0) + request := &models.EvacuateRunningActualLRPRequest{ + ActualLrpKey: &actualLRP.ActualLrpKey, + ActualLrpInstanceKey: &actualLRP.ActualLrpInstanceKey, + ActualLrpNetInfo: &actualLRP.ActualLrpNetInfo, + ActualLrpInternalRoutes: nil, + MetricTags: nil, + Routable: nil, + AvailabilityZone: "", + } + response := &models.EvacuationResponse{KeepContainer: true, Error: nil} bbsServer.AppendHandlers( ghttp.CombineHandlers( ghttp.VerifyRequest("POST", "/v1/actual_lrps/evacuate_running.r1"), @@ -201,20 +219,12 @@ var _ = Describe("Client", func() { ghttp.CombineHandlers( ghttp.VerifyRequest("POST", "/v1/actual_lrps/evacuate_running"), ghttp.VerifyHeader(http.Header{"X-Vcap-Request-Id": []string{"some-trace-id"}}), - ghttp.VerifyProtoRepresenting(&models.EvacuateRunningActualLRPRequest{ - ActualLrpKey: &actualLRP.ActualLRPKey, - ActualLrpInstanceKey: &actualLRP.ActualLRPInstanceKey, - ActualLrpNetInfo: &actualLRP.ActualLRPNetInfo, - ActualLrpInternalRoutes: nil, - MetricTags: nil, - OptionalRoutable: nil, - AvailabilityZone: "", - }), - ghttp.RespondWithProto(200, &models.EvacuationResponse{KeepContainer: true, Error: nil}), + ghttp.VerifyProtoRepresenting(request.ToProto()), + ghttp.RespondWithProto(200, response.ToProto()), ), ) - _, err := internalClient.EvacuateRunningActualLRP(logger, "some-trace-id", &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, false, actualLRP.AvailabilityZone) + _, err := internalClient.EvacuateRunningActualLRP(logger, "some-trace-id", &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, false, actualLRP.AvailabilityZone) Expect(err).NotTo(HaveOccurred()) }) @@ -342,6 +352,17 @@ var _ = Describe("Client", func() { }) JustBeforeEach(func() { + //lint:ignore SA1019 - testing of deprecated code + response := &models.ActualLRPGroupsResponse{ + //lint:ignore SA1019 - testing of deprecated code + ActualLrpGroups: []*models.ActualLRPGroup{ + { + Instance: &models.ActualLRP{ + State: "running", + }, + }, + }, + } bbsServer.AppendHandlers( ghttp.CombineHandlers( ghttp.VerifyRequest("POST", "/v1/actual_lrp_groups/list"), @@ -349,17 +370,8 @@ var _ = Describe("Client", func() { func(w http.ResponseWriter, req *http.Request) { <-blockCh }, - //lint:ignore SA1019 - testing of deprecated code - ghttp.RespondWithProto(200, &models.ActualLRPGroupsResponse{ - //lint:ignore SA1019 - testing of deprecated code - ActualLrpGroups: []*models.ActualLRPGroup{ - { - Instance: &models.ActualLRP{ - State: "running", - }, - }, - }, - }), + // lint:ignore SA1019 - testing of deprecated code + ghttp.RespondWithProto(200, response.ToProto()), ), ) }) diff --git a/cmd/bbs/actual_lrp_test.go b/cmd/bbs/actual_lrp_test.go index 333bd137..fa870fe4 100644 --- a/cmd/bbs/actual_lrp_test.go +++ b/cmd/bbs/actual_lrp_test.go @@ -126,68 +126,70 @@ var _ = Describe("ActualLRP API", func() { crashingLRPKey = models.NewActualLRPKey(crashingProcessGuid, crashingIndex, crashingDomain) crashingLRPInstanceKey = models.NewActualLRPInstanceKey(crashingInstanceGuid, otherCellID) + routableTrue := true + routableFalse := false baseLRP = &models.ActualLRP{ - ActualLRPKey: baseLRPKey, - ActualLRPInstanceKey: baseLRPInstanceKey, - ActualLRPNetInfo: netInfo, + ActualLrpKey: baseLRPKey, + ActualLrpInstanceKey: baseLRPInstanceKey, + ActualLrpNetInfo: netInfo, State: models.ActualLRPStateRunning, ActualLrpInternalRoutes: internalRoutes, MetricTags: metricTags, AvailabilityZone: availabilityZone, } - baseLRP.SetRoutable(true) + baseLRP.SetRoutable(&routableTrue) evacuatingLRP = &models.ActualLRP{ - ActualLRPKey: evacuatingLRPKey, - ActualLRPInstanceKey: evacuatingLRPInstanceKey, - ActualLRPNetInfo: netInfo, + ActualLrpKey: evacuatingLRPKey, + ActualLrpInstanceKey: evacuatingLRPInstanceKey, + ActualLrpNetInfo: netInfo, State: models.ActualLRPStateRunning, Presence: models.ActualLRP_Evacuating, ActualLrpInternalRoutes: internalRoutes, MetricTags: metricTags, AvailabilityZone: availabilityZone, } - evacuatingLRP.SetRoutable(true) + evacuatingLRP.SetRoutable(&routableTrue) evacuatingInstanceLRP = &models.ActualLRP{ - ActualLRPKey: evacuatingLRPKey, + ActualLrpKey: evacuatingLRPKey, State: models.ActualLRPStateUnclaimed, ActualLrpInternalRoutes: internalRoutes, MetricTags: metricTags, AvailabilityZone: availabilityZone, } - evacuatingInstanceLRP.SetRoutable(true) + evacuatingInstanceLRP.SetRoutable(&routableTrue) otherLRP0 = &models.ActualLRP{ - ActualLRPKey: otherLRP0Key, - ActualLRPInstanceKey: otherLRPInstanceKey, - ActualLRPNetInfo: netInfo, + ActualLrpKey: otherLRP0Key, + ActualLrpInstanceKey: otherLRPInstanceKey, + ActualLrpNetInfo: netInfo, State: models.ActualLRPStateRunning, ActualLrpInternalRoutes: internalRoutes, MetricTags: metricTags, AvailabilityZone: availabilityZone, } - otherLRP0.SetRoutable(true) + otherLRP0.SetRoutable(&routableTrue) otherLRP1 = &models.ActualLRP{ - ActualLRPKey: otherLRP1Key, - ActualLRPInstanceKey: otherLRPInstanceKey, - ActualLRPNetInfo: netInfo, + ActualLrpKey: otherLRP1Key, + ActualLrpInstanceKey: otherLRPInstanceKey, + ActualLrpNetInfo: netInfo, State: models.ActualLRPStateRunning, ActualLrpInternalRoutes: internalRoutes, MetricTags: metricTags, AvailabilityZone: availabilityZone, } - otherLRP1.SetRoutable(false) + otherLRP1.SetRoutable(&routableFalse) unclaimedLRP = &models.ActualLRP{ - ActualLRPKey: unclaimedLRPKey, + ActualLrpKey: unclaimedLRPKey, State: models.ActualLRPStateUnclaimed, } - unclaimedLRP.SetRoutable(false) + unclaimedLRP.SetRoutable(&routableFalse) crashingLRP = &models.ActualLRP{ - ActualLRPKey: crashingLRPKey, + ActualLrpKey: crashingLRPKey, State: models.ActualLRPStateCrashed, CrashReason: "crash", CrashCount: 3, @@ -195,63 +197,63 @@ var _ = Describe("ActualLRP API", func() { MetricTags: metricTags, AvailabilityZone: availabilityZone, } - crashingLRP.SetRoutable(false) + crashingLRP.SetRoutable(&routableFalse) retiredLRP = &models.ActualLRP{ - ActualLRPKey: retiredLRPKey, + ActualLrpKey: retiredLRPKey, State: models.ActualLRPStateRunning, ActualLrpInternalRoutes: internalRoutes, MetricTags: metricTags, AvailabilityZone: availabilityZone, } - retiredLRP.SetRoutable(false) + retiredLRP.SetRoutable(&routableFalse) var err error - baseDesiredLRP := model_helpers.NewValidDesiredLRP(baseLRP.ProcessGuid) + baseDesiredLRP := model_helpers.NewValidDesiredLRP(baseLRP.ActualLrpKey.ProcessGuid) baseDesiredLRP.Domain = baseDomain err = client.DesireLRP(logger, "some-trace-id", baseDesiredLRP) Expect(err).NotTo(HaveOccurred()) - err = client.StartActualLRP(logger, "some-trace-id", &baseLRPKey, &baseLRPInstanceKey, &netInfo, internalRoutes, metricTags, baseLRP.GetRoutable(), availabilityZone) + err = client.StartActualLRP(logger, "some-trace-id", &baseLRPKey, &baseLRPInstanceKey, &netInfo, internalRoutes, metricTags, *baseLRP.GetRoutable(), availabilityZone) Expect(err).NotTo(HaveOccurred()) - otherDesiredLRP := model_helpers.NewValidDesiredLRP(otherLRP0.ProcessGuid) + otherDesiredLRP := model_helpers.NewValidDesiredLRP(otherLRP0.ActualLrpKey.ProcessGuid) otherDesiredLRP.Domain = otherDomain Expect(client.DesireLRP(logger, "some-trace-id", otherDesiredLRP)).To(Succeed()) - err = client.StartActualLRP(logger, "some-trace-id", &otherLRP0Key, &otherLRPInstanceKey, &netInfo, internalRoutes, metricTags, otherLRP0.GetRoutable(), availabilityZone) + err = client.StartActualLRP(logger, "some-trace-id", &otherLRP0Key, &otherLRPInstanceKey, &netInfo, internalRoutes, metricTags, *otherLRP0.GetRoutable(), availabilityZone) Expect(err).NotTo(HaveOccurred()) - err = client.StartActualLRP(logger, "some-trace-id", &otherLRP1Key, &otherLRPInstanceKey, &netInfo, internalRoutes, metricTags, otherLRP1.GetRoutable(), availabilityZone) + err = client.StartActualLRP(logger, "some-trace-id", &otherLRP1Key, &otherLRPInstanceKey, &netInfo, internalRoutes, metricTags, *otherLRP1.GetRoutable(), availabilityZone) Expect(err).NotTo(HaveOccurred()) - evacuatingDesiredLRP := model_helpers.NewValidDesiredLRP(evacuatingLRP.ProcessGuid) + evacuatingDesiredLRP := model_helpers.NewValidDesiredLRP(evacuatingLRP.ActualLrpKey.ProcessGuid) evacuatingDesiredLRP.Domain = evacuatingDomain err = client.DesireLRP(logger, "some-trace-id", evacuatingDesiredLRP) Expect(err).NotTo(HaveOccurred()) - err = client.StartActualLRP(logger, "some-trace-id", &evacuatingLRPKey, &evacuatingLRPInstanceKey, &netInfo, internalRoutes, metricTags, evacuatingLRP.GetRoutable(), availabilityZone) + err = client.StartActualLRP(logger, "some-trace-id", &evacuatingLRPKey, &evacuatingLRPInstanceKey, &netInfo, internalRoutes, metricTags, *evacuatingLRP.GetRoutable(), availabilityZone) Expect(err).NotTo(HaveOccurred()) _, err = client.EvacuateRunningActualLRP(logger, "some-trace-id", &evacuatingLRPKey, &evacuatingLRPInstanceKey, &netInfo, internalRoutes, metricTags, true, availabilityZone) Expect(err).NotTo(HaveOccurred()) - unclaimedDesiredLRP := model_helpers.NewValidDesiredLRP(unclaimedLRP.ProcessGuid) + unclaimedDesiredLRP := model_helpers.NewValidDesiredLRP(unclaimedLRP.ActualLrpKey.ProcessGuid) unclaimedDesiredLRP.Domain = unclaimedDomain err = client.DesireLRP(logger, "some-trace-id", unclaimedDesiredLRP) Expect(err).NotTo(HaveOccurred()) - crashingDesiredLRP := model_helpers.NewValidDesiredLRP(crashingLRP.ProcessGuid) + crashingDesiredLRP := model_helpers.NewValidDesiredLRP(crashingLRP.ActualLrpKey.ProcessGuid) crashingDesiredLRP.Domain = crashingDomain Expect(client.DesireLRP(logger, "some-trace-id", crashingDesiredLRP)).To(Succeed()) for i := 0; i < 3; i++ { - err = client.StartActualLRP(logger, "some-trace-id", &crashingLRPKey, &crashingLRPInstanceKey, &netInfo, internalRoutes, metricTags, crashingLRP.GetRoutable(), availabilityZone) + err = client.StartActualLRP(logger, "some-trace-id", &crashingLRPKey, &crashingLRPInstanceKey, &netInfo, internalRoutes, metricTags, *crashingLRP.GetRoutable(), availabilityZone) Expect(err).NotTo(HaveOccurred()) err = client.CrashActualLRP(logger, "some-trace-id", &crashingLRPKey, &crashingLRPInstanceKey, "crash") Expect(err).NotTo(HaveOccurred()) } - retiredDesiredLRP := model_helpers.NewValidDesiredLRP(retiredLRP.ProcessGuid) + retiredDesiredLRP := model_helpers.NewValidDesiredLRP(retiredLRP.ActualLrpKey.ProcessGuid) retiredDesiredLRP.Domain = retiredDomain err = client.DesireLRP(logger, "some-trace-id", retiredDesiredLRP) Expect(err).NotTo(HaveOccurred()) - err = client.StartActualLRP(logger, "some-trace-id", &retiredLRPKey, &retiredLRPInstanceKey, &netInfo, internalRoutes, metricTags, retiredLRP.GetRoutable(), availabilityZone) + err = client.StartActualLRP(logger, "some-trace-id", &retiredLRPKey, &retiredLRPInstanceKey, &netInfo, internalRoutes, metricTags, *retiredLRP.GetRoutable(), availabilityZone) Expect(err).NotTo(HaveOccurred()) retireErr := client.RetireActualLRP(logger, "some-trace-id", &retiredLRPKey) Expect(retireErr).NotTo(HaveOccurred()) @@ -378,22 +380,23 @@ var _ = Describe("ActualLRP API", func() { tlsNetInfo = models.NewActualLRPNetInfo("127.0.0.1", "10.10.10.10", models.ActualLRPNetInfo_PreferredAddressHost, models.NewPortMappingWithTLSProxy(8080, 80, 60042, 443)) tlsEnabledLRP = &models.ActualLRP{ - ActualLRPKey: tlsEnabledLRPKey, - ActualLRPInstanceKey: tlsEnabledLRPInstanceKey, - ActualLRPNetInfo: tlsNetInfo, + ActualLrpKey: tlsEnabledLRPKey, + ActualLrpInstanceKey: tlsEnabledLRPInstanceKey, + ActualLrpNetInfo: tlsNetInfo, State: models.ActualLRPStateRunning, ActualLrpInternalRoutes: internalRoutes, MetricTags: metricTags, AvailabilityZone: availabilityZone, } - tlsEnabledLRP.SetRoutable(true) + routable := true + tlsEnabledLRP.SetRoutable(&routable) - tlsEnabledDesiredLRP := model_helpers.NewValidDesiredLRP(tlsEnabledLRP.ProcessGuid) + tlsEnabledDesiredLRP := model_helpers.NewValidDesiredLRP(tlsEnabledLRP.ActualLrpKey.ProcessGuid) tlsEnabledDesiredLRP.Domain = tlsEnabledDomain err := client.DesireLRP(logger, "some-trace-id", tlsEnabledDesiredLRP) Expect(err).NotTo(HaveOccurred()) - err = client.StartActualLRP(logger, "some-trace-id", &tlsEnabledLRPKey, &tlsEnabledLRPInstanceKey, &tlsNetInfo, internalRoutes, metricTags, tlsEnabledLRP.GetRoutable(), availabilityZone) + err = client.StartActualLRP(logger, "some-trace-id", &tlsEnabledLRPKey, &tlsEnabledLRPInstanceKey, &tlsNetInfo, internalRoutes, metricTags, *tlsEnabledLRP.GetRoutable(), availabilityZone) Expect(err).NotTo(HaveOccurred()) }) @@ -477,22 +480,23 @@ var _ = Describe("ActualLRP API", func() { tlsNetInfo = models.NewActualLRPNetInfo("127.0.0.1", "10.10.10.10", models.ActualLRPNetInfo_PreferredAddressHost, models.NewPortMappingWithTLSProxy(8080, 80, 60042, 443)) tlsEnabledLRP = &models.ActualLRP{ - ActualLRPKey: tlsEnabledLRPKey, - ActualLRPInstanceKey: tlsEnabledLRPInstanceKey, - ActualLRPNetInfo: tlsNetInfo, + ActualLrpKey: tlsEnabledLRPKey, + ActualLrpInstanceKey: tlsEnabledLRPInstanceKey, + ActualLrpNetInfo: tlsNetInfo, State: models.ActualLRPStateRunning, ActualLrpInternalRoutes: internalRoutes, MetricTags: metricTags, AvailabilityZone: availabilityZone, } - tlsEnabledLRP.SetRoutable(true) + routable := true + tlsEnabledLRP.SetRoutable(&routable) - tlsEnabledDesiredLRP := model_helpers.NewValidDesiredLRP(tlsEnabledLRP.ProcessGuid) + tlsEnabledDesiredLRP := model_helpers.NewValidDesiredLRP(tlsEnabledLRP.ActualLrpKey.ProcessGuid) tlsEnabledDesiredLRP.Domain = tlsEnabledDomain err := client.DesireLRP(logger, "some-trace-id", tlsEnabledDesiredLRP) Expect(err).NotTo(HaveOccurred()) - err = client.StartActualLRP(logger, "some-trace-id", &tlsEnabledLRPKey, &tlsEnabledLRPInstanceKey, &tlsNetInfo, internalRoutes, metricTags, tlsEnabledLRP.GetRoutable(), availabilityZone) + err = client.StartActualLRP(logger, "some-trace-id", &tlsEnabledLRPKey, &tlsEnabledLRPInstanceKey, &tlsNetInfo, internalRoutes, metricTags, *tlsEnabledLRP.GetRoutable(), availabilityZone) Expect(err).NotTo(HaveOccurred()) }) @@ -564,7 +568,7 @@ var _ = Describe("ActualLRP API", func() { expectedActualLRP := *unclaimedLRP expectedActualLRP.State = models.ActualLRPStateClaimed - expectedActualLRP.ActualLRPInstanceKey = instanceKey + expectedActualLRP.ActualLrpInstanceKey = instanceKey fetchedActualLRPGroup, err := client.ActualLRPs(logger, "some-trace-id", models.ActualLRPFilter{ProcessGuid: unclaimedProcessGuid, Index: &unclaimedIndex}) Expect(err).NotTo(HaveOccurred()) @@ -592,11 +596,12 @@ var _ = Describe("ActualLRP API", func() { expectedActualLRP := *unclaimedLRP expectedActualLRP.State = models.ActualLRPStateRunning - expectedActualLRP.ActualLRPInstanceKey = instanceKey - expectedActualLRP.ActualLRPNetInfo = netInfo + expectedActualLRP.ActualLrpInstanceKey = instanceKey + expectedActualLRP.ActualLrpNetInfo = netInfo expectedActualLRP.ActualLrpInternalRoutes = internalRoutes expectedActualLRP.MetricTags = metricTags - expectedActualLRP.SetRoutable(true) + routable := true + expectedActualLRP.SetRoutable(&routable) expectedActualLRP.AvailabilityZone = availabilityZone fetchedActualLRPGroup, err := client.ActualLRPs(logger, "some-trace-id", models.ActualLRPFilter{ProcessGuid: unclaimedProcessGuid, Index: &unclaimedIndex}) diff --git a/cmd/bbs/desired_lrp_test.go b/cmd/bbs/desired_lrp_test.go index f88b493e..77aaeb6f 100644 --- a/cmd/bbs/desired_lrp_test.go +++ b/cmd/bbs/desired_lrp_test.go @@ -202,7 +202,7 @@ var _ = Describe("DesiredLRP API", func() { JustBeforeEach(func() { expectedSchedulingInfo = desiredLRPs["domain-1"][0].DesiredLRPSchedulingInfo() - schedulingInfoByProcessGuid, getErr = client.DesiredLRPSchedulingInfoByProcessGuid(logger, "some-trace-id", expectedSchedulingInfo.GetProcessGuid()) + schedulingInfoByProcessGuid, getErr = client.DesiredLRPSchedulingInfoByProcessGuid(logger, "some-trace-id", expectedSchedulingInfo.DesiredLrpKey.GetProcessGuid()) schedulingInfoByProcessGuid.ModificationTag.Epoch = "epoch" }) @@ -362,7 +362,8 @@ var _ = Describe("DesiredLRP API", func() { err := client.DesireLRP(logger, "some-trace-id", desiredLRP) Expect(err).NotTo(HaveOccurred()) update := &models.DesiredLRPUpdate{} - update.SetInstances(3) + instances := int32(3) + update.SetInstances(&instances) updateErr = client.UpdateDesiredLRP(logger, "some-trace-id", "super-lrp", update) }) diff --git a/cmd/bbs/evacuation_test.go b/cmd/bbs/evacuation_test.go index 8b774942..81d1c3e0 100644 --- a/cmd/bbs/evacuation_test.go +++ b/cmd/bbs/evacuation_test.go @@ -20,30 +20,30 @@ var _ = Describe("Evacuation API", func() { actual = model_helpers.NewValidActualLRP("some-process-guid", 1) actual.State = models.ActualLRPStateRunning - desiredLRP := model_helpers.NewValidDesiredLRP(actual.ProcessGuid) + desiredLRP := model_helpers.NewValidDesiredLRP(actual.ActualLrpKey.ProcessGuid) desiredLRP.Instances = 2 Expect(client.DesireLRP(logger, "some-trace-id", desiredLRP)).To(Succeed()) - Expect(client.ClaimActualLRP(logger, "some-trace-id", &actual.ActualLRPKey, &actual.ActualLRPInstanceKey)).To(Succeed()) - _, err := client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", actual.ProcessGuid, int(actual.Index)) + Expect(client.ClaimActualLRP(logger, "some-trace-id", &actual.ActualLrpKey, &actual.ActualLrpInstanceKey)).To(Succeed()) + _, err := client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", actual.ActualLrpKey.ProcessGuid, int(actual.ActualLrpKey.Index)) Expect(err).NotTo(HaveOccurred()) }) Describe("RemoveEvacuatingActualLRP", func() { Context("when the lrp is running", func() { BeforeEach(func() { - Expect(client.StartActualLRP(logger, "some-trace-id", &actual.ActualLRPKey, &actual.ActualLRPInstanceKey, &actual.ActualLRPNetInfo, []*models.ActualLRPInternalRoute{}, map[string]string{}, false, "")).To(Succeed()) + Expect(client.StartActualLRP(logger, "some-trace-id", &actual.ActualLrpKey, &actual.ActualLrpInstanceKey, &actual.ActualLrpNetInfo, []*models.ActualLRPInternalRoute{}, map[string]string{}, false, "")).To(Succeed()) }) It("removes the evacuating actual_lrp", func() { - keepContainer, err := client.EvacuateRunningActualLRP(logger, "some-trace-id", &actual.ActualLRPKey, &actual.ActualLRPInstanceKey, &actual.ActualLRPNetInfo, []*models.ActualLRPInternalRoute{}, map[string]string{}, false, "") + keepContainer, err := client.EvacuateRunningActualLRP(logger, "some-trace-id", &actual.ActualLrpKey, &actual.ActualLrpInstanceKey, &actual.ActualLrpNetInfo, []*models.ActualLRPInternalRoute{}, map[string]string{}, false, "") Expect(keepContainer).To(BeTrue()) Expect(err).NotTo(HaveOccurred()) - err = client.RemoveEvacuatingActualLRP(logger, "some-trace-id", &actual.ActualLRPKey, &actual.ActualLRPInstanceKey) + err = client.RemoveEvacuatingActualLRP(logger, "some-trace-id", &actual.ActualLrpKey, &actual.ActualLrpInstanceKey) Expect(err).NotTo(HaveOccurred()) - group, err := client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", actual.ProcessGuid, int(actual.Index)) + group, err := client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", actual.ActualLrpKey.ProcessGuid, int(actual.ActualLrpKey.Index)) Expect(err).ToNot(HaveOccurred()) Expect(group.Evacuating).To(BeNil()) }) @@ -69,7 +69,7 @@ var _ = Describe("Evacuation API", func() { } }() - err = client.RemoveEvacuatingActualLRP(logger, "some-trace-id", &actual.ActualLRPKey, &actual.ActualLRPInstanceKey) + err = client.RemoveEvacuatingActualLRP(logger, "some-trace-id", &actual.ActualLrpKey, &actual.ActualLrpInstanceKey) Expect(err).To(Equal(models.ErrResourceNotFound)) Consistently(ch).ShouldNot(Receive()) }) @@ -82,11 +82,11 @@ var _ = Describe("Evacuation API", func() { Describe("EvacuateClaimedActualLRP", func() { It("removes the claimed actual_lrp without evacuating", func() { - keepContainer, evacuateErr := client.EvacuateClaimedActualLRP(logger, "some-trace-id", &actual.ActualLRPKey, &actual.ActualLRPInstanceKey) + keepContainer, evacuateErr := client.EvacuateClaimedActualLRP(logger, "some-trace-id", &actual.ActualLrpKey, &actual.ActualLrpInstanceKey) Expect(keepContainer).To(BeFalse()) Expect(evacuateErr).NotTo(HaveOccurred()) - actualLRPGroup, err := client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", actual.ProcessGuid, int(actual.Index)) + actualLRPGroup, err := client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", actual.ActualLrpKey.ProcessGuid, int(actual.ActualLrpKey.Index)) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPGroup.Evacuating).To(BeNil()) Expect(actualLRPGroup.Instance).NotTo(BeNil()) @@ -96,16 +96,16 @@ var _ = Describe("Evacuation API", func() { Describe("EvacuateRunningActualLRP", func() { BeforeEach(func() { - err := client.StartActualLRP(logger, "some-trace-id", &actual.ActualLRPKey, &actual.ActualLRPInstanceKey, &actual.ActualLRPNetInfo, []*models.ActualLRPInternalRoute{}, map[string]string{}, false, "") + err := client.StartActualLRP(logger, "some-trace-id", &actual.ActualLrpKey, &actual.ActualLrpInstanceKey, &actual.ActualLrpNetInfo, []*models.ActualLRPInternalRoute{}, map[string]string{}, false, "") Expect(err).NotTo(HaveOccurred()) }) It("runs the evacuating ActualLRP and unclaims the instance ActualLRP", func() { - keepContainer, err := client.EvacuateRunningActualLRP(logger, "some-trace-id", &actual.ActualLRPKey, &actual.ActualLRPInstanceKey, &actual.ActualLRPNetInfo, []*models.ActualLRPInternalRoute{}, map[string]string{}, false, "") + keepContainer, err := client.EvacuateRunningActualLRP(logger, "some-trace-id", &actual.ActualLrpKey, &actual.ActualLrpInstanceKey, &actual.ActualLrpNetInfo, []*models.ActualLRPInternalRoute{}, map[string]string{}, false, "") Expect(keepContainer).To(BeTrue()) Expect(err).NotTo(HaveOccurred()) - actualLRPGroup, err := client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", actual.ProcessGuid, int(actual.Index)) + actualLRPGroup, err := client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", actual.ActualLrpKey.ProcessGuid, int(actual.ActualLrpKey.Index)) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPGroup.Evacuating).NotTo(BeNil()) Expect(actualLRPGroup.Instance).NotTo(BeNil()) @@ -116,31 +116,31 @@ var _ = Describe("Evacuation API", func() { Describe("EvacuateStoppedActualLRP", func() { BeforeEach(func() { - err := client.StartActualLRP(logger, "some-trace-id", &actual.ActualLRPKey, &actual.ActualLRPInstanceKey, &actual.ActualLRPNetInfo, []*models.ActualLRPInternalRoute{}, map[string]string{}, false, "") + err := client.StartActualLRP(logger, "some-trace-id", &actual.ActualLrpKey, &actual.ActualLrpInstanceKey, &actual.ActualLrpNetInfo, []*models.ActualLRPInternalRoute{}, map[string]string{}, false, "") Expect(err).NotTo(HaveOccurred()) }) It("deletes the container and both actualLRPs", func() { - keepContainer, err := client.EvacuateStoppedActualLRP(logger, "some-trace-id", &actual.ActualLRPKey, &actual.ActualLRPInstanceKey) + keepContainer, err := client.EvacuateStoppedActualLRP(logger, "some-trace-id", &actual.ActualLrpKey, &actual.ActualLrpInstanceKey) Expect(keepContainer).To(BeFalse()) Expect(err).NotTo(HaveOccurred()) - _, err = client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", actual.ProcessGuid, int(actual.Index)) + _, err = client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", actual.ActualLrpKey.ProcessGuid, int(actual.ActualLrpKey.Index)) Expect(err).To(Equal(models.ErrResourceNotFound)) }) }) Describe("EvacuateCrashedActualLRP", func() { BeforeEach(func() { - err := client.StartActualLRP(logger, "some-trace-id", &actual.ActualLRPKey, &actual.ActualLRPInstanceKey, &actual.ActualLRPNetInfo, []*models.ActualLRPInternalRoute{}, map[string]string{}, false, "") + err := client.StartActualLRP(logger, "some-trace-id", &actual.ActualLrpKey, &actual.ActualLrpInstanceKey, &actual.ActualLrpNetInfo, []*models.ActualLRPInternalRoute{}, map[string]string{}, false, "") Expect(err).NotTo(HaveOccurred()) }) It("removes the crashed evacuating LRP and unclaims the instance ActualLRP", func() { - keepContainer, evacuateErr := client.EvacuateCrashedActualLRP(logger, "some-trace-id", &actual.ActualLRPKey, &actual.ActualLRPInstanceKey, "some-reason") + keepContainer, evacuateErr := client.EvacuateCrashedActualLRP(logger, "some-trace-id", &actual.ActualLrpKey, &actual.ActualLrpInstanceKey, "some-reason") Expect(keepContainer).Should(BeFalse()) Expect(evacuateErr).NotTo(HaveOccurred()) - actualLRPGroup, err := client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", actual.ProcessGuid, int(actual.Index)) + actualLRPGroup, err := client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", actual.ActualLrpKey.ProcessGuid, int(actual.ActualLrpKey.Index)) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPGroup.Evacuating).To(BeNil()) Expect(actualLRPGroup.Instance).ToNot(BeNil()) diff --git a/cmd/bbs/event_stream_test.go b/cmd/bbs/event_stream_test.go index 3dd562ed..c5cf2947 100644 --- a/cmd/bbs/event_stream_test.go +++ b/cmd/bbs/event_stream_test.go @@ -136,7 +136,7 @@ var _ = Describe("Events API", func() { getEvacuatingLRPFromList := func(lrps []*models.ActualLRP) models.ActualLRPInstanceKey { for _, lrp := range lrps { if lrp.Presence == models.ActualLRP_Evacuating { - return lrp.ActualLRPInstanceKey + return lrp.ActualLrpInstanceKey } } return models.ActualLRPInstanceKey{} @@ -184,7 +184,7 @@ var _ = Describe("Events API", func() { var ce *models.ActualLRPInstanceChangedEvent Eventually(eventChannel).Should(Receive(&ce)) - Expect(ce.ActualLRPInstanceKey).To(Equal(actualLRPGroup[0].ActualLRPInstanceKey)) + Expect(ce.ActualLrpInstanceKey).To(Equal(actualLRPGroup[0].ActualLrpInstanceKey)) Expect(ce.Before.State).To(Equal(models.ActualLRPStateUnclaimed)) Expect(ce.After.State).To(Equal(models.ActualLRPStateUnclaimed)) Expect(ce.After.PlacementError).ToNot(Equal("")) @@ -197,7 +197,7 @@ var _ = Describe("Events API", func() { Expect(err).NotTo(HaveOccurred()) Eventually(eventChannel).Should(Receive(&ce)) - Expect(ce.ActualLRPInstanceKey).To(Equal(actualLRPGroup[0].ActualLRPInstanceKey)) + Expect(ce.ActualLrpInstanceKey).To(Equal(actualLRPGroup[0].ActualLrpInstanceKey)) Expect(ce.Before.State).To(Equal(models.ActualLRPStateUnclaimed)) Expect(ce.After.State).To(Equal(models.ActualLRPStateClaimed)) @@ -217,20 +217,20 @@ var _ = Describe("Events API", func() { evacuatingLRP := getEvacuatingLRPFromList(evacuatingLRPGroup) Eventually(eventChannel).Should(Receive(&ce)) - Expect(ce.ActualLRPInstanceKey).To(Equal(evacuatingLRP)) + Expect(ce.ActualLrpInstanceKey).To(Equal(evacuatingLRP)) Expect(ce.Before.Presence).To(Equal(models.ActualLRP_Ordinary)) Expect(ce.After.Presence).To(Equal(models.ActualLRP_Evacuating)) Eventually(eventChannel).Should(Receive(&created)) - Expect(created.ActualLrp.ActualLRPKey).To(Equal(actualLRPGroup[0].ActualLRPKey)) + Expect(created.ActualLrp.ActualLrpKey).To(Equal(actualLRPGroup[0].ActualLrpKey)) By("starting and then evacuating the ActualLRP on another cell") err = client.StartActualLRP(logger, "some-trace-id", &key, &newInstanceKey, &netInfo, []*models.ActualLRPInternalRoute{}, map[string]string{}, false, "") Expect(err).NotTo(HaveOccurred()) Eventually(eventChannel).Should(Receive(&ce)) - Expect(ce.ActualLRPKey).To(Equal(actualLRPGroup[0].ActualLRPKey)) - Expect(ce.ActualLRPInstanceKey.CellId).To(Equal("other-cell-id")) + Expect(ce.ActualLrpKey).To(Equal(actualLRPGroup[0].ActualLrpKey)) + Expect(ce.ActualLrpInstanceKey.CellId).To(Equal("other-cell-id")) Expect(ce.Before.State).To(Equal(models.ActualLRPStateUnclaimed)) Expect(ce.After.State).To(Equal(models.ActualLRPStateRunning)) Expect(ce.After.Presence).To(Equal(models.ActualLRP_Ordinary)) @@ -245,13 +245,13 @@ var _ = Describe("Events API", func() { Expect(request.RequestURI).To(Equal("/v1/lrps")) Eventually(eventChannel).Should(Receive(&ce)) - Expect(ce.ActualLRPKey).To(Equal(actualLRPGroup[0].ActualLRPKey)) - Expect(ce.ActualLRPInstanceKey.CellId).To(Equal("other-cell-id")) + Expect(ce.ActualLrpKey).To(Equal(actualLRPGroup[0].ActualLrpKey)) + Expect(ce.ActualLrpInstanceKey.CellId).To(Equal("other-cell-id")) Expect(ce.After.State).To(Equal(models.ActualLRPStateRunning)) Expect(ce.After.Presence).To(Equal(models.ActualLRP_Evacuating)) Eventually(eventChannel).Should(Receive(&created)) - Expect(ce.ActualLRPKey).To(Equal(actualLRPGroup[0].ActualLRPKey)) + Expect(ce.ActualLrpKey).To(Equal(actualLRPGroup[0].ActualLrpKey)) By("removing the new ActualLRP") actualLRPGroup, err = client.ActualLRPs(logger, "some-trace-id", models.ActualLRPFilter{ProcessGuid: desiredLRP.ProcessGuid, Index: &index0}) @@ -262,8 +262,8 @@ var _ = Describe("Events API", func() { var re *models.ActualLRPInstanceRemovedEvent Eventually(eventChannel).Should(Receive(&re)) - Expect(re.ActualLrp.ActualLRPKey).To(Equal(actualLRPGroup[0].ActualLRPKey)) - Expect(re.ActualLrp.ActualLRPInstanceKey.CellId).To(Equal("")) + Expect(re.ActualLrp.ActualLrpKey).To(Equal(actualLRPGroup[0].ActualLrpKey)) + Expect(re.ActualLrp.ActualLrpInstanceKey.CellId).To(Equal("")) Expect(re.ActualLrp.Presence).To(Equal(models.ActualLRP_Ordinary)) By("removing the evacuating ActualLRP") @@ -271,8 +271,8 @@ var _ = Describe("Events API", func() { Expect(err).NotTo(HaveOccurred()) Eventually(eventChannel).Should(Receive(&re)) - Expect(re.ActualLrp.ActualLRPKey).To(Equal(actualLRPGroup[0].ActualLRPKey)) - Expect(re.ActualLrp.ActualLRPInstanceKey.CellId).To(Equal("other-cell-id")) + Expect(re.ActualLrp.ActualLrpKey).To(Equal(actualLRPGroup[0].ActualLrpKey)) + Expect(re.ActualLrp.ActualLrpInstanceKey.CellId).To(Equal("other-cell-id")) Expect(re.ActualLrp.Presence).To(Equal(models.ActualLRP_Evacuating)) }) }) @@ -316,11 +316,11 @@ var _ = Describe("Events API", func() { var e *models.ActualLRPInstanceChangedEvent Eventually(eventChannel).Should(Receive(&e)) - Expect(e.ActualLRPInstanceKey).To(BeEquivalentTo(actualLRPGroup[0].ActualLRPInstanceKey)) + Expect(e.ActualLrpInstanceKey).To(BeEquivalentTo(actualLRPGroup[0].ActualLrpInstanceKey)) Expect(e.Before.State).To(Equal(models.ActualLRPStateUnclaimed)) Expect(e.After.State).To(Equal(models.ActualLRPStateClaimed)) - Expect(actualLRPGroup[0].GetCellId()).To(Equal(cellID)) + Expect(actualLRPGroup[0].ActualLrpInstanceKey.GetCellId()).To(Equal(cellID)) } claimLRP() @@ -345,8 +345,8 @@ var _ = Describe("Events API", func() { Eventually(eventChannel).Should(Receive(&event)) actualLRPRemovedEvent := event.(*models.ActualLRPInstanceRemovedEvent) - Expect(actualLRPRemovedEvent.ActualLrp.ActualLRPInstanceKey).To(Equal(instanceKey)) - Expect(actualLRPRemovedEvent.ActualLrp.ActualLRPInstanceKey.CellId).To(Equal(cellID)) + Expect(actualLRPRemovedEvent.ActualLrp.ActualLrpInstanceKey).To(Equal(instanceKey)) + Expect(actualLRPRemovedEvent.ActualLrp.ActualLrpInstanceKey.CellId).To(Equal(cellID)) }) It("does not receive events from the other cells", func() { diff --git a/cmd/bbs/lrp_convergence_test.go b/cmd/bbs/lrp_convergence_test.go index 2a008885..647f3dc8 100644 --- a/cmd/bbs/lrp_convergence_test.go +++ b/cmd/bbs/lrp_convergence_test.go @@ -186,7 +186,7 @@ var _ = Describe("Convergence API", func() { group, err := client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", processGuid, 0) Expect(err).NotTo(HaveOccurred()) lrp = group.Instance - return lrp.InstanceGuid + return lrp.ActualLrpInstanceKey.InstanceGuid }).Should(Equal("ig-2")) Expect(lrp.Presence).To(Equal(models.ActualLRP_Ordinary)) }) @@ -196,7 +196,7 @@ var _ = Describe("Convergence API", func() { var changedEvent *models.ActualLRPInstanceChangedEvent Eventually(eventCh).Should(Receive(&changedEvent)) - Expect(changedEvent.ActualLRPInstanceKey.InstanceGuid).To(Equal("ig-1")) + Expect(changedEvent.ActualLrpInstanceKey.InstanceGuid).To(Equal("ig-1")) Expect(changedEvent.Before.State).To(Equal(models.ActualLRPStateRunning)) Expect(changedEvent.Before.Presence).To(Equal(models.ActualLRP_Ordinary)) Expect(changedEvent.After.State).To(Equal(models.ActualLRPStateRunning)) @@ -205,8 +205,8 @@ var _ = Describe("Convergence API", func() { var createdEvent *models.ActualLRPInstanceCreatedEvent Eventually(eventCh).Should(Receive(&createdEvent)) - Expect(createdEvent.ActualLrp.Index).To(Equal(changedEvent.ActualLRPKey.Index)) - Expect(createdEvent.ActualLrp.InstanceGuid).To(Equal("")) + Expect(createdEvent.ActualLrp.ActualLrpKey.Index).To(Equal(changedEvent.ActualLrpKey.Index)) + Expect(createdEvent.ActualLrp.ActualLrpInstanceKey.InstanceGuid).To(Equal("")) Expect(createdEvent.ActualLrp.Presence).To(Equal(models.ActualLRP_Ordinary)) Expect(createdEvent.ActualLrp.State).To(Equal(models.ActualLRPStateUnclaimed)) }) @@ -265,7 +265,7 @@ var _ = Describe("Convergence API", func() { var e *models.ActualLRPInstanceChangedEvent Eventually(eventCh).Should(Receive(&e)) - Expect(e.ActualLRPInstanceKey.InstanceGuid).To(Equal("ig-2")) + Expect(e.ActualLrpInstanceKey.InstanceGuid).To(Equal("ig-2")) Expect(e.Before.State).To(Equal(models.ActualLRPStateUnclaimed)) Expect(e.Before.Presence).To(Equal(models.ActualLRP_Ordinary)) Expect(e.After.State).To(Equal(models.ActualLRPStateClaimed)) @@ -327,7 +327,7 @@ var _ = Describe("Convergence API", func() { eventCh := streamEvents(events) var e *models.ActualLRPInstanceChangedEvent Eventually(eventCh, 5*time.Second).Should(Receive(&e)) - Expect(e.ProcessGuid).To(Equal("some-process-guid")) + Expect(e.ActualLrpKey.ProcessGuid).To(Equal("some-process-guid")) Expect(e.Before.State).To(Equal(models.ActualLRPStateUnclaimed)) Expect(e.Before.Presence).To(Equal(models.ActualLRP_Ordinary)) Expect(e.After.State).To(Equal(models.ActualLRPStateUnclaimed)) @@ -353,7 +353,7 @@ var _ = Describe("Convergence API", func() { eventCh := streamEvents(events) var e *models.ActualLRPInstanceChangedEvent Eventually(eventCh, 5*time.Second).Should(Receive(&e)) - Expect(e.ActualLRPInstanceKey.InstanceGuid).To(Equal("ig-2")) + Expect(e.ActualLrpInstanceKey.InstanceGuid).To(Equal("ig-2")) Expect(e.Before.State).To(Equal(models.ActualLRPStateUnclaimed)) Expect(e.After.State).To(Equal(models.ActualLRPStateClaimed)) }) @@ -385,7 +385,7 @@ var _ = Describe("Convergence API", func() { var e *models.ActualLRPInstanceChangedEvent Eventually(eventCh).Should(Receive(&e)) - Expect(e.ActualLRPInstanceKey.InstanceGuid).To(Equal("ig-2")) + Expect(e.ActualLrpInstanceKey.InstanceGuid).To(Equal("ig-2")) Expect(e.Before.State).To(Equal(models.ActualLRPStateUnclaimed)) Expect(e.After.State).To(Equal(models.ActualLRPStateRunning)) }) @@ -396,7 +396,7 @@ var _ = Describe("Convergence API", func() { var e *models.ActualLRPInstanceRemovedEvent Eventually(eventCh, 2*time.Second).Should(Receive(&e)) - Expect(e.ActualLrp.InstanceGuid).To(Equal("ig-1")) + Expect(e.ActualLrp.ActualLrpInstanceKey.InstanceGuid).To(Equal("ig-1")) Expect(e.ActualLrp.Presence).To(Equal(models.ActualLRP_Suspect)) }) @@ -466,7 +466,7 @@ var _ = Describe("Convergence API", func() { var e *models.ActualLRPInstanceRemovedEvent Eventually(eventCh, 2*time.Second).Should(Receive(&e)) - Expect(e.ActualLrp.InstanceGuid).To(Equal("ig-1")) + Expect(e.ActualLrp.ActualLrpInstanceKey.InstanceGuid).To(Equal("ig-1")) Expect(e.ActualLrp.Presence).To(Equal(models.ActualLRP_Suspect)) }) @@ -511,7 +511,7 @@ var _ = Describe("Convergence API", func() { group, err := client.ActualLRPGroupByProcessGuidAndIndex(logger, "some-trace-id", processGuid, 0) Expect(err).NotTo(HaveOccurred()) Expect(group.Evacuating.Presence).To(Equal(models.ActualLRP_Evacuating)) - Expect(group.Evacuating.ActualLRPInstanceKey).To(Equal(*suspectLRPInstanceKey)) + Expect(group.Evacuating.ActualLrpInstanceKey).To(Equal(*suspectLRPInstanceKey)) }) It("removes the suspect LRP", func() { @@ -526,7 +526,7 @@ var _ = Describe("Convergence API", func() { var ce *models.ActualLRPInstanceChangedEvent Eventually(eventCh, 2*time.Second).Should(Receive(&ce)) - Expect(ce.ActualLRPInstanceKey.InstanceGuid).To(Equal("ig-2")) + Expect(ce.ActualLrpInstanceKey.InstanceGuid).To(Equal("ig-2")) Expect(ce.Before.State).To(Equal(models.ActualLRPStateUnclaimed)) Expect(ce.After.State).To(Equal(models.ActualLRPStateClaimed)) Expect(ce.Before.Presence).To(Equal(models.ActualLRP_Ordinary)) @@ -535,7 +535,7 @@ var _ = Describe("Convergence API", func() { var ce2 *models.ActualLRPInstanceChangedEvent Eventually(eventCh, 2*time.Second).Should(Receive(&ce2)) - Expect(ce2.ActualLRPInstanceKey.InstanceGuid).To(Equal("ig-1")) + Expect(ce2.ActualLrpInstanceKey.InstanceGuid).To(Equal("ig-1")) Expect(ce2.Before.State).To(Equal(models.ActualLRPStateRunning)) Expect(ce2.After.State).To(Equal(models.ActualLRPStateRunning)) Expect(ce2.Before.Presence).To(Equal(models.ActualLRP_Suspect)) @@ -575,7 +575,7 @@ var _ = Describe("Convergence API", func() { var e *models.ActualLRPInstanceRemovedEvent Eventually(eventCh).Should(Receive(&e)) - Expect(e.ActualLrp.ActualLRPInstanceKey).ToNot(Equal(replacementLRPInstanceKey)) + Expect(e.ActualLrp.ActualLrpInstanceKey).ToNot(Equal(replacementLRPInstanceKey)) }) }) @@ -597,7 +597,7 @@ var _ = Describe("Convergence API", func() { var re *models.ActualLRPInstanceRemovedEvent Eventually(eventCh, 2*time.Second).Should(Receive(&re)) - Expect(re.ActualLrp.InstanceGuid).To(Equal("ig-1")) + Expect(re.ActualLrp.ActualLrpInstanceKey.InstanceGuid).To(Equal("ig-1")) Expect(re.ActualLrp.Presence).To(Equal(models.ActualLRP_Suspect)) }) }) @@ -620,7 +620,7 @@ var _ = Describe("Convergence API", func() { var re *models.ActualLRPInstanceRemovedEvent Eventually(eventCh, 2*time.Second).Should(Receive(&re)) - Expect(re.ActualLrp.InstanceGuid).To(Equal("ig-1")) + Expect(re.ActualLrp.ActualLrpInstanceKey.InstanceGuid).To(Equal("ig-1")) Expect(re.ActualLrp.Presence).To(Equal(models.ActualLRP_Suspect)) }) }) diff --git a/controllers/actual_lrp_lifecycle_controller.go b/controllers/actual_lrp_lifecycle_controller.go index a5d4e059..494eea51 100644 --- a/controllers/actual_lrp_lifecycle_controller.go +++ b/controllers/actual_lrp_lifecycle_controller.go @@ -61,7 +61,7 @@ func findWithPresence(lrps []*models.ActualLRP, presence models.ActualLRP_Presen func lookupLRPInSlice(lrps []*models.ActualLRP, key *models.ActualLRPInstanceKey) *models.ActualLRP { for _, lrp := range lrps { - if lrp.ActualLRPInstanceKey == *key { + if lrp.ActualLrpInstanceKey == *key { return lrp } } @@ -148,9 +148,9 @@ func (h *ActualLRPLifecycleController) StartActualLRP(ctx context.Context, suspect := findWithPresence(lrps, models.ActualLRP_Suspect) if evacuating != nil { - err = h.evacuationDB.RemoveEvacuatingActualLRP(ctx, logger, &evacuating.ActualLRPKey, &evacuating.ActualLRPInstanceKey) + err = h.evacuationDB.RemoveEvacuatingActualLRP(ctx, logger, &evacuating.ActualLrpKey, &evacuating.ActualLrpInstanceKey) if err != nil { - logger.Error("failed-to-remove-evacuating-actual-lrp", err, lager.Data{"instance-guid": evacuating.ActualLRPInstanceKey}) + logger.Error("failed-to-remove-evacuating-actual-lrp", err, lager.Data{"instance-guid": evacuating.ActualLrpInstanceKey}) } newLRPs = eventCalculator.RecordChange(evacuating, nil, newLRPs) } @@ -189,7 +189,7 @@ func (h *ActualLRPLifecycleController) CrashActualLRP(ctx context.Context, logge } afterLRPs := eventCalculator.RecordChange(suspectLRP, nil, lrps) - logger.Info("removing-suspect-lrp", lager.Data{"ig": suspectLRP.InstanceGuid}) + logger.Info("removing-suspect-lrp", lager.Data{"ig": suspectLRP.ActualLrpInstanceKey.InstanceGuid}) go eventCalculator.EmitEvents(traceId, lrps, afterLRPs) return nil @@ -214,9 +214,9 @@ func (h *ActualLRPLifecycleController) CrashActualLRP(ctx context.Context, logge } startRequest := auctioneer.NewLRPStartRequestFromSchedulingInfo(schedInfo, int(actualLRPKey.Index)) - logger.Info("start-lrp-auction-request", lager.Data{"app_guid": schedInfo.ProcessGuid, "index": int(actualLRPKey.Index)}) + logger.Info("start-lrp-auction-request", lager.Data{"app_guid": schedInfo.DesiredLrpKey.ProcessGuid, "index": int(actualLRPKey.Index)}) err = h.auctioneerClient.RequestLRPAuctions(logger, trace.RequestIdFromContext(ctx), []*auctioneer.LRPStartRequest{&startRequest}) - logger.Info("finished-lrp-auction-request", lager.Data{"app_guid": schedInfo.ProcessGuid, "index": int(actualLRPKey.Index)}) + logger.Info("finished-lrp-auction-request", lager.Data{"app_guid": schedInfo.DesiredLrpKey.ProcessGuid, "index": int(actualLRPKey.Index)}) if err != nil { logger.Error("failed-requesting-auction", err) } @@ -305,7 +305,7 @@ func (h *ActualLRPLifecycleController) RetireActualLRP(ctx context.Context, logg } removeLRP := func() error { - err = h.db.RemoveActualLRP(ctx, logger, lrp.ProcessGuid, lrp.Index, &lrp.ActualLRPInstanceKey) + err = h.db.RemoveActualLRP(ctx, logger, lrp.ActualLrpKey.ProcessGuid, lrp.ActualLrpKey.Index, &lrp.ActualLrpInstanceKey) if err == nil { recordChange() } @@ -317,7 +317,7 @@ func (h *ActualLRPLifecycleController) RetireActualLRP(ctx context.Context, logg case models.ActualLRPStateUnclaimed, models.ActualLRPStateCrashed: err = removeLRP() case models.ActualLRPStateClaimed, models.ActualLRPStateRunning: - cell, err = h.serviceClient.CellById(logger, lrp.CellId) + cell, err = h.serviceClient.CellById(logger, lrp.ActualLrpInstanceKey.CellId) if err != nil { bbsErr := models.ConvertError(err) if bbsErr.Type == models.Error_ResourceNotFound { @@ -332,7 +332,7 @@ func (h *ActualLRPLifecycleController) RetireActualLRP(ctx context.Context, logg if err != nil { return err } - err = client.StopLRPInstance(logger, lrp.ActualLRPKey, lrp.ActualLRPInstanceKey) + err = client.StopLRPInstance(logger, lrp.ActualLrpKey, lrp.ActualLrpInstanceKey) } if err == nil { diff --git a/controllers/actual_lrp_lifecycle_controller_test.go b/controllers/actual_lrp_lifecycle_controller_test.go index 4b592a5c..0500a73a 100644 --- a/controllers/actual_lrp_lifecycle_controller_test.go +++ b/controllers/actual_lrp_lifecycle_controller_test.go @@ -108,16 +108,16 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { JustBeforeEach(func() { actualLRP = &models.ActualLRP{ - ActualLRPKey: actualLRPKey, - ActualLRPInstanceKey: beforeInstanceKey, + ActualLrpKey: actualLRPKey, + ActualLrpInstanceKey: beforeInstanceKey, State: actualLRPState, Since: 1138, Presence: presence, } afterActualLRP = &models.ActualLRP{ - ActualLRPKey: actualLRPKey, - ActualLRPInstanceKey: afterInstanceKey, + ActualLrpKey: actualLRPKey, + ActualLrpInstanceKey: afterInstanceKey, State: afterActualLRPState, Since: 1140, Presence: afterPresence, @@ -184,8 +184,8 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { suspect := &models.ActualLRP{ State: models.ActualLRPStateRunning, Presence: models.ActualLRP_Suspect, - ActualLRPKey: actualLRPKey, - ActualLRPInstanceKey: models.ActualLRPInstanceKey{ + ActualLrpKey: actualLRPKey, + ActualLrpInstanceKey: models.ActualLRPInstanceKey{ InstanceGuid: "suspect-ig", CellId: "suspect-cell-id", }, @@ -211,8 +211,8 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { suspectLRP = &models.ActualLRP{ State: models.ActualLRPStateClaimed, Presence: models.ActualLRP_Suspect, - ActualLRPKey: actualLRPKey, - ActualLRPInstanceKey: afterInstanceKey, + ActualLrpKey: actualLRPKey, + ActualLrpInstanceKey: afterInstanceKey, } fakeActualLRPDB.ActualLRPsReturns([]*models.ActualLRP{suspectLRP}, nil) }) @@ -224,7 +224,7 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { unclaimedActualLRP = &models.ActualLRP{ State: models.ActualLRPStateUnclaimed, Presence: models.ActualLRP_Ordinary, - ActualLRPKey: actualLRPKey, + ActualLrpKey: actualLRPKey, } }) @@ -285,11 +285,11 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { suspect = &models.ActualLRP{ Presence: models.ActualLRP_Suspect, State: models.ActualLRPStateRunning, - ActualLRPInstanceKey: models.ActualLRPInstanceKey{ + ActualLrpInstanceKey: models.ActualLRPInstanceKey{ InstanceGuid: "suspect-instance-guid", CellId: "cell-id-1", }, - ActualLRPKey: models.ActualLRPKey{ + ActualLrpKey: models.ActualLRPKey{ ProcessGuid: processGuid, Index: index, Domain: "domain-0", @@ -458,7 +458,7 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { BeforeEach(func() { evacuating = model_helpers.NewValidEvacuatingActualLRP(processGuid, index) - evacuating.ActualLRPKey = actualLRPKey + evacuating.ActualLrpKey = actualLRPKey evacuating.State = models.ActualLRPStateRunning }) @@ -470,8 +470,8 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { err = controller.StartActualLRP(ctx, logger, &actualLRPKey, &afterInstanceKey, &netInfo, internalRoutes, metricTags, routable, availabilityZone) Expect(fakeEvacuationDB.RemoveEvacuatingActualLRPCallCount()).To(Equal(1)) _, _, lrpKey, lrpInstanceKey := fakeEvacuationDB.RemoveEvacuatingActualLRPArgsForCall(0) - Expect(*lrpKey).To(Equal(evacuating.ActualLRPKey)) - Expect(*lrpInstanceKey).To(Equal(evacuating.ActualLRPInstanceKey)) + Expect(*lrpKey).To(Equal(evacuating.ActualLrpKey)) + Expect(*lrpInstanceKey).To(Equal(evacuating.ActualLrpInstanceKey)) }) It("should emit an ActualLRPChanged event and an ActualLRPRemoved event", func() { @@ -552,8 +552,10 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { Context("when Routable was updated", func() { JustBeforeEach(func() { *actualLRP = *afterActualLRP - actualLRP.SetRoutable(true) - afterActualLRP.SetRoutable(false) + routableTrue := true + routableFalse := false + actualLRP.SetRoutable(&routableTrue) + afterActualLRP.SetRoutable(&routableFalse) fakeActualLRPDB.StartActualLRPReturns(actualLRP, afterActualLRP, nil) fakeActualLRPDB.ActualLRPsReturns([]*models.ActualLRP{actualLRP}, nil) }) @@ -673,8 +675,8 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { } Expect(events).To(ConsistOf(&models.ActualLRPCrashedEvent{ - ActualLRPKey: actualLRP.ActualLRPKey, - ActualLRPInstanceKey: actualLRP.ActualLRPInstanceKey, + ActualLrpKey: actualLRP.ActualLrpKey, + ActualLrpInstanceKey: actualLRP.ActualLrpInstanceKey, Since: afterActualLRP.Since, CrashCount: 1, CrashReason: errorMessage, @@ -714,8 +716,8 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { Consistently(actualLRPInstanceHub.EmitCallCount).Should(Equal(3)) Expect(actualLRPInstanceHub.EmitArgsForCall(0)).To(Equal(&models.ActualLRPCrashedEvent{ - ActualLRPKey: actualLRP.ActualLRPKey, - ActualLRPInstanceKey: actualLRP.ActualLRPInstanceKey, + ActualLrpKey: actualLRP.ActualLrpKey, + ActualLrpInstanceKey: actualLRP.ActualLrpInstanceKey, Since: afterActualLRP.Since, CrashCount: 1, CrashReason: errorMessage, @@ -750,8 +752,8 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { Consistently(actualLRPInstanceHub.EmitCallCount).Should(Equal(2)) Expect(actualLRPInstanceHub.EmitArgsForCall(0)).To(Equal(&models.ActualLRPCrashedEvent{ - ActualLRPKey: actualLRP.ActualLRPKey, - ActualLRPInstanceKey: actualLRP.ActualLRPInstanceKey, + ActualLrpKey: actualLRP.ActualLrpKey, + ActualLrpInstanceKey: actualLRP.ActualLrpInstanceKey, Since: afterActualLRP.Since, CrashCount: 1, CrashReason: errorMessage, @@ -798,8 +800,8 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { JustBeforeEach(func() { suspectInstanceKey := models.NewActualLRPInstanceKey("instance-guid-1", "cell-id-1") suspectLRP = &models.ActualLRP{ - ActualLRPKey: actualLRPKey, - ActualLRPInstanceKey: suspectInstanceKey, + ActualLrpKey: actualLRPKey, + ActualLrpInstanceKey: suspectInstanceKey, State: suspectInstanceState, Presence: models.ActualLRP_Suspect, } @@ -823,8 +825,8 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { Consistently(actualLRPInstanceHub.EmitCallCount).Should(Equal(3)) Expect(actualLRPInstanceHub.EmitArgsForCall(0)).To(Equal(&models.ActualLRPCrashedEvent{ - ActualLRPKey: actualLRP.ActualLRPKey, - ActualLRPInstanceKey: actualLRP.ActualLRPInstanceKey, + ActualLrpKey: actualLRP.ActualLrpKey, + ActualLrpInstanceKey: actualLRP.ActualLrpInstanceKey, Since: afterActualLRP.Since, CrashCount: 1, CrashReason: errorMessage, @@ -931,7 +933,7 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { BeforeEach(func() { replacementLRP = &models.ActualLRP{ - ActualLRPKey: actualLRPKey, + ActualLrpKey: actualLRPKey, State: models.ActualLRPStateUnclaimed, Presence: models.ActualLRP_Ordinary, } @@ -976,8 +978,8 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { BeforeEach(func() { ordinaryInstanceKey := models.NewActualLRPInstanceKey("instance-guid-1", "cell-id-1") replacementLRP = &models.ActualLRP{ - ActualLRPKey: actualLRPKey, - ActualLRPInstanceKey: ordinaryInstanceKey, + ActualLrpKey: actualLRPKey, + ActualLrpInstanceKey: ordinaryInstanceKey, State: models.ActualLRPStateClaimed, Presence: models.ActualLRP_Ordinary, } @@ -1105,8 +1107,8 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { Context("when there is a Suspect LRP running", func() { JustBeforeEach(func() { - suspectLRP := model_helpers.NewValidActualLRP(actualLRP.ProcessGuid, actualLRP.Index) - suspectLRP.Domain = actualLRP.Domain + suspectLRP := model_helpers.NewValidActualLRP(actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index) + suspectLRP.ActualLrpKey.Domain = actualLRP.ActualLrpKey.Domain suspectLRP.Presence = models.ActualLRP_Suspect fakeActualLRPDB.ActualLRPsReturns([]*models.ActualLRP{suspectLRP, actualLRP}, nil) @@ -1388,7 +1390,7 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { _, _, deletedLRPGuid, deletedLRPIndex, deletedLRPInstanceKey := fakeActualLRPDB.RemoveActualLRPArgsForCall(0) Expect(deletedLRPGuid).To(Equal(processGuid)) Expect(deletedLRPIndex).To(Equal(index)) - Expect(deletedLRPInstanceKey).To(Equal(&actualLRP.ActualLRPInstanceKey)) + Expect(deletedLRPInstanceKey).To(Equal(&actualLRP.ActualLrpInstanceKey)) }) It("emits a removed event to the hub", func() { @@ -1451,7 +1453,7 @@ var _ = Describe("ActualLRP Lifecycle Controller", func() { _, _, deletedLRPGuid, deletedLRPIndex, deletedLRPInstanceKey := fakeActualLRPDB.RemoveActualLRPArgsForCall(0) Expect(deletedLRPGuid).To(Equal(processGuid)) Expect(deletedLRPIndex).To(Equal(index)) - Expect(deletedLRPInstanceKey).To(Equal(&actualLRP.ActualLRPInstanceKey)) + Expect(deletedLRPInstanceKey).To(Equal(&actualLRP.ActualLrpInstanceKey)) }) It("emits a removed event to the hub", func() { diff --git a/controllers/evacuation_controller.go b/controllers/evacuation_controller.go index 81f43e0b..2ae8969d 100644 --- a/controllers/evacuation_controller.go +++ b/controllers/evacuation_controller.go @@ -78,7 +78,7 @@ func (h *EvacuationController) RemoveEvacuatingActualLRP(ctx context.Context, lo instance := findWithPresence(actualLRPs, models.ActualLRP_Ordinary) if instance != nil { - evacuatingLRPLogData["replacement-lrp-instance-key"] = instance.ActualLRPInstanceKey + evacuatingLRPLogData["replacement-lrp-instance-key"] = instance.ActualLrpInstanceKey evacuatingLRPLogData["replacement-state"] = instance.State evacuatingLRPLogData["replacement-lrp-placement-error"] = instance.PlacementError } @@ -404,7 +404,7 @@ func (h *EvacuationController) evacuateInstance(ctx context.Context, logger lage ActualLRPInstanceHub: h.actualLRPInstanceHub, } - evacuating, err := h.db.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, actualLRP.GetRoutable(), actualLRP.AvailabilityZone) + evacuating, err := h.db.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, *actualLRP.GetRoutable(), actualLRP.AvailabilityZone) if err != nil { return err } @@ -421,7 +421,7 @@ func (h *EvacuationController) evacuateInstance(ctx context.Context, logger lage }() if actualLRP.Presence == models.ActualLRP_Suspect { - _, err := h.suspectLRPDB.RemoveSuspectActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + _, err := h.suspectLRPDB.RemoveSuspectActualLRP(ctx, logger, &actualLRP.ActualLrpKey) if err != nil { logger.Error("failed-removing-suspect-actual-lrp", err) return err @@ -430,7 +430,7 @@ func (h *EvacuationController) evacuateInstance(ctx context.Context, logger lage return nil } - _, after, err := h.actualLRPDB.UnclaimActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + _, after, err := h.actualLRPDB.UnclaimActualLRP(ctx, logger, &actualLRP.ActualLrpKey) if err != nil { return err } @@ -441,7 +441,7 @@ func (h *EvacuationController) evacuateInstance(ctx context.Context, logger lage // compatible. newLRPs = eventCalculator.RecordChange(nil, after, newLRPs) - h.requestAuction(ctx, logger, &actualLRP.ActualLRPKey) + h.requestAuction(ctx, logger, &actualLRP.ActualLrpKey) return nil } @@ -450,7 +450,7 @@ func (h *EvacuationController) removeEvacuating(ctx context.Context, logger lage return nil, nil } - err := h.db.RemoveEvacuatingActualLRP(ctx, logger, &evacuating.ActualLRPKey, &evacuating.ActualLRPInstanceKey) + err := h.db.RemoveEvacuatingActualLRP(ctx, logger, &evacuating.ActualLrpKey, &evacuating.ActualLrpInstanceKey) if err == nil { return evacuating, nil diff --git a/controllers/evacuation_controller_test.go b/controllers/evacuation_controller_test.go index 47bfd052..d592b124 100644 --- a/controllers/evacuation_controller_test.go +++ b/controllers/evacuation_controller_test.go @@ -86,16 +86,16 @@ var _ = Describe("Evacuation Controller", func() { instanceKey := models.NewActualLRPInstanceKey("instance-guid", "cell-id") evacuatingInstanceKey = models.NewActualLRPInstanceKey("evacuating-instance-guid", "evacuating-cell-id") actual = &models.ActualLRP{ - ActualLRPInstanceKey: instanceKey, + ActualLrpInstanceKey: instanceKey, } evacuatingLRP = &models.ActualLRP{ - ActualLRPInstanceKey: evacuatingInstanceKey, + ActualLrpInstanceKey: evacuatingInstanceKey, Presence: models.ActualLRP_Evacuating, } replacementInstanceKey = models.NewActualLRPInstanceKey("replacement-instance-guid", "replacement-cell-id") replacementActual = &models.ActualLRP{ - ActualLRPInstanceKey: replacementInstanceKey, + ActualLrpInstanceKey: replacementInstanceKey, State: models.ActualLRPStateClaimed, PlacementError: "some-placement-error", } @@ -244,8 +244,8 @@ var _ = Describe("Evacuation Controller", func() { afterActualLRP = model_helpers.NewValidActualLRP("process-guid", 1) afterActualLRP.State = models.ActualLRPStateUnclaimed - lrpKey = &actualLRP.ActualLRPKey - lrpInstanceKey = &actualLRP.ActualLRPInstanceKey + lrpKey = &actualLRP.ActualLrpKey + lrpInstanceKey = &actualLRP.ActualLrpInstanceKey fakeActualLRPDB.UnclaimActualLRPReturns(actualLRP, afterActualLRP, nil) }) @@ -268,7 +268,7 @@ var _ = Describe("Evacuation Controller", func() { _, _, guid := fakeDesiredLRPDB.DesiredLRPSchedulingInfoByProcessGuidArgsForCall(0) Expect(guid).To(Equal("process-guid")) - expectedStartRequest := auctioneer.NewLRPStartRequestFromModel(desiredLRP, int(actualLRP.Index)) + expectedStartRequest := auctioneer.NewLRPStartRequestFromModel(desiredLRP, int(actualLRP.ActualLrpKey.Index)) Expect(fakeAuctioneerClient.RequestLRPAuctionsCallCount()).To(Equal(1)) _, actualTraceId, startRequests := fakeAuctioneerClient.RequestLRPAuctionsArgsForCall(0) Expect(startRequests).To(Equal([]*auctioneer.LRPStartRequest{&expectedStartRequest})) @@ -498,8 +498,8 @@ var _ = Describe("Evacuation Controller", func() { ordinaryActualLRP = model_helpers.NewValidActualLRP("process-guid", 1) ordinaryActualLRP.State = models.ActualLRPStateClaimed ordinaryActualLRP.Presence = models.ActualLRP_Ordinary - ordinaryActualLRP.ActualLRPInstanceKey.InstanceGuid = "another-instance" - ordinaryActualLRP.ActualLRPInstanceKey.CellId = "another-cell" + ordinaryActualLRP.ActualLrpInstanceKey.InstanceGuid = "another-instance" + ordinaryActualLRP.ActualLrpInstanceKey.CellId = "another-cell" fakeActualLRPDB.ActualLRPsReturns([]*models.ActualLRP{actualLRP, ordinaryActualLRP}, nil) }) @@ -553,8 +553,8 @@ var _ = Describe("Evacuation Controller", func() { BeforeEach(func() { actualLRP = model_helpers.NewValidActualLRP("process-guid", 1) - key = actualLRP.ActualLRPKey - instanceKey = actualLRP.ActualLRPInstanceKey + key = actualLRP.ActualLrpKey + instanceKey = actualLRP.ActualLrpInstanceKey fakeActualLRPDB.ActualLRPsReturns([]*models.ActualLRP{actualLRP}, nil) errMessage = "i failed" }) @@ -570,8 +570,8 @@ var _ = Describe("Evacuation Controller", func() { It("crashes the actual lrp instance", func() { Expect(fakeActualLRPDB.CrashActualLRPCallCount()).To(Equal(1)) _, _, key, instanceKey, errorMessage := fakeActualLRPDB.CrashActualLRPArgsForCall(0) - Expect(*key).To(Equal(actualLRP.ActualLRPKey)) - Expect(*instanceKey).To(Equal(actualLRP.ActualLRPInstanceKey)) + Expect(*key).To(Equal(actualLRP.ActualLrpKey)) + Expect(*instanceKey).To(Equal(actualLRP.ActualLrpInstanceKey)) Expect(errorMessage).To(Equal("i failed")) }) @@ -582,7 +582,7 @@ var _ = Describe("Evacuation Controller", func() { Context("when the actual lrp is not in the db", func() { BeforeEach(func() { - actualLRP.ActualLRPInstanceKey.CellId = "some-random-cell" + actualLRP.ActualLrpInstanceKey.CellId = "some-random-cell" fakeActualLRPDB.ActualLRPsReturns([]*models.ActualLRP{actualLRP}, nil) }) @@ -638,8 +638,8 @@ var _ = Describe("Evacuation Controller", func() { It("removes the evacuating actual lrp", func() { Expect(fakeEvacuationDB.RemoveEvacuatingActualLRPCallCount()).To(Equal(1)) _, _, key, instanceKey := fakeEvacuationDB.RemoveEvacuatingActualLRPArgsForCall(0) - Expect(*key).To(Equal(actualLRP.ActualLRPKey)) - Expect(*instanceKey).To(Equal(actualLRP.ActualLRPInstanceKey)) + Expect(*key).To(Equal(actualLRP.ActualLrpKey)) + Expect(*instanceKey).To(Equal(actualLRP.ActualLrpInstanceKey)) }) It("emits events to the hub", func() { @@ -687,8 +687,8 @@ var _ = Describe("Evacuation Controller", func() { It("removes the suspect lrp", func() { Expect(fakeSuspectDB.RemoveSuspectActualLRPCallCount()).To(Equal(1)) _, _, lrpKey := fakeSuspectDB.RemoveSuspectActualLRPArgsForCall(0) - Expect(lrpKey.ProcessGuid).To(Equal(actualLRP.ProcessGuid)) - Expect(lrpKey.Index).To(Equal(actualLRP.Index)) + Expect(lrpKey.ProcessGuid).To(Equal(actualLRP.ActualLrpKey.ProcessGuid)) + Expect(lrpKey.Index).To(Equal(actualLRP.ActualLrpKey.Index)) }) It("emits ActualLRPRemovedEvent", func() { @@ -754,9 +754,9 @@ var _ = Describe("Evacuation Controller", func() { afterActual = model_helpers.NewValidActualLRP("the-guid", 1) afterActual.Presence = models.ActualLRP_Evacuating - targetKey = actual.ActualLRPKey - targetInstanceKey = actual.ActualLRPInstanceKey - netInfo = actual.ActualLRPNetInfo + targetKey = actual.ActualLrpKey + targetInstanceKey = actual.ActualLrpInstanceKey + netInfo = actual.ActualLrpNetInfo internalRoutes = actual.ActualLrpInternalRoutes metricTags = actual.MetricTags availabilityZone = actual.AvailabilityZone @@ -779,7 +779,7 @@ var _ = Describe("Evacuation Controller", func() { Context("when the actual LRP instance is already evacuating", func() { BeforeEach(func() { actualLRPs = []*models.ActualLRP{evacuatingActual} - targetInstanceKey = evacuatingActual.ActualLRPInstanceKey + targetInstanceKey = evacuatingActual.ActualLrpInstanceKey }) It("removes the evacuating lrp and does not keep the container", func() { @@ -788,8 +788,8 @@ var _ = Describe("Evacuation Controller", func() { Expect(fakeEvacuationDB.RemoveEvacuatingActualLRPCallCount()).To(Equal(1)) _, _, actualLRPKey, actualLRPInstanceKey := fakeEvacuationDB.RemoveEvacuatingActualLRPArgsForCall(0) - Expect(*actualLRPKey).To(Equal(evacuatingActual.ActualLRPKey)) - Expect(*actualLRPInstanceKey).To(Equal(evacuatingActual.ActualLRPInstanceKey)) + Expect(*actualLRPKey).To(Equal(evacuatingActual.ActualLrpKey)) + Expect(*actualLRPInstanceKey).To(Equal(evacuatingActual.ActualLrpInstanceKey)) }) It("emits events to the hub", func() { @@ -875,7 +875,7 @@ var _ = Describe("Evacuation Controller", func() { Context("when the instance is unclaimed", func() { BeforeEach(func() { actual.State = models.ActualLRPStateUnclaimed - actual.ActualLRPInstanceKey = models.ActualLRPInstanceKey{} + actual.ActualLrpInstanceKey = models.ActualLRPInstanceKey{} actualLRPs = []*models.ActualLRP{actual} }) @@ -992,7 +992,7 @@ var _ = Describe("Evacuation Controller", func() { Context("when there's an existing evacuating instance on the cell the request came from", func() { BeforeEach(func() { - evacuatingActual.CellId = "some-other-cell" + evacuatingActual.ActualLrpInstanceKey.CellId = "some-other-cell" actualLRPs = []*models.ActualLRP{actual, evacuatingActual} fakeEvacuationDB.EvacuateActualLRPReturns(nil, models.ErrResourceExists) }) @@ -1027,9 +1027,9 @@ var _ = Describe("Evacuation Controller", func() { Expect(fakeEvacuationDB.EvacuateActualLRPCallCount()).To(Equal(1)) _, _, actualLRPKey, actualLRPInstanceKey, actualLrpNetInfo, actualLRPInternalRoutes, actualLRPMetricTags, actualRoutable, actualAvailabilityZone := fakeEvacuationDB.EvacuateActualLRPArgsForCall(0) - Expect(*actualLRPKey).To(Equal(actual.ActualLRPKey)) - Expect(*actualLRPInstanceKey).To(Equal(actual.ActualLRPInstanceKey)) - Expect(*actualLrpNetInfo).To(Equal(actual.ActualLRPNetInfo)) + Expect(*actualLRPKey).To(Equal(actual.ActualLrpKey)) + Expect(*actualLRPInstanceKey).To(Equal(actual.ActualLrpInstanceKey)) + Expect(*actualLrpNetInfo).To(Equal(actual.ActualLrpNetInfo)) Expect(actualLRPInternalRoutes).To(Equal(actual.ActualLrpInternalRoutes)) Expect(actualLRPMetricTags).To(Equal(actual.MetricTags)) Expect(actualRoutable).To(Equal(false)) @@ -1039,16 +1039,16 @@ var _ = Describe("Evacuation Controller", func() { It("unclaims the lrp and requests an auction", func() { Expect(fakeActualLRPDB.UnclaimActualLRPCallCount()).To(Equal(1)) _, _, actualLRPKey, actualLRPInstanceKey, actualLrpNetInfo, actualLRPInternalRoutes, actualLRPMetricTags, actualRoutable, actualAvailabilityZone := fakeEvacuationDB.EvacuateActualLRPArgsForCall(0) - Expect(*actualLRPKey).To(Equal(actual.ActualLRPKey)) - Expect(*actualLRPInstanceKey).To(Equal(actual.ActualLRPInstanceKey)) - Expect(*actualLrpNetInfo).To(Equal(actual.ActualLRPNetInfo)) + Expect(*actualLRPKey).To(Equal(actual.ActualLrpKey)) + Expect(*actualLRPInstanceKey).To(Equal(actual.ActualLrpInstanceKey)) + Expect(*actualLrpNetInfo).To(Equal(actual.ActualLrpNetInfo)) Expect(actualLRPInternalRoutes).To(Equal(actual.ActualLrpInternalRoutes)) Expect(actualLRPMetricTags).To(Equal(actual.MetricTags)) Expect(actualRoutable).To(Equal(false)) Expect(actualAvailabilityZone).To(Equal(actual.AvailabilityZone)) schedulingInfo := desiredLRP.DesiredLRPSchedulingInfo() - expectedStartRequest := auctioneer.NewLRPStartRequestFromSchedulingInfo(&schedulingInfo, int(actual.Index)) + expectedStartRequest := auctioneer.NewLRPStartRequestFromSchedulingInfo(&schedulingInfo, int(actual.ActualLrpKey.Index)) Expect(fakeAuctioneerClient.RequestLRPAuctionsCallCount()).To(Equal(1)) _, actualTraceId, startRequests := fakeAuctioneerClient.RequestLRPAuctionsArgsForCall(0) @@ -1132,9 +1132,9 @@ var _ = Describe("Evacuation Controller", func() { Expect(fakeEvacuationDB.EvacuateActualLRPCallCount()).To(Equal(1)) _, _, actualLRPKey, actualLRPInstanceKey, actualLrpNetInfo, actualLRPInternalRoutes, actualLRPMetricTags, actualRoutable, actualAvailabilityZone := fakeEvacuationDB.EvacuateActualLRPArgsForCall(0) - Expect(*actualLRPKey).To(Equal(actual.ActualLRPKey)) - Expect(*actualLRPInstanceKey).To(Equal(actual.ActualLRPInstanceKey)) - Expect(*actualLrpNetInfo).To(Equal(actual.ActualLRPNetInfo)) + Expect(*actualLRPKey).To(Equal(actual.ActualLrpKey)) + Expect(*actualLRPInstanceKey).To(Equal(actual.ActualLrpInstanceKey)) + Expect(*actualLrpNetInfo).To(Equal(actual.ActualLrpNetInfo)) Expect(actualLRPInternalRoutes).To(Equal(actual.ActualLrpInternalRoutes)) Expect(actualLRPMetricTags).To(Equal(actual.MetricTags)) Expect(actualRoutable).To(Equal(false)) @@ -1144,11 +1144,11 @@ var _ = Describe("Evacuation Controller", func() { It("unclaims the lrp and requests an auction", func() { Expect(fakeActualLRPDB.UnclaimActualLRPCallCount()).To(Equal(1)) _, _, lrpKey := fakeActualLRPDB.UnclaimActualLRPArgsForCall(0) - Expect(lrpKey.ProcessGuid).To(Equal(actual.ProcessGuid)) - Expect(lrpKey.Index).To(Equal(actual.Index)) + Expect(lrpKey.ProcessGuid).To(Equal(actual.ActualLrpKey.ProcessGuid)) + Expect(lrpKey.Index).To(Equal(actual.ActualLrpKey.Index)) schedulingInfo := desiredLRP.DesiredLRPSchedulingInfo() - expectedStartRequest := auctioneer.NewLRPStartRequestFromSchedulingInfo(&schedulingInfo, int(actual.Index)) + expectedStartRequest := auctioneer.NewLRPStartRequestFromSchedulingInfo(&schedulingInfo, int(actual.ActualLrpKey.Index)) Expect(fakeAuctioneerClient.RequestLRPAuctionsCallCount()).To(Equal(1)) _, actualTraceId, startRequests := fakeAuctioneerClient.RequestLRPAuctionsArgsForCall(0) @@ -1164,7 +1164,7 @@ var _ = Describe("Evacuation Controller", func() { BeforeEach(func() { ordinary = model_helpers.NewValidActualLRP("the-guid", 1) ordinary.State = models.ActualLRPStateUnclaimed - ordinary.ActualLRPInstanceKey = models.ActualLRPInstanceKey{ + ordinary.ActualLrpInstanceKey = models.ActualLRPInstanceKey{ InstanceGuid: "replacement-guid", CellId: "replacement-cell", } @@ -1176,8 +1176,8 @@ var _ = Describe("Evacuation Controller", func() { It("removes the suspect LRP", func() { Expect(fakeSuspectDB.RemoveSuspectActualLRPCallCount()).To(Equal(1)) _, _, lrpKey := fakeSuspectDB.RemoveSuspectActualLRPArgsForCall(0) - Expect(lrpKey.ProcessGuid).To(Equal(actual.ProcessGuid)) - Expect(lrpKey.Index).To(Equal(actual.Index)) + Expect(lrpKey.ProcessGuid).To(Equal(actual.ActualLrpKey.ProcessGuid)) + Expect(lrpKey.Index).To(Equal(actual.ActualLrpKey.Index)) }) It("does not unclaim the LRP", func() { @@ -1221,8 +1221,8 @@ var _ = Describe("Evacuation Controller", func() { BeforeEach(func() { replacementActual = model_helpers.NewValidActualLRP("the-guid", 1) replacementActual.State = models.ActualLRPStateClaimed - replacementActual.CellId = "other-cell" - replacementActual.InstanceGuid = "other-guid" + replacementActual.ActualLrpInstanceKey.CellId = "other-cell" + replacementActual.ActualLrpInstanceKey.InstanceGuid = "other-guid" actualLRPs = append(actualLRPs, replacementActual) }) @@ -1364,8 +1364,8 @@ var _ = Describe("Evacuation Controller", func() { Expect(fakeEvacuationDB.RemoveEvacuatingActualLRPCallCount()).To(Equal(1)) _, _, actualLRPKey, actualLRPInstanceKey := fakeEvacuationDB.RemoveEvacuatingActualLRPArgsForCall(0) - Expect(*actualLRPKey).To(Equal(evacuatingActual.ActualLRPKey)) - Expect(*actualLRPInstanceKey).To(Equal(evacuatingActual.ActualLRPInstanceKey)) + Expect(*actualLRPKey).To(Equal(evacuatingActual.ActualLrpKey)) + Expect(*actualLRPInstanceKey).To(Equal(evacuatingActual.ActualLrpInstanceKey)) }) It("emits events to the hub", func() { @@ -1425,8 +1425,8 @@ var _ = Describe("Evacuation Controller", func() { Context("when the instance is crashed", func() { BeforeEach(func() { actual.State = models.ActualLRPStateCrashed - targetInstanceKey = evacuatingActual.ActualLRPInstanceKey - targetKey = evacuatingActual.ActualLRPKey + targetInstanceKey = evacuatingActual.ActualLrpInstanceKey + targetKey = evacuatingActual.ActualLrpKey actualLRPs = []*models.ActualLRP{actual, evacuatingActual} }) @@ -1436,8 +1436,8 @@ var _ = Describe("Evacuation Controller", func() { Expect(fakeEvacuationDB.RemoveEvacuatingActualLRPCallCount()).To(Equal(1)) _, _, actualLRPKey, actualLRPInstanceKey := fakeEvacuationDB.RemoveEvacuatingActualLRPArgsForCall(0) - Expect(*actualLRPKey).To(Equal(evacuatingActual.ActualLRPKey)) - Expect(*actualLRPInstanceKey).To(Equal(evacuatingActual.ActualLRPInstanceKey)) + Expect(*actualLRPKey).To(Equal(evacuatingActual.ActualLrpKey)) + Expect(*actualLRPInstanceKey).To(Equal(evacuatingActual.ActualLrpInstanceKey)) }) Context("when removing the evacuating LRP fails", func() { @@ -1495,8 +1495,8 @@ var _ = Describe("Evacuation Controller", func() { evacuating, }, nil) - targetInstanceKey = actual.ActualLRPInstanceKey - targetKey = actual.ActualLRPKey + targetInstanceKey = actual.ActualLrpInstanceKey + targetKey = actual.ActualLrpKey }) JustBeforeEach(func() { @@ -1538,7 +1538,7 @@ var _ = Describe("Evacuation Controller", func() { _, _, guid, index, actualLRPInstanceKey := fakeActualLRPDB.RemoveActualLRPArgsForCall(0) Expect(guid).To(Equal("process-guid")) Expect(index).To(BeEquivalentTo(1)) - Expect(actualLRPInstanceKey).To(Equal(&actual.ActualLRPInstanceKey)) + Expect(actualLRPInstanceKey).To(Equal(&actual.ActualLrpInstanceKey)) }) Context("when the LRP Instance is missing", func() { @@ -1564,8 +1564,8 @@ var _ = Describe("Evacuation Controller", func() { Expect(fakeEvacuationDB.RemoveEvacuatingActualLRPCallCount()).To(Equal(0)) _, _, lrpKey := fakeSuspectDB.RemoveSuspectActualLRPArgsForCall(0) - Expect(lrpKey.ProcessGuid).To(Equal(actual.ProcessGuid)) - Expect(lrpKey.Index).To(Equal(actual.Index)) + Expect(lrpKey.ProcessGuid).To(Equal(actual.ActualLrpKey.ProcessGuid)) + Expect(lrpKey.Index).To(Equal(actual.ActualLrpKey.Index)) }) It("emits ActualLRPRemovedEvent", func() { @@ -1614,7 +1614,7 @@ var _ = Describe("Evacuation Controller", func() { Context("when the LRP presence is Evacuating", func() { BeforeEach(func() { - targetInstanceKey = evacuating.ActualLRPInstanceKey + targetInstanceKey = evacuating.ActualLrpInstanceKey }) It("removes the evacuating actual lrp", func() { @@ -1622,8 +1622,8 @@ var _ = Describe("Evacuation Controller", func() { Expect(fakeActualLRPDB.RemoveActualLRPCallCount()).To(Equal(0)) _, _, lrpKey, lrpInstanceKey := fakeEvacuationDB.RemoveEvacuatingActualLRPArgsForCall(0) - Expect(*lrpKey).To(Equal(evacuating.ActualLRPKey)) - Expect(*lrpInstanceKey).To(Equal(evacuating.ActualLRPInstanceKey)) + Expect(*lrpKey).To(Equal(evacuating.ActualLrpKey)) + Expect(*lrpInstanceKey).To(Equal(evacuating.ActualLrpInstanceKey)) }) It("emits a removal event for the evacuating actual LRP", func() { diff --git a/controllers/lrp_convergence_controller_test.go b/controllers/lrp_convergence_controller_test.go index 42024aaf..fa18686e 100644 --- a/controllers/lrp_convergence_controller_test.go +++ b/controllers/lrp_convergence_controller_test.go @@ -425,7 +425,7 @@ var _ = Describe("LRP Convergence Controllers", func() { suspectActualLRP = model_helpers.NewValidActualLRP("to-unclaim-1", 0) keysWithMissingCells = []*models.ActualLRPKeyWithSchedulingInfo{ - {Key: &suspectActualLRP.ActualLRPKey, SchedulingInfo: &desiredLRP1}, + {Key: &suspectActualLRP.ActualLrpKey, SchedulingInfo: &desiredLRP1}, } fakeLRPDB.ConvergeLRPsReturns(db.ConvergenceResult{ KeysWithMissingCells: keysWithMissingCells, @@ -450,14 +450,14 @@ var _ = Describe("LRP Convergence Controllers", func() { _, _, key, from, to := fakeLRPDB.ChangeActualLRPPresenceArgsForCall(0) Expect(from).To(Equal(models.ActualLRP_Ordinary)) Expect(to).To(Equal(models.ActualLRP_Suspect)) - Expect(key).To(Equal(&suspectActualLRP.ActualLRPKey)) + Expect(key).To(Equal(&suspectActualLRP.ActualLrpKey)) }) It("creates a new unclaimed LRP", func() { Expect(fakeLRPDB.CreateUnclaimedActualLRPCallCount()).To(Equal(1)) _, _, lrpKey := fakeLRPDB.CreateUnclaimedActualLRPArgsForCall(0) - Expect(lrpKey).To(Equal(&suspectActualLRP.ActualLRPKey)) + Expect(lrpKey).To(Equal(&suspectActualLRP.ActualLrpKey)) }) It("auctions new lrps", func() { @@ -498,7 +498,7 @@ var _ = Describe("LRP Convergence Controllers", func() { Context("when there already is a Suspect LRP", func() { BeforeEach(func() { suspectLRPKeys := []*models.ActualLRPKey{ - &suspectActualLRP.ActualLRPKey, + &suspectActualLRP.ActualLrpKey, } fakeLRPDB.ConvergeLRPsReturns(db.ConvergenceResult{ KeysWithMissingCells: keysWithMissingCells, @@ -567,7 +567,7 @@ var _ = Describe("LRP Convergence Controllers", func() { removedActualLRP = model_helpers.NewValidActualLRP("removed-1", 0) suspectActualLRP.Presence = models.ActualLRP_Suspect - suspectKeysWithExistingCells = []*models.ActualLRPKey{&suspectActualLRP.ActualLRPKey} + suspectKeysWithExistingCells = []*models.ActualLRPKey{&suspectActualLRP.ActualLrpKey} fakeLRPDB.ActualLRPsReturns([]*models.ActualLRP{ordinaryActualLRP}, nil) fakeLRPDB.ConvergeLRPsReturns(db.ConvergenceResult{ @@ -693,7 +693,7 @@ var _ = Describe("LRP Convergence Controllers", func() { BeforeEach(func() { retiringActualLRP1 = model_helpers.NewValidActualLRP("to-retire-1", 0) retiringActualLRP2 = model_helpers.NewValidActualLRP("to-retire-2", 1) - keysToRetire = []*models.ActualLRPKey{&retiringActualLRP1.ActualLRPKey, &retiringActualLRP2.ActualLRPKey} + keysToRetire = []*models.ActualLRPKey{&retiringActualLRP1.ActualLrpKey, &retiringActualLRP2.ActualLrpKey} result := db.ConvergenceResult{ KeysToRetire: keysToRetire, @@ -721,8 +721,8 @@ var _ = Describe("LRP Convergence Controllers", func() { stoppedKeys[i] = key } - Expect(stoppedKeys).To(ContainElement(&retiringActualLRP1.ActualLRPKey)) - Expect(stoppedKeys).To(ContainElement(&retiringActualLRP2.ActualLRPKey)) + Expect(stoppedKeys).To(ContainElement(&retiringActualLRP1.ActualLrpKey)) + Expect(stoppedKeys).To(ContainElement(&retiringActualLRP2.ActualLrpKey)) }) }) diff --git a/controllers/task_controller.go b/controllers/task_controller.go index 4f020746..e9f60e47 100644 --- a/controllers/task_controller.go +++ b/controllers/task_controller.go @@ -107,7 +107,7 @@ func (c *TaskController) CancelTask(ctx context.Context, logger lager.Logger, ta } go c.taskHub.Emit(models.NewTaskChangedEvent(before, after)) - if after.CompletionCallbackUrl != "" { + if after.TaskDefinition.CompletionCallbackUrl != "" { logger.Info("task-client-completing-task") go c.taskCompletionClient.Submit(c.db, c.taskHub, after) } @@ -151,7 +151,7 @@ func (c *TaskController) FailTask(ctx context.Context, logger lager.Logger, task go c.taskHub.Emit(models.NewTaskChangedEvent(before, after)) - if after.CompletionCallbackUrl != "" { + if after.TaskDefinition.CompletionCallbackUrl != "" { logger.Info("task-client-completing-task") go c.taskCompletionClient.Submit(c.db, c.taskHub, after) } @@ -209,7 +209,7 @@ func (c *TaskController) CompleteTask( c.taskStatMetronNotifier.RecordTaskSucceeded(cellID) } - if after.CompletionCallbackUrl != "" { + if after.TaskDefinition.CompletionCallbackUrl != "" { logger.Info("task-client-completing-task") go c.taskCompletionClient.Submit(c.db, c.taskHub, after) } diff --git a/controllers/task_controller_test.go b/controllers/task_controller_test.go index 6e070f46..2b9fa5b1 100644 --- a/controllers/task_controller_test.go +++ b/controllers/task_controller_test.go @@ -438,7 +438,7 @@ var _ = Describe("Task Controller", func() { Context("and the task has a complete URL", func() { BeforeEach(func() { task := model_helpers.NewValidTask("hi-bob") - task.CompletionCallbackUrl = "bogus" + task.TaskDefinition.CompletionCallbackUrl = "bogus" fakeTaskDB.CancelTaskReturns(nil, task, cellID, nil) }) @@ -579,7 +579,7 @@ var _ = Describe("Task Controller", func() { Context("and the task has a complete URL", func() { BeforeEach(func() { task := model_helpers.NewValidTask("hi-bob") - task.CompletionCallbackUrl = "bogus" + task.TaskDefinition.CompletionCallbackUrl = "bogus" fakeTaskDB.FailTaskReturns(nil, task, nil) }) @@ -805,7 +805,7 @@ var _ = Describe("Task Controller", func() { Context("and the task has a complete URL", func() { BeforeEach(func() { task := model_helpers.NewValidTask("hi-bob") - task.CompletionCallbackUrl = "bogus" + task.TaskDefinition.CompletionCallbackUrl = "bogus" fakeTaskDB.CompleteTaskReturns(nil, task, nil) }) diff --git a/db/migrations/1722634733_split_metric_tags.go b/db/migrations/1722634733_split_metric_tags.go index 5756f3bc..1640119d 100644 --- a/db/migrations/1722634733_split_metric_tags.go +++ b/db/migrations/1722634733_split_metric_tags.go @@ -89,13 +89,15 @@ func (e *SplitMetricTags) Up(tx *sql.Tx, logger lager.Logger) error { logger.Error("failed-reading-row", err) continue } - var runInfo models.DesiredLRPRunInfo - err = e.serializer.Unmarshal(logger, runInfoData, &runInfo) + var protoRunInfo models.ProtoDesiredLRPRunInfo + err = e.serializer.Unmarshal(logger, runInfoData, &protoRunInfo) if err != nil { logger.Error("failed-parsing-run-info", err) continue } + runInfo := protoRunInfo.FromProto() metricTags := map[string]*models.MetricTagValue{} + //lint:ignore SA1019 - migration from deprecated functionality for k, v := range runInfo.MetricTags { metricTags[k] = v } diff --git a/db/migrations/1722634733_split_metric_tags_test.go b/db/migrations/1722634733_split_metric_tags_test.go index 9c8e497b..c535237d 100644 --- a/db/migrations/1722634733_split_metric_tags_test.go +++ b/db/migrations/1722634733_split_metric_tags_test.go @@ -54,7 +54,7 @@ var _ = Describe("SplitMetricTags", func() { Context("when there is desired lrp", func() { JustBeforeEach(func() { - runInfoData, err := serializer.Marshal(logger, runInfo) + runInfoData, err := serializer.Marshal(logger, runInfo.ToProto()) Expect(err).NotTo(HaveOccurred()) _, err = rawSQLDB.Exec( @@ -72,7 +72,8 @@ var _ = Describe("SplitMetricTags", func() { Context("when run info has metric tags", func() { BeforeEach(func() { - runInfo.MetricTags = map[string]*models.MetricTagValue{"foo": &models.MetricTagValue{Static: "some-value"}} + //lint:ignore SA1019 - testing deprecated functionality + runInfo.MetricTags = map[string]*models.MetricTagValue{"foo": {Static: "some-value"}} }) It("updates metric_tags to run_info metric_tags", func() { @@ -91,7 +92,7 @@ var _ = Describe("SplitMetricTags", func() { err = json.Unmarshal(decodedMetricTags, &metricTags) Expect(err).NotTo(HaveOccurred()) - Expect(metricTags).To(Equal(map[string]*models.MetricTagValue{"foo": &models.MetricTagValue{Static: "some-value"}})) + Expect(metricTags).To(Equal(map[string]*models.MetricTagValue{"foo": {Static: "some-value"}})) }) }) diff --git a/db/sqldb/actual_lrp_db.go b/db/sqldb/actual_lrp_db.go index 64d9012e..f7b9fdf6 100644 --- a/db/sqldb/actual_lrp_db.go +++ b/db/sqldb/actual_lrp_db.go @@ -113,7 +113,7 @@ func (db *SQLDB) CreateUnclaimedActualLRP(ctx context.Context, logger lager.Logg return nil, models.ErrGUIDGeneration } - netInfoData, err := db.serializeModel(logger, &models.ActualLRPNetInfo{}) + netInfoData, err := db.serializeModel(logger, &models.ProtoActualLRPNetInfo{}) if err != nil { logger.Error("failed-to-serialize-net-info", err) return nil, err @@ -157,14 +157,15 @@ func (db *SQLDB) CreateUnclaimedActualLRP(ctx context.Context, logger lager.Logg return nil, err } lrp := &models.ActualLRP{ - ActualLRPKey: *key, + ActualLrpKey: *key, State: models.ActualLRPStateUnclaimed, Since: now, ModificationTag: models.ModificationTag{Epoch: guid, Index: 0}, ActualLrpInternalRoutes: []*models.ActualLRPInternalRoute{}, MetricTags: map[string]string{}, } - lrp.SetRoutable(false) + routable := false + lrp.SetRoutable(&routable) return lrp, nil } @@ -195,11 +196,11 @@ func (db *SQLDB) UnclaimActualLRP(ctx context.Context, logger lager.Logger, key now := db.clock.Now().UnixNano() actualLRP.ModificationTag.Increment() actualLRP.State = models.ActualLRPStateUnclaimed - actualLRP.ActualLRPInstanceKey.CellId = "" - actualLRP.ActualLRPInstanceKey.InstanceGuid = "" + actualLRP.ActualLrpInstanceKey.CellId = "" + actualLRP.ActualLrpInstanceKey.InstanceGuid = "" actualLRP.Since = now - actualLRP.ActualLRPNetInfo = models.ActualLRPNetInfo{} - netInfoData, err := db.serializeModel(logger, &models.ActualLRPNetInfo{}) + actualLRP.ActualLrpNetInfo = models.ActualLRPNetInfo{} + netInfoData, err := db.serializeModel(logger, &models.ProtoActualLRPNetInfo{}) if err != nil { logger.Error("failed-to-serialize-net-info", err) return err @@ -208,8 +209,8 @@ func (db *SQLDB) UnclaimActualLRP(ctx context.Context, logger lager.Logger, key _, err = db.update(ctx, logger, tx, actualLRPsTable, helpers.SQLAttributes{ "state": actualLRP.State, - "cell_id": actualLRP.CellId, - "instance_guid": actualLRP.InstanceGuid, + "cell_id": actualLRP.ActualLrpInstanceKey.CellId, + "instance_guid": actualLRP.ActualLrpInstanceKey.InstanceGuid, "modification_tag_index": actualLRP.ModificationTag.Index, "since": actualLRP.Since, "net_info": netInfoData, @@ -244,22 +245,22 @@ func (db *SQLDB) ClaimActualLRP(ctx context.Context, logger lager.Logger, proces } beforeActualLRP = *actualLRP - if !actualLRP.AllowsTransitionTo(&actualLRP.ActualLRPKey, instanceKey, models.ActualLRPStateClaimed) { - logger.Error("cannot-transition-to-claimed", nil, lager.Data{"from_state": actualLRP.State, "same_instance_key": actualLRP.ActualLRPInstanceKey.Equal(instanceKey)}) + if !actualLRP.AllowsTransitionTo(&actualLRP.ActualLrpKey, instanceKey, models.ActualLRPStateClaimed) { + logger.Error("cannot-transition-to-claimed", nil, lager.Data{"from_state": actualLRP.State, "same_instance_key": actualLRP.ActualLrpInstanceKey.Equal(instanceKey)}) return models.ErrActualLRPCannotBeClaimed } - if actualLRP.State == models.ActualLRPStateClaimed && actualLRP.ActualLRPInstanceKey.Equal(instanceKey) { + if actualLRP.State == models.ActualLRPStateClaimed && actualLRP.ActualLrpInstanceKey.Equal(instanceKey) { return nil } actualLRP.ModificationTag.Increment() actualLRP.State = models.ActualLRPStateClaimed - actualLRP.ActualLRPInstanceKey = *instanceKey + actualLRP.ActualLrpInstanceKey = *instanceKey actualLRP.PlacementError = "" - actualLRP.ActualLRPNetInfo = models.ActualLRPNetInfo{} + actualLRP.ActualLrpNetInfo = models.ActualLRPNetInfo{} actualLRP.Since = db.clock.Now().UnixNano() - netInfoData, err := db.serializeModel(logger, &models.ActualLRPNetInfo{}) + netInfoData, err := db.serializeModel(logger, &models.ProtoActualLRPNetInfo{}) if err != nil { logger.Error("failed-to-serialize-net-info", err) return err @@ -268,8 +269,8 @@ func (db *SQLDB) ClaimActualLRP(ctx context.Context, logger lager.Logger, proces _, err = db.update(ctx, logger, tx, actualLRPsTable, helpers.SQLAttributes{ "state": actualLRP.State, - "cell_id": actualLRP.CellId, - "instance_guid": actualLRP.InstanceGuid, + "cell_id": actualLRP.ActualLrpInstanceKey.CellId, + "instance_guid": actualLRP.ActualLrpInstanceKey.InstanceGuid, "modification_tag_index": actualLRP.ModificationTag.Index, "placement_error": actualLRP.PlacementError, "since": actualLRP.Since, @@ -322,12 +323,12 @@ func (db *SQLDB) StartActualLRP( beforeActualLRP = *actualLRP - if actualLRP.ActualLRPKey.Equal(key) && - actualLRP.ActualLRPInstanceKey.Equal(instanceKey) && - actualLRP.ActualLRPNetInfo.Equal(netInfo) && + if actualLRP.ActualLrpKey.Equal(key) && + actualLRP.ActualLrpInstanceKey.Equal(instanceKey) && + actualLRP.ActualLrpNetInfo.Equal(netInfo) && reflect.DeepEqual(actualLRP.ActualLrpInternalRoutes, internalRoutes) && reflect.DeepEqual(actualLRP.MetricTags, metricTags) && - actualLRP.GetRoutable() == routable && + *actualLRP.GetRoutable() == routable && actualLRP.AvailabilityZone == availabilityZone && actualLRP.State == models.ActualLRPStateRunning { logger.Debug("nothing-to-change") @@ -341,8 +342,8 @@ func (db *SQLDB) StartActualLRP( now := db.clock.Now().UnixNano() - actualLRP.ActualLRPInstanceKey = *instanceKey - actualLRP.ActualLRPNetInfo = *netInfo + actualLRP.ActualLrpInstanceKey = *instanceKey + actualLRP.ActualLrpNetInfo = *netInfo actualLRP.ActualLrpInternalRoutes = internalRoutes actualLRP.MetricTags = metricTags actualLRP.AvailabilityZone = availabilityZone @@ -350,9 +351,9 @@ func (db *SQLDB) StartActualLRP( actualLRP.Since = now actualLRP.ModificationTag.Increment() actualLRP.PlacementError = "" - actualLRP.SetRoutable(routable) + actualLRP.SetRoutable(&routable) - netInfoData, err := db.serializeModel(logger, &actualLRP.ActualLRPNetInfo) + netInfoData, err := db.serializeModel(logger, actualLRP.ActualLrpNetInfo.ToProto()) if err != nil { logger.Error("failed-to-serialize-net-info", err) return err @@ -373,8 +374,8 @@ func (db *SQLDB) StartActualLRP( _, err = db.update(ctx, logger, tx, actualLRPsTable, helpers.SQLAttributes{ "state": actualLRP.State, - "cell_id": actualLRP.CellId, - "instance_guid": actualLRP.InstanceGuid, + "cell_id": actualLRP.ActualLrpInstanceKey.CellId, + "instance_guid": actualLRP.ActualLrpInstanceKey.InstanceGuid, "modification_tag_index": actualLRP.ModificationTag.Index, "placement_error": actualLRP.PlacementError, "since": actualLRP.Since, @@ -433,20 +434,20 @@ func (db *SQLDB) CrashActualLRP(ctx context.Context, logger lager.Logger, key *m newCrashCount = actualLRP.CrashCount + 1 } - if !actualLRP.AllowsTransitionTo(&actualLRP.ActualLRPKey, instanceKey, models.ActualLRPStateCrashed) { - logger.Error("failed-to-transition-to-crashed", nil, lager.Data{"from_state": actualLRP.State, "same_instance_key": actualLRP.ActualLRPInstanceKey.Equal(instanceKey)}) + if !actualLRP.AllowsTransitionTo(&actualLRP.ActualLrpKey, instanceKey, models.ActualLRPStateCrashed) { + logger.Error("failed-to-transition-to-crashed", nil, lager.Data{"from_state": actualLRP.State, "same_instance_key": actualLRP.ActualLrpInstanceKey.Equal(instanceKey)}) return models.ErrActualLRPCannotBeCrashed } actualLRP.ModificationTag.Increment() actualLRP.State = models.ActualLRPStateCrashed - actualLRP.ActualLRPInstanceKey.InstanceGuid = "" - actualLRP.ActualLRPInstanceKey.CellId = "" - actualLRP.ActualLRPNetInfo = models.ActualLRPNetInfo{} + actualLRP.ActualLrpInstanceKey.InstanceGuid = "" + actualLRP.ActualLrpInstanceKey.CellId = "" + actualLRP.ActualLrpNetInfo = models.ActualLRPNetInfo{} actualLRP.CrashCount = newCrashCount actualLRP.CrashReason = crashReason - netInfoData, err := db.serializeModel(logger, &actualLRP.ActualLRPNetInfo) + netInfoData, err := db.serializeModel(logger, actualLRP.ActualLrpNetInfo.ToProto()) if err != nil { logger.Error("failed-to-serialize-net-info", err) return err @@ -463,8 +464,8 @@ func (db *SQLDB) CrashActualLRP(ctx context.Context, logger lager.Logger, key *m _, err = db.update(ctx, logger, tx, actualLRPsTable, helpers.SQLAttributes{ "state": actualLRP.State, - "cell_id": actualLRP.CellId, - "instance_guid": actualLRP.InstanceGuid, + "cell_id": actualLRP.ActualLrpInstanceKey.CellId, + "instance_guid": actualLRP.ActualLrpInstanceKey.InstanceGuid, "modification_tag_index": actualLRP.ModificationTag.Index, "crash_count": actualLRP.CrashCount, "crash_reason": truncateString(actualLRP.CrashReason, 1024), @@ -579,17 +580,17 @@ func (db *SQLDB) createRunningActualLRP(ctx context.Context, logger lager.Logger actualLRP := &models.ActualLRP{} actualLRP.ModificationTag = models.NewModificationTag(guid, 0) - actualLRP.ActualLRPKey = *key - actualLRP.ActualLRPInstanceKey = *instanceKey - actualLRP.ActualLRPNetInfo = *netInfo + actualLRP.ActualLrpKey = *key + actualLRP.ActualLrpInstanceKey = *instanceKey + actualLRP.ActualLrpNetInfo = *netInfo actualLRP.ActualLrpInternalRoutes = internalRoutes actualLRP.MetricTags = metricTags actualLRP.State = models.ActualLRPStateRunning actualLRP.Since = now - actualLRP.SetRoutable(routable) + actualLRP.SetRoutable(&routable) actualLRP.AvailabilityZone = availabilityZone - netInfoData, err := db.serializeModel(logger, &actualLRP.ActualLRPNetInfo) + netInfoData, err := db.serializeModel(logger, actualLRP.ActualLrpNetInfo.ToProto()) if err != nil { return nil, err } @@ -608,11 +609,11 @@ func (db *SQLDB) createRunningActualLRP(ctx context.Context, logger lager.Logger _, err = db.insert(ctx, logger, tx, actualLRPsTable, helpers.SQLAttributes{ - "process_guid": actualLRP.ActualLRPKey.ProcessGuid, - "instance_index": actualLRP.ActualLRPKey.Index, - "domain": actualLRP.ActualLRPKey.Domain, - "instance_guid": actualLRP.ActualLRPInstanceKey.InstanceGuid, - "cell_id": actualLRP.ActualLRPInstanceKey.CellId, + "process_guid": actualLRP.ActualLrpKey.ProcessGuid, + "instance_index": actualLRP.ActualLrpKey.Index, + "domain": actualLRP.ActualLrpKey.Domain, + "instance_guid": actualLRP.ActualLrpInstanceKey.InstanceGuid, + "cell_id": actualLRP.ActualLrpInstanceKey.CellId, "state": actualLRP.State, "net_info": netInfoData, "internal_routes": internalRoutesData, @@ -639,13 +640,13 @@ func (db *SQLDB) scanToActualLRP(logger lager.Logger, row helpers.RowScanner) (* var actualLRP models.ActualLRP err := row.Scan( - &actualLRP.ProcessGuid, - &actualLRP.Index, + &actualLRP.ActualLrpKey.ProcessGuid, + &actualLRP.ActualLrpKey.Index, &actualLRP.Presence, - &actualLRP.Domain, + &actualLRP.ActualLrpKey.Domain, &actualLRP.State, - &actualLRP.InstanceGuid, - &actualLRP.CellId, + &actualLRP.ActualLrpInstanceKey.InstanceGuid, + &actualLRP.ActualLrpInstanceKey.CellId, &actualLRP.PlacementError, &actualLRP.Since, &netInfoData, @@ -664,7 +665,9 @@ func (db *SQLDB) scanToActualLRP(logger lager.Logger, row helpers.RowScanner) (* } if len(netInfoData) > 0 { - err = db.deserializeModel(logger, netInfoData, &actualLRP.ActualLRPNetInfo) + protoNetInfo := models.ProtoActualLRPNetInfo{} + err = db.deserializeModel(logger, netInfoData, &protoNetInfo) + actualLRP.ActualLrpNetInfo = *protoNetInfo.FromProto() if err != nil { logger.Error("failed-unmarshaling-net-info-data", err) return &actualLRP, models.ErrDeserialize @@ -700,7 +703,7 @@ func (db *SQLDB) scanToActualLRP(logger lager.Logger, row helpers.RowScanner) (* } } actualLRP.MetricTags = metricTags - actualLRP.SetRoutable(routable) + actualLRP.SetRoutable(&routable) return &actualLRP, nil } @@ -755,7 +758,7 @@ func (db *SQLDB) scanAndCleanupActualLRPs(ctx context.Context, logger lager.Logg for _, actual := range actualsToDelete { _, err := db.delete(ctx, logger, q, actualLRPsTable, "process_guid = ? AND instance_index = ? AND presence = ?", - actual.ProcessGuid, actual.Index, actual.Presence, + actual.ActualLrpKey.ProcessGuid, actual.ActualLrpKey.Index, actual.Presence, ) if err != nil { logger.Error("failed-cleaning-up-invalid-actual-lrp", err) diff --git a/db/sqldb/actual_lrp_db_test.go b/db/sqldb/actual_lrp_db_test.go index 52f434e8..cb79dbfe 100644 --- a/db/sqldb/actual_lrp_db_test.go +++ b/db/sqldb/actual_lrp_db_test.go @@ -117,7 +117,8 @@ var _ = Describe("ActualLRPDB", func() { expectedActualLRP.ModificationTag.Index = 0 expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: key.ProcessGuid, Index: &key.Index}) Expect(err).NotTo(HaveOccurred()) @@ -176,9 +177,10 @@ var _ = Describe("ActualLRPDB", func() { _, _, err = sqlDB.ClaimActualLRP(ctx, logger, actualLRPKey1.ProcessGuid, actualLRPKey1.Index, instanceKey1) Expect(err).NotTo(HaveOccurred()) + routableFalse := false allActualLRPs = append(allActualLRPs, &models.ActualLRP{ - ActualLRPKey: *actualLRPKey1, - ActualLRPInstanceKey: *instanceKey1, + ActualLrpKey: *actualLRPKey1, + ActualLrpInstanceKey: *instanceKey1, State: models.ActualLRPStateClaimed, Since: fakeClock.Now().UnixNano(), ModificationTag: models.ModificationTag{ @@ -187,7 +189,7 @@ var _ = Describe("ActualLRPDB", func() { }, ActualLrpInternalRoutes: []*models.ActualLRPInternalRoute{}, MetricTags: map[string]string{}, - OptionalRoutable: &models.ActualLRP_Routable{Routable: false}, + Routable: &routableFalse, }) actualLRPKey2 := &models.ActualLRPKey{ @@ -206,8 +208,8 @@ var _ = Describe("ActualLRPDB", func() { _, _, err = sqlDB.ClaimActualLRP(ctx, logger, actualLRPKey2.ProcessGuid, actualLRPKey2.Index, instanceKey2) Expect(err).NotTo(HaveOccurred()) allActualLRPs = append(allActualLRPs, &models.ActualLRP{ - ActualLRPKey: *actualLRPKey2, - ActualLRPInstanceKey: *instanceKey2, + ActualLrpKey: *actualLRPKey2, + ActualLrpInstanceKey: *instanceKey2, State: models.ActualLRPStateClaimed, Since: fakeClock.Now().UnixNano(), ModificationTag: models.ModificationTag{ @@ -216,7 +218,7 @@ var _ = Describe("ActualLRPDB", func() { }, ActualLrpInternalRoutes: []*models.ActualLRPInternalRoute{}, MetricTags: map[string]string{}, - OptionalRoutable: &models.ActualLRP_Routable{Routable: false}, + Routable: &routableFalse, }) actualLRPKey3 := &models.ActualLRPKey{ @@ -234,8 +236,8 @@ var _ = Describe("ActualLRPDB", func() { _, _, err = sqlDB.ClaimActualLRP(ctx, logger, actualLRPKey3.ProcessGuid, actualLRPKey3.Index, instanceKey3) Expect(err).NotTo(HaveOccurred()) allActualLRPs = append(allActualLRPs, &models.ActualLRP{ - ActualLRPKey: *actualLRPKey3, - ActualLRPInstanceKey: *instanceKey3, + ActualLrpKey: *actualLRPKey3, + ActualLrpInstanceKey: *instanceKey3, State: models.ActualLRPStateClaimed, Since: fakeClock.Now().UnixNano(), ModificationTag: models.ModificationTag{ @@ -244,7 +246,7 @@ var _ = Describe("ActualLRPDB", func() { }, ActualLrpInternalRoutes: []*models.ActualLRPInternalRoute{}, MetricTags: map[string]string{}, - OptionalRoutable: &models.ActualLRP_Routable{Routable: false}, + Routable: &routableFalse, }) actualLRPKey4 := &models.ActualLRPKey{ @@ -255,7 +257,7 @@ var _ = Describe("ActualLRPDB", func() { _, err = sqlDB.CreateUnclaimedActualLRP(ctx, logger, actualLRPKey4) Expect(err).NotTo(HaveOccurred()) allActualLRPs = append(allActualLRPs, &models.ActualLRP{ - ActualLRPKey: *actualLRPKey4, + ActualLrpKey: *actualLRPKey4, State: models.ActualLRPStateUnclaimed, Since: fakeClock.Now().UnixNano(), ModificationTag: models.ModificationTag{ @@ -264,7 +266,7 @@ var _ = Describe("ActualLRPDB", func() { }, ActualLrpInternalRoutes: []*models.ActualLRPInternalRoute{}, MetricTags: map[string]string{}, - OptionalRoutable: &models.ActualLRP_Routable{Routable: false}, + Routable: &routableFalse, }) actualLRPKey5 := &models.ActualLRPKey{ @@ -288,8 +290,8 @@ var _ = Describe("ActualLRPDB", func() { _, err = db.ExecContext(ctx, queryStr, models.ActualLRP_Evacuating, actualLRPKey5.ProcessGuid, actualLRPKey5.Index, models.ActualLRP_Ordinary) Expect(err).NotTo(HaveOccurred()) allActualLRPs = append(allActualLRPs, &models.ActualLRP{ - ActualLRPKey: *actualLRPKey5, - ActualLRPInstanceKey: *instanceKey5, + ActualLrpKey: *actualLRPKey5, + ActualLrpInstanceKey: *instanceKey5, State: models.ActualLRPStateClaimed, Since: fakeClock.Now().UnixNano(), ModificationTag: models.ModificationTag{ @@ -299,7 +301,7 @@ var _ = Describe("ActualLRPDB", func() { Presence: models.ActualLRP_Evacuating, ActualLrpInternalRoutes: []*models.ActualLRPInternalRoute{}, MetricTags: map[string]string{}, - OptionalRoutable: &models.ActualLRP_Routable{Routable: false}, + Routable: &routableFalse, }) actualLRPKey6 := &models.ActualLRPKey{ @@ -339,9 +341,9 @@ var _ = Describe("ActualLRPDB", func() { Expect(err).NotTo(HaveOccurred()) allActualLRPs = append(allActualLRPs, &models.ActualLRP{ - ActualLRPKey: *actualLRPKey6, - ActualLRPInstanceKey: *instanceKey6, - ActualLRPNetInfo: netInfo, + ActualLrpKey: *actualLRPKey6, + ActualLrpInstanceKey: *instanceKey6, + ActualLrpNetInfo: netInfo, State: models.ActualLRPStateRunning, Since: fakeClock.Now().UnixNano(), ModificationTag: models.ModificationTag{ @@ -351,12 +353,12 @@ var _ = Describe("ActualLRPDB", func() { Presence: models.ActualLRP_Suspect, ActualLrpInternalRoutes: internalRoutes, MetricTags: metricTags, - OptionalRoutable: &models.ActualLRP_Routable{Routable: false}, + Routable: &routableFalse, AvailabilityZone: availabilityZone6, }) allActualLRPs = append(allActualLRPs, &models.ActualLRP{ - ActualLRPKey: *actualLRPKey6, - ActualLRPInstanceKey: *instanceKey6, + ActualLrpKey: *actualLRPKey6, + ActualLrpInstanceKey: *instanceKey6, State: models.ActualLRPStateClaimed, Since: fakeClock.Now().UnixNano(), ModificationTag: models.ModificationTag{ @@ -365,7 +367,7 @@ var _ = Describe("ActualLRPDB", func() { }, ActualLrpInternalRoutes: []*models.ActualLRPInternalRoute{}, MetricTags: map[string]string{}, - OptionalRoutable: &models.ActualLRP_Routable{Routable: false}, + Routable: &routableFalse, }) nullInternalRoutesActualLRPKey := &models.ActualLRPKey{ @@ -390,9 +392,9 @@ var _ = Describe("ActualLRPDB", func() { Expect(err).NotTo(HaveOccurred()) allActualLRPs = append(allActualLRPs, &models.ActualLRP{ - ActualLRPKey: *nullInternalRoutesActualLRPKey, - ActualLRPInstanceKey: *nullInteralRoutesInstanceKey, - ActualLRPNetInfo: models.ActualLRPNetInfo{}, + ActualLrpKey: *nullInternalRoutesActualLRPKey, + ActualLrpInstanceKey: *nullInteralRoutesInstanceKey, + ActualLrpNetInfo: models.ActualLRPNetInfo{}, State: models.ActualLRPStateClaimed, Since: fakeClock.Now().UnixNano(), ModificationTag: models.ModificationTag{ @@ -402,7 +404,7 @@ var _ = Describe("ActualLRPDB", func() { Presence: models.ActualLRP_Ordinary, ActualLrpInternalRoutes: []*models.ActualLRPInternalRoute{}, MetricTags: map[string]string{}, - OptionalRoutable: &models.ActualLRP_Routable{Routable: false}, + Routable: &routableFalse, }) }) @@ -419,8 +421,8 @@ var _ = Describe("ActualLRPDB", func() { actualLRPWithInvalidData = model_helpers.NewValidActualLRP("invalid", 0) internalRoutes := model_helpers.NewActualLRPInternalRoutes() metricTags := model_helpers.NewActualLRPMetricTags() - _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRPWithInvalidData.ActualLRPKey, - &actualLRPWithInvalidData.ActualLRPInstanceKey, &actualLRPWithInvalidData.ActualLRPNetInfo, internalRoutes, metricTags, false, "some-zone") + _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRPWithInvalidData.ActualLrpKey, + &actualLRPWithInvalidData.ActualLrpInstanceKey, &actualLRPWithInvalidData.ActualLrpNetInfo, internalRoutes, metricTags, false, "some-zone") Expect(err).NotTo(HaveOccurred()) queryStr := `UPDATE actual_lrps SET net_info = 'garbage' WHERE process_guid = 'invalid'` if test_helpers.UsePostgres() { @@ -445,8 +447,8 @@ var _ = Describe("ActualLRPDB", func() { actualLRPWithInvalidData = model_helpers.NewValidActualLRP("invalid", 0) internalRoutes := model_helpers.NewActualLRPInternalRoutes() metricTags := model_helpers.NewActualLRPMetricTags() - _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRPWithInvalidData.ActualLRPKey, - &actualLRPWithInvalidData.ActualLRPInstanceKey, &actualLRPWithInvalidData.ActualLRPNetInfo, internalRoutes, metricTags, false, "some-zone") + _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRPWithInvalidData.ActualLrpKey, + &actualLRPWithInvalidData.ActualLrpInstanceKey, &actualLRPWithInvalidData.ActualLrpNetInfo, internalRoutes, metricTags, false, "some-zone") Expect(err).NotTo(HaveOccurred()) queryStr := `UPDATE actual_lrps SET internal_routes = 'garbage' WHERE process_guid = 'invalid'` if test_helpers.UsePostgres() { @@ -470,8 +472,8 @@ var _ = Describe("ActualLRPDB", func() { actualLRPWithInvalidData = model_helpers.NewValidActualLRP("invalid", 0) internalRoutes := model_helpers.NewActualLRPInternalRoutes() metricTags := model_helpers.NewActualLRPMetricTags() - _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRPWithInvalidData.ActualLRPKey, - &actualLRPWithInvalidData.ActualLRPInstanceKey, &actualLRPWithInvalidData.ActualLRPNetInfo, internalRoutes, metricTags, false, "some-zone") + _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRPWithInvalidData.ActualLrpKey, + &actualLRPWithInvalidData.ActualLrpInstanceKey, &actualLRPWithInvalidData.ActualLrpNetInfo, internalRoutes, metricTags, false, "some-zone") Expect(err).NotTo(HaveOccurred()) queryStr := `UPDATE actual_lrps SET metric_tags = 'garbage' WHERE process_guid = 'invalid'` if test_helpers.UsePostgres() { @@ -604,7 +606,7 @@ var _ = Describe("ActualLRPDB", func() { BeforeEach(func() { expectedActualLRP = &models.ActualLRP{ - ActualLRPKey: models.ActualLRPKey{ + ActualLrpKey: models.ActualLRPKey{ ProcessGuid: "the-guid", Index: 1, Domain: "the-domain", @@ -614,7 +616,7 @@ var _ = Describe("ActualLRPDB", func() { Index: 0, }, } - _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &expectedActualLRP.ActualLRPKey) + _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &expectedActualLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) lrpCreationTime = fakeClock.Now() fakeClock.Increment(time.Hour) @@ -622,35 +624,37 @@ var _ = Describe("ActualLRPDB", func() { Context("and the actual lrp is UNCLAIMED", func() { It("claims the actual lrp", func() { - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ProcessGuid, expectedActualLRP.Index, instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ActualLrpKey.ProcessGuid, expectedActualLRP.ActualLrpKey.Index, instanceKey) Expect(err).NotTo(HaveOccurred()) expectedActualLRP.State = models.ActualLRPStateClaimed - expectedActualLRP.ActualLRPInstanceKey = *instanceKey + expectedActualLRP.ActualLrpInstanceKey = *instanceKey expectedActualLRP.ModificationTag.Increment() expectedActualLRP.Since = fakeClock.Now().UnixNano() expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ProcessGuid, Index: &expectedActualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, Index: &expectedActualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(expectedActualLRP)) }) It("returns the existing actual lrp", func() { - beforeActualLRP, afterActualLRP, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ProcessGuid, expectedActualLRP.Index, instanceKey) + beforeActualLRP, afterActualLRP, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ActualLrpKey.ProcessGuid, expectedActualLRP.ActualLrpKey.Index, instanceKey) Expect(err).NotTo(HaveOccurred()) expectedActualLRP.State = models.ActualLRPStateUnclaimed expectedActualLRP.Since = lrpCreationTime.UnixNano() expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) Expect(beforeActualLRP).To(Equal(expectedActualLRP)) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ProcessGuid, Index: &expectedActualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, Index: &expectedActualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(afterActualLRP)) @@ -666,25 +670,26 @@ var _ = Describe("ActualLRPDB", func() { } _, err := db.ExecContext(ctx, queryStr, "i am placement errror, how are you?", - expectedActualLRP.ProcessGuid, - expectedActualLRP.Index, + expectedActualLRP.ActualLrpKey.ProcessGuid, + expectedActualLRP.ActualLrpKey.Index, ) Expect(err).NotTo(HaveOccurred()) }) It("clears the placement error", func() { - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ProcessGuid, expectedActualLRP.Index, instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ActualLrpKey.ProcessGuid, expectedActualLRP.ActualLrpKey.Index, instanceKey) Expect(err).NotTo(HaveOccurred()) expectedActualLRP.State = models.ActualLRPStateClaimed - expectedActualLRP.ActualLRPInstanceKey = *instanceKey + expectedActualLRP.ActualLrpInstanceKey = *instanceKey expectedActualLRP.ModificationTag.Increment() expectedActualLRP.Since = fakeClock.Now().UnixNano() expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ProcessGuid, Index: &expectedActualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, Index: &expectedActualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(expectedActualLRP)) }) @@ -694,28 +699,29 @@ var _ = Describe("ActualLRPDB", func() { Context("and the actual lrp is CLAIMED", func() { Context("when the actual lrp is already claimed with the same instance key", func() { BeforeEach(func() { - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ProcessGuid, expectedActualLRP.Index, instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ActualLrpKey.ProcessGuid, expectedActualLRP.ActualLrpKey.Index, instanceKey) Expect(err).NotTo(HaveOccurred()) expectedActualLRP.ModificationTag.Increment() }) It("does not update the actual lrp", func() { expectedActualLRP.State = models.ActualLRPStateClaimed - expectedActualLRP.ActualLRPInstanceKey = *instanceKey + expectedActualLRP.ActualLrpInstanceKey = *instanceKey expectedActualLRP.Since = fakeClock.Now().UnixNano() expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) fakeClock.Increment(time.Hour) - beforeActualLRP, afterActualLRP, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ProcessGuid, expectedActualLRP.Index, instanceKey) + beforeActualLRP, afterActualLRP, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ActualLrpKey.ProcessGuid, expectedActualLRP.ActualLrpKey.Index, instanceKey) Expect(err).NotTo(HaveOccurred()) Expect(beforeActualLRP).To(Equal(afterActualLRP)) Expect(afterActualLRP).To(Equal(expectedActualLRP)) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ProcessGuid, Index: &expectedActualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, Index: &expectedActualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(expectedActualLRP)) }) @@ -723,10 +729,10 @@ var _ = Describe("ActualLRPDB", func() { Context("when the actual lrp is claimed by another cell", func() { BeforeEach(func() { - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ProcessGuid, expectedActualLRP.Index, instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ActualLrpKey.ProcessGuid, expectedActualLRP.ActualLrpKey.Index, instanceKey) Expect(err).NotTo(HaveOccurred()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ProcessGuid, Index: &expectedActualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, Index: &expectedActualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(HaveLen(1)) expectedActualLRP = actualLRPs[0] @@ -738,10 +744,10 @@ var _ = Describe("ActualLRPDB", func() { CellId: "different-cell", } - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ProcessGuid, expectedActualLRP.Index, instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ActualLrpKey.ProcessGuid, expectedActualLRP.ActualLrpKey.Index, instanceKey) Expect(err).To(HaveOccurred()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ProcessGuid, Index: &expectedActualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, Index: &expectedActualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(expectedActualLRP)) }) @@ -765,9 +771,9 @@ var _ = Describe("ActualLRPDB", func() { _, _, err := sqlDB.StartActualLRP(ctx, logger, &models.ActualLRPKey{ - ProcessGuid: expectedActualLRP.ProcessGuid, - Index: expectedActualLRP.Index, - Domain: expectedActualLRP.Domain, + ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, + Index: expectedActualLRP.ActualLrpKey.Index, + Domain: expectedActualLRP.ActualLrpKey.Domain, }, &models.ActualLRPInstanceKey{ InstanceGuid: instanceKey.InstanceGuid, @@ -779,19 +785,20 @@ var _ = Describe("ActualLRPDB", func() { Context("with the same cell and instance guid", func() { It("reverts the RUNNING actual lrp to the CLAIMED state", func() { - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ProcessGuid, expectedActualLRP.Index, instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ActualLrpKey.ProcessGuid, expectedActualLRP.ActualLrpKey.Index, instanceKey) Expect(err).NotTo(HaveOccurred()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ProcessGuid, Index: &expectedActualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, Index: &expectedActualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) - expectedActualLRP.ActualLRPInstanceKey = *instanceKey + expectedActualLRP.ActualLrpInstanceKey = *instanceKey expectedActualLRP.State = models.ActualLRPStateClaimed expectedActualLRP.Since = fakeClock.Now().UnixNano() expectedActualLRP.ModificationTag.Increment() expectedActualLRP.ActualLrpInternalRoutes = internalRoutes expectedActualLRP.MetricTags = metricTags - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) expectedActualLRP.AvailabilityZone = availabilityZone Expect(actualLRPs).To(ConsistOf(expectedActualLRP)) @@ -802,17 +809,17 @@ var _ = Describe("ActualLRPDB", func() { BeforeEach(func() { instanceKey.CellId = "another-cell" - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ProcessGuid, Index: &expectedActualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, Index: &expectedActualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(HaveLen(1)) expectedActualLRP = actualLRPs[0] }) It("returns an error", func() { - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ProcessGuid, expectedActualLRP.Index, instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ActualLrpKey.ProcessGuid, expectedActualLRP.ActualLrpKey.Index, instanceKey) Expect(err).To(HaveOccurred()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ProcessGuid, Index: &expectedActualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, Index: &expectedActualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(expectedActualLRP)) }) @@ -822,17 +829,17 @@ var _ = Describe("ActualLRPDB", func() { BeforeEach(func() { instanceKey.InstanceGuid = "another-instance-guid" - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ProcessGuid, Index: &expectedActualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, Index: &expectedActualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(HaveLen(1)) expectedActualLRP = actualLRPs[0] }) It("returns an error", func() { - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ProcessGuid, expectedActualLRP.Index, instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ActualLrpKey.ProcessGuid, expectedActualLRP.ActualLrpKey.Index, instanceKey) Expect(err).To(HaveOccurred()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ProcessGuid, Index: &expectedActualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, Index: &expectedActualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(expectedActualLRP)) }) @@ -849,17 +856,17 @@ var _ = Describe("ActualLRPDB", func() { } _, err := db.ExecContext(ctx, queryStr, models.ActualLRPStateCrashed, - expectedActualLRP.ProcessGuid, - expectedActualLRP.Index, + expectedActualLRP.ActualLrpKey.ProcessGuid, + expectedActualLRP.ActualLrpKey.Index, ) Expect(err).NotTo(HaveOccurred()) }) It("returns an error", func() { - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ProcessGuid, expectedActualLRP.Index, instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ActualLrpKey.ProcessGuid, expectedActualLRP.ActualLrpKey.Index, instanceKey) Expect(err).To(HaveOccurred()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ProcessGuid, Index: &expectedActualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, Index: &expectedActualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(HaveLen(1)) Expect(actualLRPs[0].State).To(Equal(models.ActualLRPStateCrashed)) @@ -874,8 +881,8 @@ var _ = Describe("ActualLRPDB", func() { } _, err := db.ExecContext(ctx, queryStr, models.ActualLRP_Evacuating, - expectedActualLRP.ActualLRPKey.ProcessGuid, - expectedActualLRP.ActualLRPKey.Index, + expectedActualLRP.ActualLrpKey.ProcessGuid, + expectedActualLRP.ActualLrpKey.Index, models.ActualLRP_Ordinary, ) Expect(err).NotTo(HaveOccurred()) @@ -885,15 +892,16 @@ var _ = Describe("ActualLRPDB", func() { expectedActualLRP.Presence = models.ActualLRP_Evacuating expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) }) It("returns an error", func() { - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ProcessGuid, expectedActualLRP.Index, instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, expectedActualLRP.ActualLrpKey.ProcessGuid, expectedActualLRP.ActualLrpKey.Index, instanceKey) Expect(err).To(HaveOccurred()) Expect(err).To(Equal(models.ErrResourceNotFound)) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ProcessGuid, Index: &expectedActualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: expectedActualLRP.ActualLrpKey.ProcessGuid, Index: &expectedActualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(expectedActualLRP)) }) @@ -951,29 +959,29 @@ var _ = Describe("ActualLRPDB", func() { internalRoutes = model_helpers.NewActualLRPInternalRoutes() metricTags = model_helpers.NewActualLRPMetricTags() actualLRP = &models.ActualLRP{ - ActualLRPKey: models.ActualLRPKey{ + ActualLrpKey: models.ActualLRPKey{ ProcessGuid: "the-guid", Index: 1, Domain: "the-domain", }, } - _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) fakeClock.Increment(time.Hour) }) Context("and the actual lrp is UNCLAIMED", func() { It("transitions the state to RUNNING", func() { - _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, true, availabilityZone) + _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, true, availabilityZone) Expect(err).NotTo(HaveOccurred()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP - expectedActualLRP.ActualLRPInstanceKey = *instanceKey + expectedActualLRP.ActualLrpInstanceKey = *instanceKey expectedActualLRP.State = models.ActualLRPStateRunning - expectedActualLRP.ActualLRPNetInfo = *netInfo + expectedActualLRP.ActualLrpNetInfo = *netInfo expectedActualLRP.Since = fakeClock.Now().UnixNano() expectedActualLRP.ModificationTag = models.ModificationTag{ Epoch: "my-awesome-guid", @@ -981,14 +989,15 @@ var _ = Describe("ActualLRPDB", func() { } expectedActualLRP.ActualLrpInternalRoutes = internalRoutes expectedActualLRP.MetricTags = metricTags - expectedActualLRP.SetRoutable(true) + routable := true + expectedActualLRP.SetRoutable(&routable) expectedActualLRP.AvailabilityZone = availabilityZone Expect(actualLRPs).To(ConsistOf(&expectedActualLRP)) }) It("returns the existing actual lrp", func() { - beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) + beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP expectedActualLRP.State = models.ActualLRPStateUnclaimed @@ -999,11 +1008,12 @@ var _ = Describe("ActualLRPDB", func() { } expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) Expect(beforeActualLRP).To(Equal(&expectedActualLRP)) expectedActualLRP.AvailabilityZone = availabilityZone - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(afterActualLRP)) }) @@ -1011,22 +1021,22 @@ var _ = Describe("ActualLRPDB", func() { Context("and the actual lrp has been CLAIMED", func() { BeforeEach(func() { - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, actualLRP.ProcessGuid, actualLRP.Index, instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, instanceKey) Expect(err).NotTo(HaveOccurred()) fakeClock.Increment(time.Hour) }) It("transitions the state to RUNNING", func() { - _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, true, availabilityZone) + _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, true, availabilityZone) Expect(err).NotTo(HaveOccurred()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP - expectedActualLRP.ActualLRPInstanceKey = *instanceKey + expectedActualLRP.ActualLrpInstanceKey = *instanceKey expectedActualLRP.State = models.ActualLRPStateRunning - expectedActualLRP.ActualLRPNetInfo = *netInfo + expectedActualLRP.ActualLrpNetInfo = *netInfo expectedActualLRP.Since = fakeClock.Now().UnixNano() expectedActualLRP.ModificationTag = models.ModificationTag{ Epoch: "my-awesome-guid", @@ -1034,18 +1044,19 @@ var _ = Describe("ActualLRPDB", func() { } expectedActualLRP.ActualLrpInternalRoutes = internalRoutes expectedActualLRP.MetricTags = metricTags - expectedActualLRP.SetRoutable(true) + routable := true + expectedActualLRP.SetRoutable(&routable) expectedActualLRP.AvailabilityZone = availabilityZone Expect(actualLRPs).To(ConsistOf(&expectedActualLRP)) }) It("returns the existing actual lrp", func() { - beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) + beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP - expectedActualLRP.ActualLRPInstanceKey = *instanceKey + expectedActualLRP.ActualLrpInstanceKey = *instanceKey expectedActualLRP.State = models.ActualLRPStateClaimed // claim doesn't set since expectedActualLRP.Since = fakeClock.Now().Add(-time.Hour).UnixNano() @@ -1055,10 +1066,11 @@ var _ = Describe("ActualLRPDB", func() { } expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) expectedActualLRP.AvailabilityZone = "" - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(beforeActualLRP).To(Equal(&expectedActualLRP)) @@ -1068,16 +1080,16 @@ var _ = Describe("ActualLRPDB", func() { Context("and the instance key is different", func() { It("transitions the state to RUNNING, updating the instance key", func() { otherInstanceKey := &models.ActualLRPInstanceKey{CellId: "some-other-cell", InstanceGuid: "some-other-instance-guid"} - _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, otherInstanceKey, netInfo, internalRoutes, metricTags, true, availabilityZone) + _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, otherInstanceKey, netInfo, internalRoutes, metricTags, true, availabilityZone) Expect(err).NotTo(HaveOccurred()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP - expectedActualLRP.ActualLRPInstanceKey = *otherInstanceKey + expectedActualLRP.ActualLrpInstanceKey = *otherInstanceKey expectedActualLRP.State = models.ActualLRPStateRunning - expectedActualLRP.ActualLRPNetInfo = *netInfo + expectedActualLRP.ActualLrpNetInfo = *netInfo expectedActualLRP.Since = fakeClock.Now().UnixNano() expectedActualLRP.ModificationTag = models.ModificationTag{ Epoch: "my-awesome-guid", @@ -1085,7 +1097,8 @@ var _ = Describe("ActualLRPDB", func() { } expectedActualLRP.ActualLrpInternalRoutes = internalRoutes expectedActualLRP.MetricTags = metricTags - expectedActualLRP.SetRoutable(true) + routable := true + expectedActualLRP.SetRoutable(&routable) expectedActualLRP.AvailabilityZone = availabilityZone Expect(actualLRPs).To(ConsistOf(&expectedActualLRP)) @@ -1094,27 +1107,27 @@ var _ = Describe("ActualLRPDB", func() { Context("and the actual lrp is RUNNING", func() { BeforeEach(func() { - _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) + _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) }) Context("and the instance key is the same", func() { Context("and the attributes are the same", func() { It("does nothing", func() { - beforeActualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + beforeActualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) - _, _, err = sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) + _, _, err = sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) - afterActualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + afterActualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(beforeActualLRPs).To(Equal(afterActualLRPs)) }) It("returns the same actual lrp group for before and after", func() { - beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) + beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) Expect(beforeActualLRP).To(Equal(afterActualLRP)) }) @@ -1128,24 +1141,24 @@ var _ = Describe("ActualLRPDB", func() { BeforeEach(func() { var err error - expectedActualLRPs, err = sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + expectedActualLRPs, err = sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) newNetInfo = &models.ActualLRPNetInfo{Address: "some-other-address"} }) It("updates the net info", func() { - beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, newNetInfo, internalRoutes, metricTags, false, availabilityZone) + beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, newNetInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) Expect(expectedActualLRPs).To(ConsistOf(beforeActualLRP)) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(afterActualLRP)) Expect(actualLRPs).NotTo(Equal(expectedActualLRPs)) - expectedActualLRPs[0].ActualLRPNetInfo = *newNetInfo + expectedActualLRPs[0].ActualLrpNetInfo = *newNetInfo expectedActualLRPs[0].ModificationTag.Increment() Expect(actualLRPs).To(Equal(expectedActualLRPs)) }) @@ -1159,18 +1172,18 @@ var _ = Describe("ActualLRPDB", func() { BeforeEach(func() { var err error - expectedActualLRPs, err = sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + expectedActualLRPs, err = sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) newInternalRoutes = []*models.ActualLRPInternalRoute{{Hostname: "some-new-internalroute"}} }) It("updates the internal routes", func() { - beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, newInternalRoutes, metricTags, false, availabilityZone) + beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, newInternalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) Expect(expectedActualLRPs).To(ConsistOf(beforeActualLRP)) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(afterActualLRP)) @@ -1190,7 +1203,7 @@ var _ = Describe("ActualLRPDB", func() { BeforeEach(func() { var err error - expectedActualLRPs, err = sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + expectedActualLRPs, err = sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) newMetricTags = map[string]string{ "app_name": "new-app-name", @@ -1198,12 +1211,12 @@ var _ = Describe("ActualLRPDB", func() { }) It("updates the metric tags", func() { - beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, newMetricTags, false, availabilityZone) + beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, newMetricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) Expect(expectedActualLRPs).To(ConsistOf(beforeActualLRP)) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(afterActualLRP)) @@ -1222,23 +1235,24 @@ var _ = Describe("ActualLRPDB", func() { BeforeEach(func() { var err error - expectedActualLRPs, err = sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + expectedActualLRPs, err = sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) }) It("updates the routable", func() { - beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, true, availabilityZone) + beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, true, availabilityZone) Expect(err).NotTo(HaveOccurred()) Expect(expectedActualLRPs).To(ConsistOf(beforeActualLRP)) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(afterActualLRP)) Expect(actualLRPs).NotTo(Equal(expectedActualLRPs)) - expectedActualLRPs[0].SetRoutable(true) + routable := true + expectedActualLRPs[0].SetRoutable(&routable) expectedActualLRPs[0].ModificationTag.Increment() Expect(actualLRPs).To(Equal(expectedActualLRPs)) }) @@ -1251,17 +1265,17 @@ var _ = Describe("ActualLRPDB", func() { BeforeEach(func() { var err error - expectedActualLRPs, err = sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + expectedActualLRPs, err = sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) }) It("updates the availability_zone", func() { - beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, false, "some-other-zone") + beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, false, "some-other-zone") Expect(err).NotTo(HaveOccurred()) Expect(expectedActualLRPs).To(ConsistOf(beforeActualLRP)) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(afterActualLRP)) @@ -1276,7 +1290,7 @@ var _ = Describe("ActualLRPDB", func() { Context("and the instance key is not the same", func() { It("returns an ErrActualLRPCannotBeStarted", func() { - _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &models.ActualLRPInstanceKey{CellId: "some-other-cell", InstanceGuid: "some-other-instance-guid"}, netInfo, internalRoutes, metricTags, false, availabilityZone) + _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &models.ActualLRPInstanceKey{CellId: "some-other-cell", InstanceGuid: "some-other-instance-guid"}, netInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).To(Equal(models.ErrActualLRPCannotBeStarted)) }) }) @@ -1292,19 +1306,19 @@ var _ = Describe("ActualLRPDB", func() { } _, err := db.ExecContext(ctx, queryStr, models.ActualLRPStateCrashed, - actualLRP.ProcessGuid, - actualLRP.Index, + actualLRP.ActualLrpKey.ProcessGuid, + actualLRP.ActualLrpKey.Index, ) Expect(err).NotTo(HaveOccurred()) }) It("transitions the state to RUNNING", func() { - beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) + beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred()) expectedBeforeActualLRP := *actualLRP - expectedBeforeActualLRP.ActualLRPInstanceKey = *instanceKey + expectedBeforeActualLRP.ActualLrpInstanceKey = *instanceKey expectedBeforeActualLRP.State = models.ActualLRPStateCrashed // we crash directly in the DB, so no since expectedBeforeActualLRP.Since = fakeClock.Now().Add(-time.Hour).UnixNano() @@ -1314,16 +1328,17 @@ var _ = Describe("ActualLRPDB", func() { } expectedBeforeActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedBeforeActualLRP.MetricTags = map[string]string{} - expectedBeforeActualLRP.SetRoutable(false) + routable := false + expectedBeforeActualLRP.SetRoutable(&routable) Expect(beforeActualLRP).To(Equal(&expectedBeforeActualLRP)) - fetchedActualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + fetchedActualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedAfterActualLRP := *actualLRP - expectedAfterActualLRP.ActualLRPInstanceKey = *instanceKey + expectedAfterActualLRP.ActualLrpInstanceKey = *instanceKey expectedAfterActualLRP.State = models.ActualLRPStateRunning - expectedAfterActualLRP.ActualLRPNetInfo = *netInfo + expectedAfterActualLRP.ActualLrpNetInfo = *netInfo expectedAfterActualLRP.Since = fakeClock.Now().UnixNano() expectedAfterActualLRP.ModificationTag = models.ModificationTag{ Epoch: "my-awesome-guid", @@ -1331,7 +1346,7 @@ var _ = Describe("ActualLRPDB", func() { } expectedAfterActualLRP.ActualLrpInternalRoutes = internalRoutes expectedAfterActualLRP.MetricTags = metricTags - expectedAfterActualLRP.SetRoutable(false) + expectedAfterActualLRP.SetRoutable(&routable) expectedAfterActualLRP.AvailabilityZone = availabilityZone Expect(fetchedActualLRPs).To(ContainElement(afterActualLRP)) @@ -1364,7 +1379,7 @@ var _ = Describe("ActualLRPDB", func() { internalRoutes = model_helpers.NewActualLRPInternalRoutes() metricTags = model_helpers.NewActualLRPMetricTags() actualLRP = &models.ActualLRP{ - ActualLRPKey: models.ActualLRPKey{ + ActualLrpKey: models.ActualLRPKey{ ProcessGuid: "the-guid", Index: 1, Domain: "the-domain", @@ -1377,21 +1392,22 @@ var _ = Describe("ActualLRPDB", func() { }) It("creates the actual lrp", func() { - beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) + beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) Expect(beforeActualLRP).To(Equal(&models.ActualLRP{})) - fetchedActualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + fetchedActualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP expectedActualLRP.State = models.ActualLRPStateRunning - expectedActualLRP.ActualLRPNetInfo = *netInfo + expectedActualLRP.ActualLrpNetInfo = *netInfo expectedActualLRP.ActualLrpInternalRoutes = internalRoutes expectedActualLRP.MetricTags = metricTags - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) expectedActualLRP.AvailabilityZone = availabilityZone - expectedActualLRP.ActualLRPInstanceKey = *instanceKey + expectedActualLRP.ActualLrpInstanceKey = *instanceKey expectedActualLRP.Since = fakeClock.Now().UnixNano() Expect(fetchedActualLRPs).To(ContainElement(afterActualLRP)) @@ -1400,7 +1416,7 @@ var _ = Describe("ActualLRPDB", func() { Context("when there is only an evacuating actual LRP", func() { BeforeEach(func() { - _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) queryStr := "UPDATE actual_lrps SET presence = ? WHERE process_guid = ? AND instance_index = ? AND presence = ?" if test_helpers.UsePostgres() { @@ -1408,29 +1424,30 @@ var _ = Describe("ActualLRPDB", func() { } _, err = db.ExecContext(ctx, queryStr, models.ActualLRP_Evacuating, - actualLRP.ActualLRPKey.ProcessGuid, - actualLRP.ActualLRPKey.Index, + actualLRP.ActualLrpKey.ProcessGuid, + actualLRP.ActualLrpKey.Index, models.ActualLRP_Ordinary, ) Expect(err).NotTo(HaveOccurred()) }) It("creates a new actual LRP", func() { - beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) + beforeActualLRP, afterActualLRP, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) Expect(beforeActualLRP).To(Equal(&models.ActualLRP{})) - fetchedActualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + fetchedActualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP expectedActualLRP.State = models.ActualLRPStateRunning - expectedActualLRP.ActualLRPNetInfo = *netInfo + expectedActualLRP.ActualLrpNetInfo = *netInfo expectedActualLRP.ActualLrpInternalRoutes = internalRoutes expectedActualLRP.MetricTags = metricTags - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) expectedActualLRP.AvailabilityZone = availabilityZone - expectedActualLRP.ActualLRPInstanceKey = *instanceKey + expectedActualLRP.ActualLrpInstanceKey = *instanceKey expectedActualLRP.Since = fakeClock.Now().UnixNano() Expect(fetchedActualLRPs).To(ContainElement(afterActualLRP)) @@ -1465,13 +1482,13 @@ var _ = Describe("ActualLRPDB", func() { metricTags = model_helpers.NewActualLRPMetricTags() actualLRP = &models.ActualLRP{ - ActualLRPKey: models.ActualLRPKey{ + ActualLrpKey: models.ActualLRPKey{ ProcessGuid: "the-guid", Index: 1, Domain: "the-domain", }, } - _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) actualLRP.ModificationTag.Epoch = "my-awesome-guid" fakeClock.Increment(time.Hour) @@ -1479,28 +1496,29 @@ var _ = Describe("ActualLRPDB", func() { Context("and it is RUNNING", func() { BeforeEach(func() { - _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) + _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) actualLRP.ModificationTag.Increment() }) It("returns the before and after actual lrps", func() { - beforeActualLRP, afterActualLRP, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, "because it didn't go well") + beforeActualLRP, afterActualLRP, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, "because it didn't go well") Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP expectedActualLRP.State = models.ActualLRPStateRunning - expectedActualLRP.ActualLRPInstanceKey = *instanceKey + expectedActualLRP.ActualLrpInstanceKey = *instanceKey expectedActualLRP.Since = fakeClock.Now().UnixNano() - expectedActualLRP.ActualLRPNetInfo = *netInfo + expectedActualLRP.ActualLrpNetInfo = *netInfo expectedActualLRP.ActualLrpInternalRoutes = internalRoutes expectedActualLRP.MetricTags = metricTags - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) expectedActualLRP.AvailabilityZone = availabilityZone Expect(beforeActualLRP).To(Equal(&expectedActualLRP)) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(afterActualLRP)) @@ -1509,10 +1527,10 @@ var _ = Describe("ActualLRPDB", func() { Context("and the crash reason is larger than 1K", func() { It("truncates the crash reason", func() { crashReason := strings.Repeat("x", 2*1024) - _, _, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, crashReason) + _, _, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, crashReason) Expect(err).NotTo(HaveOccurred()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP @@ -1523,7 +1541,8 @@ var _ = Describe("ActualLRPDB", func() { expectedActualLRP.Since = fakeClock.Now().UnixNano() expectedActualLRP.ActualLrpInternalRoutes = internalRoutes expectedActualLRP.MetricTags = metricTags - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) expectedActualLRP.AvailabilityZone = availabilityZone Expect(actualLRPs).To(ConsistOf(&expectedActualLRP)) @@ -1532,11 +1551,11 @@ var _ = Describe("ActualLRPDB", func() { Context("and it should be restarted", func() { It("updates the lrp and sets its state to UNCLAIMED", func() { - _, _, shouldRestart, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, "because it didn't go well") + _, _, shouldRestart, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, "because it didn't go well") Expect(err).NotTo(HaveOccurred()) Expect(shouldRestart).To(BeTrue()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP @@ -1547,7 +1566,8 @@ var _ = Describe("ActualLRPDB", func() { expectedActualLRP.Since = fakeClock.Now().UnixNano() expectedActualLRP.ActualLrpInternalRoutes = internalRoutes expectedActualLRP.MetricTags = metricTags - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) expectedActualLRP.AvailabilityZone = availabilityZone Expect(actualLRPs).To(ConsistOf(&expectedActualLRP)) @@ -1564,18 +1584,18 @@ var _ = Describe("ActualLRPDB", func() { } _, err := db.ExecContext(ctx, queryStr, models.DefaultImmediateRestarts+1, - actualLRP.ProcessGuid, - actualLRP.Index, + actualLRP.ActualLrpKey.ProcessGuid, + actualLRP.ActualLrpKey.Index, ) Expect(err).NotTo(HaveOccurred()) }) It("updates the lrp and sets its state to CRASHED", func() { - _, _, shouldRestart, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, "because it didn't go well") + _, _, shouldRestart, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, "because it didn't go well") Expect(err).NotTo(HaveOccurred()) Expect(shouldRestart).To(BeFalse()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP @@ -1586,7 +1606,8 @@ var _ = Describe("ActualLRPDB", func() { expectedActualLRP.Since = fakeClock.Now().UnixNano() expectedActualLRP.ActualLrpInternalRoutes = internalRoutes expectedActualLRP.MetricTags = metricTags - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) expectedActualLRP.AvailabilityZone = availabilityZone Expect(actualLRPs).To(ConsistOf(&expectedActualLRP)) @@ -1602,18 +1623,18 @@ var _ = Describe("ActualLRPDB", func() { } _, err := db.ExecContext(ctx, queryStr, fakeClock.Now().Add(-(models.CrashResetTimeout + 1*time.Second)).UnixNano(), - actualLRP.ProcessGuid, - actualLRP.Index, + actualLRP.ActualLrpKey.ProcessGuid, + actualLRP.ActualLrpKey.Index, ) Expect(err).NotTo(HaveOccurred()) }) It("resets the crash count to 1", func() { - _, _, shouldRestart, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, "because it didn't go well") + _, _, shouldRestart, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, "because it didn't go well") Expect(err).NotTo(HaveOccurred()) Expect(shouldRestart).To(BeTrue()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(HaveLen(1)) @@ -1625,27 +1646,28 @@ var _ = Describe("ActualLRPDB", func() { Context("and it's CLAIMED", func() { BeforeEach(func() { - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, actualLRP.ProcessGuid, actualLRP.Index, instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, instanceKey) Expect(err).NotTo(HaveOccurred()) fakeClock.Increment(time.Hour) actualLRP.ModificationTag.Increment() }) It("returns the previous and current actual lrp", func() { - beforeActualLRP, afterActualLRP, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, "because it didn't go well") + beforeActualLRP, afterActualLRP, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, "because it didn't go well") Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP expectedActualLRP.State = models.ActualLRPStateClaimed - expectedActualLRP.ActualLRPInstanceKey = *instanceKey + expectedActualLRP.ActualLrpInstanceKey = *instanceKey expectedActualLRP.Since = fakeClock.Now().Add(-time.Hour).UnixNano() expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) Expect(beforeActualLRP).To(Equal(&expectedActualLRP)) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(actualLRPs).To(ConsistOf(afterActualLRP)) }) @@ -1660,18 +1682,18 @@ var _ = Describe("ActualLRPDB", func() { } _, err := db.ExecContext(ctx, queryStr, models.DefaultImmediateRestarts-2, - actualLRP.ProcessGuid, - actualLRP.Index, + actualLRP.ActualLrpKey.ProcessGuid, + actualLRP.ActualLrpKey.Index, ) Expect(err).NotTo(HaveOccurred()) }) It("updates the lrp and sets its state to UNCLAIMED", func() { - _, _, shouldRestart, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, "because it didn't go well") + _, _, shouldRestart, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, "because it didn't go well") Expect(err).NotTo(HaveOccurred()) Expect(shouldRestart).To(BeTrue()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP @@ -1682,7 +1704,8 @@ var _ = Describe("ActualLRPDB", func() { expectedActualLRP.Since = fakeClock.Now().UnixNano() expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) Expect(actualLRPs).To(ConsistOf(&expectedActualLRP)) }) @@ -1698,18 +1721,18 @@ var _ = Describe("ActualLRPDB", func() { } _, err := db.ExecContext(ctx, queryStr, models.DefaultImmediateRestarts+2, - actualLRP.ProcessGuid, - actualLRP.Index, + actualLRP.ActualLrpKey.ProcessGuid, + actualLRP.ActualLrpKey.Index, ) Expect(err).NotTo(HaveOccurred()) }) It("updates the lrp and sets its state to CRASHED", func() { - _, _, shouldRestart, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, "some other failure reason") + _, _, shouldRestart, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, "some other failure reason") Expect(err).NotTo(HaveOccurred()) Expect(shouldRestart).To(BeFalse()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP @@ -1720,7 +1743,8 @@ var _ = Describe("ActualLRPDB", func() { expectedActualLRP.Since = fakeClock.Now().UnixNano() expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) Expect(actualLRPs).To(ConsistOf(&expectedActualLRP)) }) @@ -1729,17 +1753,17 @@ var _ = Describe("ActualLRPDB", func() { Context("and it's already CRASHED", func() { BeforeEach(func() { - _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) + _, _, err := sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) actualLRP.ModificationTag.Increment() - _, _, _, err = sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, "because it didn't go well") + _, _, _, err = sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, "because it didn't go well") Expect(err).NotTo(HaveOccurred()) actualLRP.ModificationTag.Increment() }) It("returns a cannot crash error", func() { - _, _, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, "because it didn't go well") + _, _, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, "because it didn't go well") Expect(err).To(HaveOccurred()) Expect(err).To(Equal(models.ErrActualLRPCannotBeCrashed)) }) @@ -1747,7 +1771,7 @@ var _ = Describe("ActualLRPDB", func() { Context("and it's UNCLAIMED", func() { It("returns a cannot crash error", func() { - _, _, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, "because it didn't go well") + _, _, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, "because it didn't go well") Expect(err).To(HaveOccurred()) Expect(err).To(Equal(models.ErrActualLRPCannotBeCrashed)) }) @@ -1763,14 +1787,14 @@ var _ = Describe("ActualLRPDB", func() { _, err := db.ExecContext(ctx, queryStr, models.DefaultImmediateRestarts+2, models.ActualLRP_Evacuating, - actualLRP.ProcessGuid, - actualLRP.Index, + actualLRP.ActualLrpKey.ProcessGuid, + actualLRP.ActualLrpKey.Index, ) Expect(err).NotTo(HaveOccurred()) }) It("returns a cannot crash error", func() { - _, _, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, "because it didn't go well") + _, _, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, "because it didn't go well") Expect(err).To(HaveOccurred()) Expect(err).To(Equal(models.ErrResourceNotFound)) }) @@ -1793,18 +1817,18 @@ var _ = Describe("ActualLRPDB", func() { CellId: "evac-cell-id", } evacuatingLRP := &models.ActualLRP{ - ActualLRPKey: models.ActualLRPKey{ + ActualLrpKey: models.ActualLRPKey{ ProcessGuid: "the-unclaimed-guid", Index: 1, Domain: "the-domain", }, Presence: models.ActualLRP_Evacuating, - ActualLRPInstanceKey: *instanceKey, + ActualLrpInstanceKey: *instanceKey, } - _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &evacuatingLRP.ActualLRPKey) + _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &evacuatingLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) - _, _, err = sqlDB.StartActualLRP(ctx, logger, &evacuatingLRP.ActualLRPKey, evacuatingInstanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) + _, _, err = sqlDB.StartActualLRP(ctx, logger, &evacuatingLRP.ActualLrpKey, evacuatingInstanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) queryStr := ` UPDATE actual_lrps SET presence = ? @@ -1816,30 +1840,30 @@ var _ = Describe("ActualLRPDB", func() { _, err = db.ExecContext(ctx, queryStr, models.ActualLRP_Evacuating, - evacuatingLRP.ProcessGuid, - evacuatingLRP.Index, + evacuatingLRP.ActualLrpKey.ProcessGuid, + evacuatingLRP.ActualLrpKey.Index, ) Expect(err).NotTo(HaveOccurred()) actualLRP = &models.ActualLRP{ - ActualLRPKey: models.ActualLRPKey{ + ActualLrpKey: models.ActualLRPKey{ ProcessGuid: "the-unclaimed-guid", Index: 1, Domain: "the-domain", }, Presence: models.ActualLRP_Ordinary, - ActualLRPInstanceKey: *instanceKey, + ActualLrpInstanceKey: *instanceKey, } - _, err = sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + _, err = sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) - _, _, err = sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) + _, _, err = sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, netInfo, internalRoutes, metricTags, false, availabilityZone) Expect(err).NotTo(HaveOccurred()) }) It("only update the non evacuating one", func() { - _, crashedActualLRP, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLRPKey, instanceKey, "because it didn't go well") + _, crashedActualLRP, _, err := sqlDB.CrashActualLRP(ctx, logger, &actualLRP.ActualLrpKey, instanceKey, "because it didn't go well") Expect(err).ToNot(HaveOccurred()) Expect(crashedActualLRP.CrashCount).To(Equal(actualLRP.CrashCount + 1)) }) @@ -1878,19 +1902,19 @@ var _ = Describe("ActualLRPDB", func() { BeforeEach(func() { actualLRP = &models.ActualLRP{ - ActualLRPKey: *actualLRPKey, + ActualLrpKey: *actualLRPKey, } - _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) fakeClock.Increment(time.Hour) }) Context("and the state is UNCLAIMED", func() { It("fails the LRP", func() { - _, _, err := sqlDB.FailActualLRP(ctx, logger, &actualLRP.ActualLRPKey, "failing the LRP") + _, _, err := sqlDB.FailActualLRP(ctx, logger, &actualLRP.ActualLrpKey, "failing the LRP") Expect(err).NotTo(HaveOccurred()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP @@ -1903,7 +1927,8 @@ var _ = Describe("ActualLRPDB", func() { } expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) Expect(actualLRPs).To(ConsistOf(&expectedActualLRP)) }) @@ -1911,10 +1936,10 @@ var _ = Describe("ActualLRPDB", func() { Context("and the placement error is longer than 1K", func() { It("truncates the placement_error", func() { value := strings.Repeat("x", 2*1024) - _, _, err := sqlDB.FailActualLRP(ctx, logger, &actualLRP.ActualLRPKey, value) + _, _, err := sqlDB.FailActualLRP(ctx, logger, &actualLRP.ActualLrpKey, value) Expect(err).NotTo(HaveOccurred()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP @@ -1927,17 +1952,18 @@ var _ = Describe("ActualLRPDB", func() { } expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) Expect(actualLRPs).To(ConsistOf(&expectedActualLRP)) }) }) It("returns the previous and current actual lrp", func() { - beforeActualLRP, afterActualLRP, err := sqlDB.FailActualLRP(ctx, logger, &actualLRP.ActualLRPKey, "failing the LRP") + beforeActualLRP, afterActualLRP, err := sqlDB.FailActualLRP(ctx, logger, &actualLRP.ActualLrpKey, "failing the LRP") Expect(err).NotTo(HaveOccurred()) - actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) expectedActualLRP := *actualLRP @@ -1949,7 +1975,8 @@ var _ = Describe("ActualLRPDB", func() { } expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) Expect(beforeActualLRP).To(Equal(&expectedActualLRP)) Expect(actualLRPs).To(ConsistOf(afterActualLRP)) @@ -1962,13 +1989,13 @@ var _ = Describe("ActualLRPDB", func() { InstanceGuid: "the-instance-guid", CellId: "the-cell-id", } - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, actualLRP.ProcessGuid, actualLRP.Index, instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, instanceKey) Expect(err).NotTo(HaveOccurred()) fakeClock.Increment(time.Hour) }) It("returns a cannot be failed error", func() { - _, _, err := sqlDB.FailActualLRP(ctx, logger, &actualLRP.ActualLRPKey, "failing the LRP") + _, _, err := sqlDB.FailActualLRP(ctx, logger, &actualLRP.ActualLrpKey, "failing the LRP") Expect(err).To(HaveOccurred()) Expect(err).To(Equal(models.ErrActualLRPCannotBeFailed)) }) @@ -2001,9 +2028,9 @@ var _ = Describe("ActualLRPDB", func() { BeforeEach(func() { actualLRP = &models.ActualLRP{ - ActualLRPKey: *actualLRPKey, + ActualLrpKey: *actualLRPKey, } - _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) _, err = sqlDB.CreateUnclaimedActualLRP(ctx, logger, otherActualLRPKey) @@ -2012,16 +2039,16 @@ var _ = Describe("ActualLRPDB", func() { }) It("removes the actual lrp", func() { - err := sqlDB.RemoveActualLRP(ctx, logger, actualLRP.ProcessGuid, actualLRP.Index, nil) + err := sqlDB.RemoveActualLRP(ctx, logger, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, nil) Expect(err).NotTo(HaveOccurred()) - lrps, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + lrps, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(lrps).To(BeEmpty()) }) It("keeps the other lrps around", func() { - err := sqlDB.RemoveActualLRP(ctx, logger, actualLRP.ProcessGuid, actualLRP.Index, nil) + err := sqlDB.RemoveActualLRP(ctx, logger, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, nil) Expect(err).NotTo(HaveOccurred()) _, err = sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: otherActualLRPKey.ProcessGuid, Index: &otherActualLRPKey.Index}) @@ -2034,16 +2061,16 @@ var _ = Describe("ActualLRPDB", func() { BeforeEach(func() { instanceKey = models.NewActualLRPInstanceKey("instance-guid", "cell-id") - _, _, err := sqlDB.ClaimActualLRP(ctx, logger, actualLRP.ProcessGuid, actualLRP.Index, &instanceKey) + _, _, err := sqlDB.ClaimActualLRP(ctx, logger, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, &instanceKey) Expect(err).NotTo(HaveOccurred()) }) Context("and it matches the existing actual lrp", func() { It("removes the actual lrp", func() { - err := sqlDB.RemoveActualLRP(ctx, logger, actualLRP.ProcessGuid, actualLRP.Index, &instanceKey) + err := sqlDB.RemoveActualLRP(ctx, logger, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, &instanceKey) Expect(err).NotTo(HaveOccurred()) - lrps, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ProcessGuid, Index: &actualLRP.Index}) + lrps, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: actualLRP.ActualLrpKey.ProcessGuid, Index: &actualLRP.ActualLrpKey.Index}) Expect(err).NotTo(HaveOccurred()) Expect(lrps).To(BeEmpty()) }) @@ -2052,7 +2079,7 @@ var _ = Describe("ActualLRPDB", func() { Context("and it does not match the existing actual lrp", func() { It("returns an error", func() { instanceKey.CellId = "not the right cell id" - err := sqlDB.RemoveActualLRP(ctx, logger, actualLRP.ProcessGuid, actualLRP.Index, &instanceKey) + err := sqlDB.RemoveActualLRP(ctx, logger, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, &instanceKey) Expect(err).To(HaveOccurred()) }) }) @@ -2087,12 +2114,12 @@ var _ = Describe("ActualLRPDB", func() { BeforeEach(func() { actualLRP = &models.ActualLRP{ - ActualLRPKey: *actualLRPKey, + ActualLrpKey: *actualLRPKey, } - _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) - _, _, err = sqlDB.ClaimActualLRP(ctx, logger, guid, index, &actualLRP.ActualLRPInstanceKey) + _, _, err = sqlDB.ClaimActualLRP(ctx, logger, guid, index, &actualLRP.ActualLrpInstanceKey) Expect(err).NotTo(HaveOccurred()) }) @@ -2113,7 +2140,7 @@ var _ = Describe("ActualLRPDB", func() { actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: guid, Index: &index}) Expect(err).ToNot(HaveOccurred()) Expect(actualLRPs).To(HaveLen(1)) - Expect(actualLRPs[0].ActualLRPNetInfo).To(Equal(models.ActualLRPNetInfo{})) + Expect(actualLRPs[0].ActualLrpNetInfo).To(Equal(models.ActualLRPNetInfo{})) }) It("it increments the modification tag on the actualLRP", func() { @@ -2128,7 +2155,7 @@ var _ = Describe("ActualLRPDB", func() { actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: guid, Index: &index}) Expect(err).ToNot(HaveOccurred()) Expect(actualLRPs).To(HaveLen(1)) - Expect(actualLRPs[0].ActualLRPInstanceKey).To(Equal(models.ActualLRPInstanceKey{})) + Expect(actualLRPs[0].ActualLrpInstanceKey).To(Equal(models.ActualLRPInstanceKey{})) }) It("it updates the actualLRP's update at timestamp", func() { @@ -2148,7 +2175,8 @@ var _ = Describe("ActualLRPDB", func() { } expectedActualLRP.ActualLrpInternalRoutes = []*models.ActualLRPInternalRoute{} expectedActualLRP.MetricTags = map[string]string{} - expectedActualLRP.SetRoutable(false) + routable := false + expectedActualLRP.SetRoutable(&routable) Expect(beforeActualLRP).To(BeEquivalentTo(&expectedActualLRP)) @@ -2161,10 +2189,10 @@ var _ = Describe("ActualLRPDB", func() { Context("When the actual LRP is unclaimed", func() { BeforeEach(func() { actualLRP = &models.ActualLRP{ - ActualLRPKey: *actualLRPKey, + ActualLrpKey: *actualLRPKey, } - _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) }) diff --git a/db/sqldb/desired_lrp_db.go b/db/sqldb/desired_lrp_db.go index 5907d2fd..a2bd1104 100644 --- a/db/sqldb/desired_lrp_db.go +++ b/db/sqldb/desired_lrp_db.go @@ -31,7 +31,8 @@ func (db *SQLDB) DesireLRP(ctx context.Context, logger lager.Logger, desiredLRP runInfo := desiredLRP.DesiredLRPRunInfo(db.clock.Now()) - runInfoData, err := db.serializeModel(logger, &runInfo) + protoRunInfo := runInfo.ToProto() + runInfoData, err := db.serializeModel(logger, protoRunInfo) if err != nil { logger.Error("failed-to-serialize-model", err) return err @@ -43,7 +44,8 @@ func (db *SQLDB) DesireLRP(ctx context.Context, logger lager.Logger, desiredLRP volumePlacement.DriverNames = append(volumePlacement.DriverNames, mount.Driver) } - volumePlacementData, err := db.serializeModel(logger, volumePlacement) + protoVolumePlacement := volumePlacement.ToProto() + volumePlacementData, err := db.serializeModel(logger, protoVolumePlacement) if err != nil { logger.Error("failed-to-serialize-model", err) return err @@ -393,15 +395,15 @@ func (db *SQLDB) fetchDesiredLRPSchedulingInfoAndMore(logger lager.Logger, scann schedulingInfo := &models.DesiredLRPSchedulingInfo{} var routeData, volumePlacementData, placementTagData []byte values := []interface{}{ - &schedulingInfo.ProcessGuid, - &schedulingInfo.Domain, - &schedulingInfo.LogGuid, + &schedulingInfo.DesiredLrpKey.ProcessGuid, + &schedulingInfo.DesiredLrpKey.Domain, + &schedulingInfo.DesiredLrpKey.LogGuid, &schedulingInfo.Annotation, &schedulingInfo.Instances, - &schedulingInfo.MemoryMb, - &schedulingInfo.DiskMb, - &schedulingInfo.MaxPids, - &schedulingInfo.RootFs, + &schedulingInfo.DesiredLrpResource.MemoryMb, + &schedulingInfo.DesiredLrpResource.DiskMb, + &schedulingInfo.DesiredLrpResource.MaxPids, + &schedulingInfo.DesiredLrpResource.RootFs, &routeData, &volumePlacementData, &schedulingInfo.ModificationTag.Epoch, @@ -431,14 +433,16 @@ func (db *SQLDB) fetchDesiredLRPSchedulingInfoAndMore(logger lager.Logger, scann logger.Error("failed-parsing-routes", err) return nil, err } - schedulingInfo.Routes = routes + schedulingInfo.Routes = &routes var volumePlacement models.VolumePlacement - err = db.deserializeModel(logger, volumePlacementData, &volumePlacement) + var protoVolumePlacement models.ProtoVolumePlacement + err = db.deserializeModel(logger, volumePlacementData, &protoVolumePlacement) if err != nil { logger.Error("failed-parsing-volume-placement", err) return nil, err } + volumePlacement = *protoVolumePlacement.FromProto() schedulingInfo.VolumePlacement = &volumePlacement if placementTagData != nil { err = json.Unmarshal(placementTagData, &schedulingInfo.PlacementTags) @@ -567,10 +571,12 @@ func (db *SQLDB) fetchDesiredLRPInternal(logger lager.Logger, scanner helpers.Ro } var runInfo models.DesiredLRPRunInfo - err = db.deserializeModel(logger, runInfoData, &runInfo) + var protoRunInfo models.ProtoDesiredLRPRunInfo + err = db.deserializeModel(logger, runInfoData, &protoRunInfo) if err != nil { - return nil, schedulingInfo.ProcessGuid, models.ErrDeserialize + return nil, schedulingInfo.DesiredLrpKey.ProcessGuid, models.ErrDeserialize } + runInfo = *protoRunInfo.FromProto() // dedup the ports runInfo.Ports = dedupSlice(runInfo.Ports) diff --git a/db/sqldb/desired_lrp_db_test.go b/db/sqldb/desired_lrp_db_test.go index 951d5e5f..14f677bc 100644 --- a/db/sqldb/desired_lrp_db_test.go +++ b/db/sqldb/desired_lrp_db_test.go @@ -340,7 +340,7 @@ var _ = Describe("DesiredLRPDB", func() { }) It("returns the desired lrp scheduling info", func() { - schedInfo, err := sqlDB.DesiredLRPSchedulingInfoByProcessGuid(ctx, logger, expectedDesiredLRPSchedulingInfo.ProcessGuid) + schedInfo, err := sqlDB.DesiredLRPSchedulingInfoByProcessGuid(ctx, logger, expectedDesiredLRPSchedulingInfo.DesiredLrpKey.ProcessGuid) Expect(err).NotTo(HaveOccurred()) Expect(*schedInfo).To(BeEquivalentTo(expectedDesiredLRPSchedulingInfo)) @@ -366,7 +366,7 @@ var _ = Describe("DesiredLRPDB", func() { queryStr = test_helpers.ReplaceQuestionMarks(queryStr) } - result, err := db.ExecContext(ctx, queryStr, "{{", expectedDesiredLRPSchedulingInfo.ProcessGuid) + result, err := db.ExecContext(ctx, queryStr, "{{", expectedDesiredLRPSchedulingInfo.DesiredLrpKey.ProcessGuid) Expect(err).NotTo(HaveOccurred()) rowsAffected, err := result.RowsAffected() Expect(err).NotTo(HaveOccurred()) @@ -374,7 +374,7 @@ var _ = Describe("DesiredLRPDB", func() { }) It("returns an invalid record error", func() { - schedInfo, err := sqlDB.DesiredLRPSchedulingInfoByProcessGuid(ctx, logger, expectedDesiredLRPSchedulingInfo.ProcessGuid) + schedInfo, err := sqlDB.DesiredLRPSchedulingInfoByProcessGuid(ctx, logger, expectedDesiredLRPSchedulingInfo.DesiredLrpKey.ProcessGuid) Expect(err).To(HaveOccurred()) Expect(schedInfo).To(BeNil()) }) @@ -455,7 +455,8 @@ var _ = Describe("DesiredLRPDB", func() { JustBeforeEach(func() { Expect(sqlDB.DesireLRP(ctx, logger, expectedDesiredLRP)).To(Succeed()) update = &models.DesiredLRPUpdate{} - update.SetInstances(1) + instances := int32(1) + update.SetInstances(&instances) }) It("updates the lrp", func() { @@ -464,8 +465,10 @@ var _ = Describe("DesiredLRPDB", func() { "blah": (*json.RawMessage)(&routeContent), } update = &models.DesiredLRPUpdate{Routes: &routes} - update.SetInstances(123) - update.SetAnnotation("annotated") + instances := int32(123) + update.SetInstances(&instances) + annotation := "annotated" + update.SetAnnotation(&annotation) _, err := sqlDB.UpdateDesiredLRP(ctx, logger, expectedDesiredLRP.ProcessGuid, update) Expect(err).NotTo(HaveOccurred()) @@ -482,7 +485,8 @@ var _ = Describe("DesiredLRPDB", func() { It("returns the desired lrp from before the update", func() { update = &models.DesiredLRPUpdate{} - update.SetInstances(20) + instances := int32(20) + update.SetInstances(&instances) beforeDesiredLRP, err := sqlDB.UpdateDesiredLRP(ctx, logger, expectedDesiredLRP.ProcessGuid, update) Expect(err).NotTo(HaveOccurred()) @@ -491,7 +495,8 @@ var _ = Describe("DesiredLRPDB", func() { It("updates only the fields in the update parameter", func() { update = &models.DesiredLRPUpdate{} - update.SetInstances(20) + instances := int32(20) + update.SetInstances(&instances) _, err := sqlDB.UpdateDesiredLRP(ctx, logger, expectedDesiredLRP.ProcessGuid, update) Expect(err).NotTo(HaveOccurred()) diff --git a/db/sqldb/evacuation_db.go b/db/sqldb/evacuation_db.go index fb4832ae..ea18fa99 100644 --- a/db/sqldb/evacuation_db.go +++ b/db/sqldb/evacuation_db.go @@ -43,25 +43,26 @@ func (db *SQLDB) EvacuateActualLRP( return err } - if actualLRP.ActualLRPKey.Equal(lrpKey) && - actualLRP.ActualLRPInstanceKey.Equal(instanceKey) && - reflect.DeepEqual(actualLRP.ActualLRPNetInfo, *netInfo) { + if actualLRP.ActualLrpKey.Equal(lrpKey) && + actualLRP.ActualLrpInstanceKey.Equal(instanceKey) && + reflect.DeepEqual(actualLRP.ActualLrpNetInfo, *netInfo) { logger.Debug("evacuating-lrp-already-exists") return models.ErrResourceExists } now := db.clock.Now().UnixNano() actualLRP.ModificationTag.Increment() - actualLRP.ActualLRPKey = *lrpKey - actualLRP.ActualLRPInstanceKey = *instanceKey + actualLRP.ActualLrpKey = *lrpKey + actualLRP.ActualLrpInstanceKey = *instanceKey actualLRP.Since = now - actualLRP.ActualLRPNetInfo = *netInfo + actualLRP.ActualLrpNetInfo = *netInfo actualLRP.ActualLrpInternalRoutes = internalRoutes actualLRP.MetricTags = metricTags actualLRP.AvailabilityZone = availabilityZone actualLRP.Presence = models.ActualLRP_Evacuating - netInfoData, err := db.serializeModel(logger, netInfo) + protoNetInfo := netInfo.ToProto() + netInfoData, err := db.serializeModel(logger, protoNetInfo) if err != nil { logger.Error("failed-serializing-net-info", err) return err @@ -81,9 +82,9 @@ func (db *SQLDB) EvacuateActualLRP( _, err = db.update(ctx, logger, tx, "actual_lrps", helpers.SQLAttributes{ - "domain": actualLRP.Domain, - "instance_guid": actualLRP.InstanceGuid, - "cell_id": actualLRP.CellId, + "domain": actualLRP.ActualLrpKey.Domain, + "instance_guid": actualLRP.ActualLrpInstanceKey.InstanceGuid, + "cell_id": actualLRP.ActualLrpInstanceKey.CellId, "net_info": netInfoData, "internal_routes": internalRoutesData, "metric_tags": metricTagsData, @@ -92,7 +93,7 @@ func (db *SQLDB) EvacuateActualLRP( "modification_tag_index": actualLRP.ModificationTag.Index, }, "process_guid = ? AND instance_index = ? AND presence = ?", - actualLRP.ProcessGuid, actualLRP.Index, models.ActualLRP_Evacuating, + actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, models.ActualLRP_Evacuating, ) if err != nil { logger.Error("failed-update-evacuating-lrp", err) @@ -125,8 +126,8 @@ func (db *SQLDB) RemoveEvacuatingActualLRP(ctx context.Context, logger lager.Log return err } - if !lrp.ActualLRPInstanceKey.Equal(instanceKey) { - logger.Debug("actual-lrp-instance-key-mismatch", lager.Data{"instance_key_param": instanceKey, "instance_key_from_db": lrp.ActualLRPInstanceKey}) + if !lrp.ActualLrpInstanceKey.Equal(instanceKey) { + logger.Debug("actual-lrp-instance-key-mismatch", lager.Data{"instance_key_param": instanceKey, "instance_key_from_db": lrp.ActualLrpInstanceKey}) return models.ErrActualLRPCannotBeRemoved } @@ -155,7 +156,8 @@ func (db *SQLDB) createEvacuatingActualLRP( availabilityZone string, tx helpers.Tx, ) (*models.ActualLRP, error) { - netInfoData, err := db.serializeModel(logger, netInfo) + protoNetInfo := netInfo.ToProto() + netInfoData, err := db.serializeModel(logger, protoNetInfo) if err != nil { logger.Error("failed-serializing-net-info", err) return nil, err @@ -180,9 +182,9 @@ func (db *SQLDB) createEvacuatingActualLRP( } actualLRP := &models.ActualLRP{ - ActualLRPKey: *lrpKey, - ActualLRPInstanceKey: *instanceKey, - ActualLRPNetInfo: *netInfo, + ActualLrpKey: *lrpKey, + ActualLrpInstanceKey: *instanceKey, + ActualLrpNetInfo: *netInfo, ActualLrpInternalRoutes: internalRoutes, MetricTags: metricTags, AvailabilityZone: availabilityZone, @@ -191,15 +193,15 @@ func (db *SQLDB) createEvacuatingActualLRP( ModificationTag: models.ModificationTag{Epoch: guid, Index: 0}, Presence: models.ActualLRP_Evacuating, } - actualLRP.SetRoutable(routable) + actualLRP.SetRoutable(&routable) sqlAttributes := helpers.SQLAttributes{ - "process_guid": actualLRP.ProcessGuid, - "instance_index": actualLRP.Index, + "process_guid": actualLRP.ActualLrpKey.ProcessGuid, + "instance_index": actualLRP.ActualLrpKey.Index, "presence": models.ActualLRP_Evacuating, - "domain": actualLRP.Domain, - "instance_guid": actualLRP.InstanceGuid, - "cell_id": actualLRP.CellId, + "domain": actualLRP.ActualLrpKey.Domain, + "instance_guid": actualLRP.ActualLrpInstanceKey.InstanceGuid, + "cell_id": actualLRP.ActualLrpInstanceKey.CellId, "state": actualLRP.State, "net_info": netInfoData, "internal_routes": internalRoutesData, @@ -214,7 +216,7 @@ func (db *SQLDB) createEvacuatingActualLRP( _, err = db.upsert(ctx, logger, tx, "actual_lrps", sqlAttributes, "process_guid = ? AND instance_index = ? AND presence = ?", - actualLRP.ProcessGuid, actualLRP.Index, models.ActualLRP_Evacuating, + actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, models.ActualLRP_Evacuating, ) if err != nil { logger.Error("failed-inserting-evacuating-lrp", err) diff --git a/db/sqldb/evacuation_db_test.go b/db/sqldb/evacuation_db_test.go index 8d614dd5..c14fea2a 100644 --- a/db/sqldb/evacuation_db_test.go +++ b/db/sqldb/evacuation_db_test.go @@ -26,13 +26,14 @@ var _ = Describe("Evacuation", func() { actualLRP.ModificationTag = models.ModificationTag{} actualLRP.ModificationTag.Increment() actualLRP.ModificationTag.Increment() - actualLRP.SetRoutable(true) + routable := true + actualLRP.SetRoutable(&routable) - _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) - _, _, err = sqlDB.ClaimActualLRP(ctx, logger, guid, index, &actualLRP.ActualLRPInstanceKey) + _, _, err = sqlDB.ClaimActualLRP(ctx, logger, guid, index, &actualLRP.ActualLrpInstanceKey) Expect(err).NotTo(HaveOccurred()) - _, _, err = sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, model_helpers.NewActualLRPInternalRoutes(), model_helpers.NewActualLRPMetricTags(), actualLRP.GetRoutable(), actualLRP.AvailabilityZone) + _, _, err = sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, model_helpers.NewActualLRPInternalRoutes(), model_helpers.NewActualLRPMetricTags(), *actualLRP.GetRoutable(), actualLRP.AvailabilityZone) Expect(err).NotTo(HaveOccurred()) }) @@ -45,8 +46,8 @@ var _ = Describe("Evacuation", func() { } _, err := db.ExecContext(ctx, queryStr, models.ActualLRP_Evacuating, - actualLRP.ProcessGuid, - actualLRP.Index, + actualLRP.ActualLrpKey.ProcessGuid, + actualLRP.ActualLrpKey.Index, models.ActualLRP_Ordinary, ) Expect(err).NotTo(HaveOccurred()) @@ -63,11 +64,11 @@ var _ = Describe("Evacuation", func() { Context("when the lrp key changes", func() { BeforeEach(func() { - actualLRP.Domain = "some-other-domain" + actualLRP.ActualLrpKey.Domain = "some-other-domain" }) It("persists the evacuating lrp in sqldb", func() { - evacuating, err := sqlDB.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, model_helpers.NewActualLRPInternalRoutes(), model_helpers.NewActualLRPMetricTags(), true, actualLRP.AvailabilityZone) + evacuating, err := sqlDB.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, model_helpers.NewActualLRPInternalRoutes(), model_helpers.NewActualLRPMetricTags(), true, actualLRP.AvailabilityZone) Expect(err).NotTo(HaveOccurred()) actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: guid, Index: &index}) @@ -79,11 +80,11 @@ var _ = Describe("Evacuation", func() { Context("when the instance key changes", func() { BeforeEach(func() { - actualLRP.ActualLRPInstanceKey.InstanceGuid = "i am different here me roar" + actualLRP.ActualLrpInstanceKey.InstanceGuid = "i am different here me roar" }) It("persists the evacuating lrp", func() { - evacuating, err := sqlDB.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, model_helpers.NewActualLRPInternalRoutes(), model_helpers.NewActualLRPMetricTags(), true, actualLRP.AvailabilityZone) + evacuating, err := sqlDB.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, model_helpers.NewActualLRPInternalRoutes(), model_helpers.NewActualLRPMetricTags(), true, actualLRP.AvailabilityZone) Expect(err).NotTo(HaveOccurred()) actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: guid, Index: &index}) @@ -95,13 +96,13 @@ var _ = Describe("Evacuation", func() { Context("when the netinfo changes", func() { BeforeEach(func() { - actualLRP.ActualLRPNetInfo.Ports = []*models.PortMapping{ + actualLRP.ActualLrpNetInfo.Ports = []*models.PortMapping{ models.NewPortMapping(6666, 7777), } }) It("persists the evacuating lrp", func() { - evacuating, err := sqlDB.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, model_helpers.NewActualLRPInternalRoutes(), model_helpers.NewActualLRPMetricTags(), true, actualLRP.AvailabilityZone) + evacuating, err := sqlDB.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, model_helpers.NewActualLRPInternalRoutes(), model_helpers.NewActualLRPMetricTags(), true, actualLRP.AvailabilityZone) Expect(err).NotTo(HaveOccurred()) actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: guid, Index: &index}) @@ -114,7 +115,7 @@ var _ = Describe("Evacuation", func() { Context("when the evacuating actual lrp already exists", func() { It("returns an ErrResourceExists", func() { - _, err := sqlDB.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, model_helpers.NewActualLRPInternalRoutes(), model_helpers.NewActualLRPMetricTags(), true, actualLRP.AvailabilityZone) + _, err := sqlDB.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, model_helpers.NewActualLRPInternalRoutes(), model_helpers.NewActualLRPMetricTags(), true, actualLRP.AvailabilityZone) Expect(err).To(Equal(models.ErrResourceExists)) }) }) @@ -126,7 +127,7 @@ var _ = Describe("Evacuation", func() { if test_helpers.UsePostgres() { queryStr = test_helpers.ReplaceQuestionMarks(queryStr) } - _, err := db.ExecContext(ctx, queryStr, actualLRP.ProcessGuid, actualLRP.Index, models.ActualLRP_Evacuating) + _, err := db.ExecContext(ctx, queryStr, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, models.ActualLRP_Evacuating) Expect(err).NotTo(HaveOccurred()) actualLRP.CrashCount = 0 @@ -137,7 +138,7 @@ var _ = Describe("Evacuation", func() { It("creates the evacuating actual lrp", func() { internalRoutes := model_helpers.NewActualLRPInternalRoutes() metricTags := model_helpers.NewActualLRPMetricTags() - evacuating, err := sqlDB.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, internalRoutes, metricTags, true, actualLRP.AvailabilityZone) + evacuating, err := sqlDB.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, internalRoutes, metricTags, true, actualLRP.AvailabilityZone) Expect(err).NotTo(HaveOccurred()) actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: guid, Index: &index}) @@ -149,7 +150,7 @@ var _ = Describe("Evacuation", func() { Expect(actualLRPs[0].ModificationTag.Index).To(BeEquivalentTo((0))) Expect(actualLRPs[0].ActualLrpInternalRoutes).To(Equal(internalRoutes)) Expect(actualLRPs[0].MetricTags).To(Equal(metricTags)) - Expect(actualLRPs[0].GetRoutable()).To(Equal(true)) + Expect(*actualLRPs[0].Routable).To(Equal(true)) Expect(actualLRPs[0].AvailabilityZone).To(Equal(actualLRP.AvailabilityZone)) actualLRPs[0].ModificationTag = actualLRP.ModificationTag @@ -165,12 +166,12 @@ var _ = Describe("Evacuation", func() { queryStr = test_helpers.ReplaceQuestionMarks(queryStr) } _, err := db.ExecContext(ctx, queryStr, - "garbage", actualLRP.ProcessGuid, actualLRP.Index, models.ActualLRP_Evacuating) + "garbage", actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, models.ActualLRP_Evacuating) Expect(err).NotTo(HaveOccurred()) }) It("removes the invalid record and inserts a replacement", func() { - evacuating, err := sqlDB.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, model_helpers.NewActualLRPInternalRoutes(), model_helpers.NewActualLRPMetricTags(), true, actualLRP.AvailabilityZone) + evacuating, err := sqlDB.EvacuateActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, model_helpers.NewActualLRPInternalRoutes(), model_helpers.NewActualLRPMetricTags(), true, actualLRP.AvailabilityZone) Expect(err).NotTo(HaveOccurred()) actualLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: guid, Index: &index}) @@ -194,12 +195,12 @@ var _ = Describe("Evacuation", func() { if test_helpers.UsePostgres() { queryStr = test_helpers.ReplaceQuestionMarks(queryStr) } - _, err := db.ExecContext(ctx, queryStr, models.ActualLRP_Evacuating, actualLRP.ProcessGuid, actualLRP.Index, models.ActualLRP_Ordinary) + _, err := db.ExecContext(ctx, queryStr, models.ActualLRP_Evacuating, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, models.ActualLRP_Ordinary) Expect(err).NotTo(HaveOccurred()) }) It("removes the evacuating actual LRP", func() { - err := sqlDB.RemoveEvacuatingActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey) + err := sqlDB.RemoveEvacuatingActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey) Expect(err).ToNot(HaveOccurred()) lrps, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: guid, Index: &index}) @@ -209,18 +210,18 @@ var _ = Describe("Evacuation", func() { Context("when the actual lrp instance key is not the same", func() { BeforeEach(func() { - actualLRP.CellId = "a different cell" + actualLRP.ActualLrpInstanceKey.CellId = "a different cell" }) It("returns a ErrActualLRPCannotBeRemoved error", func() { - err := sqlDB.RemoveEvacuatingActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey) + err := sqlDB.RemoveEvacuatingActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey) Expect(err).To(Equal(models.ErrActualLRPCannotBeRemoved)) }) }) Context("when the actualLRP is expired", func() { It("does not return an error", func() { - err := sqlDB.RemoveEvacuatingActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey) + err := sqlDB.RemoveEvacuatingActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey) Expect(err).NotTo(HaveOccurred()) lrps, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: guid, Index: &index}) @@ -232,7 +233,7 @@ var _ = Describe("Evacuation", func() { Context("when the actualLRP does not exist", func() { It("does not return an error", func() { - err := sqlDB.RemoveEvacuatingActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey) + err := sqlDB.RemoveEvacuatingActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey) Expect(err).NotTo(HaveOccurred()) }) }) diff --git a/db/sqldb/lrp_convergence.go b/db/sqldb/lrp_convergence.go index 51c50f73..1f3fa0b0 100644 --- a/db/sqldb/lrp_convergence.go +++ b/db/sqldb/lrp_convergence.go @@ -106,13 +106,13 @@ func (c *convergence) staleUnclaimedActualLRPs(ctx context.Context, logger lager if err != nil { continue } - key := models.NewActualLRPKey(schedulingInfo.ProcessGuid, int32(index), schedulingInfo.Domain) + key := models.NewActualLRPKey(schedulingInfo.DesiredLrpKey.ProcessGuid, int32(index), schedulingInfo.DesiredLrpKey.Domain) c.unstartedLRPKeys = append(c.unstartedLRPKeys, &models.ActualLRPKeyWithSchedulingInfo{ Key: &key, SchedulingInfo: schedulingInfo, }) logger.Info("creating-start-request", - lager.Data{"reason": "stale-unclaimed-lrp", "process_guid": schedulingInfo.ProcessGuid, "index": index}) + lager.Data{"reason": "stale-unclaimed-lrp", "process_guid": schedulingInfo.DesiredLrpKey.ProcessGuid, "index": index}) } if rows.Err() != nil { @@ -142,16 +142,16 @@ func (c *convergence) crashedActualLRPs(ctx context.Context, logger lager.Logger continue } - actual.ActualLRPKey = models.NewActualLRPKey(schedulingInfo.ProcessGuid, int32(index), schedulingInfo.Domain) + actual.ActualLrpKey = models.NewActualLRPKey(schedulingInfo.DesiredLrpKey.ProcessGuid, int32(index), schedulingInfo.DesiredLrpKey.Domain) actual.State = models.ActualLRPStateCrashed if actual.ShouldRestartCrash(now, restartCalculator) { c.unstartedLRPKeys = append(c.unstartedLRPKeys, &models.ActualLRPKeyWithSchedulingInfo{ - Key: &actual.ActualLRPKey, + Key: &actual.ActualLrpKey, SchedulingInfo: schedulingInfo, }) logger.Info("creating-start-request", - lager.Data{"reason": "crashed-instance", "process_guid": actual.ProcessGuid, "index": index}) + lager.Data{"reason": "crashed-instance", "process_guid": actual.ActualLrpKey.ProcessGuid, "index": index}) } } @@ -221,7 +221,7 @@ func (c *convergence) lrpsWithInternalRouteChanges(ctx context.Context, logger l } } - desiredInternalRoutes, err := internalroutes.InternalRoutesFromRoutingInfo(desiredRoutes) + desiredInternalRoutes, err := internalroutes.InternalRoutesFromRoutingInfo(&desiredRoutes) if err != nil { logger.Error("failed-getting-internal-routes-from-desired", err) continue @@ -288,8 +288,8 @@ func (c *convergence) lrpsWithMetricTagChanges(ctx context.Context, logger lager continue } desiredMetricTags, err := models.ConvertMetricTags(metricTags, map[models.MetricTagValue_DynamicValue]interface{}{ - models.MetricTagDynamicValueIndex: actualLRPKey.Index, - models.MetricTagDynamicValueInstanceGuid: actualLRPInstanceKey.InstanceGuid, + models.MetricTagValue_MetricTagDynamicValueIndex: actualLRPKey.Index, + models.MetricTagValue_MetricTagDynamicValueInstanceGuid: actualLRPInstanceKey.InstanceGuid, }) if err != nil { logger.Error("converting-metric-tags-failed", err) @@ -455,14 +455,14 @@ func (c *convergence) lrpInstanceCounts(ctx context.Context, logger lager.Logger index := int32(i) c.missingLRPKeys = append(c.missingLRPKeys, &models.ActualLRPKeyWithSchedulingInfo{ Key: &models.ActualLRPKey{ - ProcessGuid: schedulingInfo.ProcessGuid, - Domain: schedulingInfo.Domain, + ProcessGuid: schedulingInfo.DesiredLrpKey.ProcessGuid, + Domain: schedulingInfo.DesiredLrpKey.Domain, Index: index, }, SchedulingInfo: schedulingInfo, }) logger.Info("creating-start-request", - lager.Data{"reason": "missing-instance", "process_guid": schedulingInfo.ProcessGuid, "index": index}) + lager.Data{"reason": "missing-instance", "process_guid": schedulingInfo.DesiredLrpKey.ProcessGuid, "index": index}) } for index := range existingIndices { @@ -471,11 +471,11 @@ func (c *convergence) lrpInstanceCounts(ctx context.Context, logger lager.Logger } // only take destructive actions for fresh domains - if _, ok := domainSet[schedulingInfo.Domain]; ok { + if _, ok := domainSet[schedulingInfo.DesiredLrpKey.Domain]; ok { c.keysToRetire = append(c.keysToRetire, &models.ActualLRPKey{ - ProcessGuid: schedulingInfo.ProcessGuid, + ProcessGuid: schedulingInfo.DesiredLrpKey.ProcessGuid, Index: int32(index), - Domain: schedulingInfo.Domain, + Domain: schedulingInfo.DesiredLrpKey.Domain, }) } } @@ -526,8 +526,8 @@ func (c *convergence) actualLRPsWithMissingCells(ctx context.Context, logger lag if err == nil && presence == models.ActualLRP_Ordinary { ordinaryKeysWithMissingCells = append(ordinaryKeysWithMissingCells, &models.ActualLRPKeyWithSchedulingInfo{ Key: &models.ActualLRPKey{ - ProcessGuid: schedulingInfo.ProcessGuid, - Domain: schedulingInfo.Domain, + ProcessGuid: schedulingInfo.DesiredLrpKey.ProcessGuid, + Domain: schedulingInfo.DesiredLrpKey.Domain, Index: index, }, SchedulingInfo: schedulingInfo, diff --git a/db/sqldb/lrp_convergence_test.go b/db/sqldb/lrp_convergence_test.go index 31f48fff..d64d9a95 100644 --- a/db/sqldb/lrp_convergence_test.go +++ b/db/sqldb/lrp_convergence_test.go @@ -703,7 +703,7 @@ var _ = Describe("LRPConvergence", func() { expectedSched := desiredLRP.DesiredLRPSchedulingInfo() Expect(actualLRPs).To(HaveLen(1)) Expect(keysWithMissingCells).To(ContainElement(&models.ActualLRPKeyWithSchedulingInfo{ - Key: &actualLRPs[0].ActualLRPKey, + Key: &actualLRPs[0].ActualLrpKey, SchedulingInfo: &expectedSched, })) Expect(missingCellIds).To(Equal([]string{"other-cell"})) @@ -742,7 +742,7 @@ var _ = Describe("LRPConvergence", func() { expectedSched := desiredLRP.DesiredLRPSchedulingInfo() Expect(actualLRPs).To(HaveLen(1)) Expect(keysWithMissingCells).To(ContainElement(&models.ActualLRPKeyWithSchedulingInfo{ - Key: &actualLRPs[0].ActualLRPKey, + Key: &actualLRPs[0].ActualLrpKey, SchedulingInfo: &expectedSched, })) }) diff --git a/db/sqldb/suspect_db_test.go b/db/sqldb/suspect_db_test.go index a9c6abd2..5723d1d8 100644 --- a/db/sqldb/suspect_db_test.go +++ b/db/sqldb/suspect_db_test.go @@ -26,18 +26,18 @@ var _ = Describe("Suspect ActualLRPs", func() { actualLRP.ModificationTag.Increment() actualLRP.ModificationTag.Increment() - _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &actualLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) - _, _, err = sqlDB.ClaimActualLRP(ctx, logger, guid, index, &actualLRP.ActualLRPInstanceKey) + _, _, err = sqlDB.ClaimActualLRP(ctx, logger, guid, index, &actualLRP.ActualLrpInstanceKey) Expect(err).NotTo(HaveOccurred()) - _, _, err = sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, model_helpers.NewActualLRPInternalRoutes(), nil, false, actualLRP.AvailabilityZone) + _, _, err = sqlDB.StartActualLRP(ctx, logger, &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, model_helpers.NewActualLRPInternalRoutes(), nil, false, actualLRP.AvailabilityZone) Expect(err).NotTo(HaveOccurred()) }) Describe("PromoteSuspectActualLRP", func() { Context("when gettting suspect LRP fails", func() { It("returns an error", func() { - _, _, _, err := sqlDB.PromoteSuspectActualLRP(ctx, logger, actualLRP.ProcessGuid, actualLRP.Index) + _, _, _, err := sqlDB.PromoteSuspectActualLRP(ctx, logger, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index) Expect(err).To(HaveOccurred()) Expect(err).To(Equal(models.ErrResourceNotFound)) }) @@ -60,12 +60,13 @@ var _ = Describe("Suspect ActualLRPs", func() { replacementLRP.ModificationTag.Increment() replacementLRP.ModificationTag.Increment() replacementLRP.MetricTags = nil - replacementLRP.SetRoutable(false) - _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &replacementLRP.ActualLRPKey) + routable := false + replacementLRP.SetRoutable(&routable) + _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &replacementLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) - _, _, err = sqlDB.ClaimActualLRP(ctx, logger, replacementGuid, replacementIndex, &replacementLRP.ActualLRPInstanceKey) + _, _, err = sqlDB.ClaimActualLRP(ctx, logger, replacementGuid, replacementIndex, &replacementLRP.ActualLrpInstanceKey) Expect(err).NotTo(HaveOccurred()) - _, _, err = sqlDB.StartActualLRP(ctx, logger, &replacementLRP.ActualLRPKey, &replacementLRP.ActualLRPInstanceKey, &replacementLRP.ActualLRPNetInfo, model_helpers.NewActualLRPInternalRoutes(), nil, replacementLRP.GetRoutable(), replacementLRP.AvailabilityZone) + _, _, err = sqlDB.StartActualLRP(ctx, logger, &replacementLRP.ActualLrpKey, &replacementLRP.ActualLrpInstanceKey, &replacementLRP.ActualLrpNetInfo, model_helpers.NewActualLRPInternalRoutes(), nil, *replacementLRP.GetRoutable(), replacementLRP.AvailabilityZone) Expect(err).NotTo(HaveOccurred()) }) @@ -74,7 +75,7 @@ var _ = Describe("Suspect ActualLRPs", func() { Expect(err).NotTo(HaveOccurred()) Expect(beforeLRPs).To(ConsistOf(replacementLRP)) - _, _, removedLRP, err := sqlDB.PromoteSuspectActualLRP(ctx, logger, replacementLRP.ProcessGuid, replacementLRP.Index) + _, _, removedLRP, err := sqlDB.PromoteSuspectActualLRP(ctx, logger, replacementLRP.ActualLrpKey.ProcessGuid, replacementLRP.ActualLrpKey.Index) Expect(err).To(HaveOccurred()) Expect(removedLRP).To(BeNil()) @@ -91,18 +92,18 @@ var _ = Describe("Suspect ActualLRPs", func() { if test_helpers.UsePostgres() { queryStr = test_helpers.ReplaceQuestionMarks(queryStr) } - _, err := db.ExecContext(ctx, queryStr, models.ActualLRP_Suspect, actualLRP.ProcessGuid, actualLRP.Index, models.ActualLRP_Ordinary) + _, err := db.ExecContext(ctx, queryStr, models.ActualLRP_Suspect, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, models.ActualLRP_Ordinary) Expect(err).NotTo(HaveOccurred()) }) Context("when there is an ordinary actualLRP with the same key", func() { BeforeEach(func() { replacementLRP := model_helpers.NewValidActualLRP(guid, index) - _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &replacementLRP.ActualLRPKey) + _, err := sqlDB.CreateUnclaimedActualLRP(ctx, logger, &replacementLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) - _, _, err = sqlDB.ClaimActualLRP(ctx, logger, guid, index, &replacementLRP.ActualLRPInstanceKey) + _, _, err = sqlDB.ClaimActualLRP(ctx, logger, guid, index, &replacementLRP.ActualLrpInstanceKey) Expect(err).NotTo(HaveOccurred()) - _, _, err = sqlDB.StartActualLRP(ctx, logger, &replacementLRP.ActualLRPKey, &replacementLRP.ActualLRPInstanceKey, &replacementLRP.ActualLRPNetInfo, model_helpers.NewActualLRPInternalRoutes(), nil, false, replacementLRP.AvailabilityZone) + _, _, err = sqlDB.StartActualLRP(ctx, logger, &replacementLRP.ActualLrpKey, &replacementLRP.ActualLrpInstanceKey, &replacementLRP.ActualLrpNetInfo, model_helpers.NewActualLRPInternalRoutes(), nil, false, replacementLRP.AvailabilityZone) Expect(err).NotTo(HaveOccurred()) }) @@ -110,7 +111,7 @@ var _ = Describe("Suspect ActualLRPs", func() { beforeLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: guid, Index: &index}) Expect(err).NotTo(HaveOccurred()) - beforeLRP, afterLRP, removedLRP, err := sqlDB.PromoteSuspectActualLRP(ctx, logger, actualLRP.ProcessGuid, actualLRP.Index) + beforeLRP, afterLRP, removedLRP, err := sqlDB.PromoteSuspectActualLRP(ctx, logger, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index) Expect(err).NotTo(HaveOccurred()) Expect(beforeLRPs).To(ConsistOf(removedLRP, beforeLRP)) @@ -121,7 +122,7 @@ var _ = Describe("Suspect ActualLRPs", func() { }) It("promotes suspect LRP to ordinary", func() { - _, afterLRP, _, err := sqlDB.PromoteSuspectActualLRP(ctx, logger, actualLRP.ProcessGuid, actualLRP.Index) + _, afterLRP, _, err := sqlDB.PromoteSuspectActualLRP(ctx, logger, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index) Expect(err).NotTo(HaveOccurred()) afterLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: guid, Index: &index}) @@ -139,7 +140,7 @@ var _ = Describe("Suspect ActualLRPs", func() { if test_helpers.UsePostgres() { queryStr = test_helpers.ReplaceQuestionMarks(queryStr) } - _, err := db.ExecContext(ctx, queryStr, models.ActualLRP_Suspect, actualLRP.ProcessGuid, actualLRP.Index, models.ActualLRP_Ordinary) + _, err := db.ExecContext(ctx, queryStr, models.ActualLRP_Suspect, actualLRP.ActualLrpKey.ProcessGuid, actualLRP.ActualLrpKey.Index, models.ActualLRP_Ordinary) Expect(err).NotTo(HaveOccurred()) }) @@ -147,7 +148,7 @@ var _ = Describe("Suspect ActualLRPs", func() { beforeLRPs, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: guid, Index: &index}) Expect(err).NotTo(HaveOccurred()) - lrp, err := sqlDB.RemoveSuspectActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + lrp, err := sqlDB.RemoveSuspectActualLRP(ctx, logger, &actualLRP.ActualLrpKey) Expect(err).ToNot(HaveOccurred()) Expect(beforeLRPs).To(ConsistOf(lrp)) @@ -164,7 +165,7 @@ var _ = Describe("Suspect ActualLRPs", func() { before, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: "some-guid"}) Expect(err).NotTo(HaveOccurred()) - _, err = sqlDB.RemoveSuspectActualLRP(ctx, logger, &actualLRP.ActualLRPKey) + _, err = sqlDB.RemoveSuspectActualLRP(ctx, logger, &actualLRP.ActualLrpKey) Expect(err).NotTo(HaveOccurred()) after, err := sqlDB.ActualLRPs(ctx, logger, models.ActualLRPFilter{ProcessGuid: "some-guid"}) diff --git a/db/sqldb/task_db.go b/db/sqldb/task_db.go index bbdb7903..49f5b707 100644 --- a/db/sqldb/task_db.go +++ b/db/sqldb/task_db.go @@ -15,7 +15,8 @@ func (db *SQLDB) DesireTask(ctx context.Context, logger lager.Logger, taskDef *m logger.Info("starting") defer logger.Info("complete") - taskDefData, err := db.serializeModel(logger, taskDef) + protoTaskDef := taskDef.ToProto() + taskDefData, err := db.serializeModel(logger, protoTaskDef) if err != nil { logger.Error("failed-serializing-task-definition", err) return nil, err @@ -538,7 +539,9 @@ func (db *SQLDB) fetchTaskInternal(logger lager.Logger, scanner helpers.RowScann } var taskDef models.TaskDefinition - err = db.deserializeModel(logger, taskDefData, &taskDef) + var protoTaskDef models.ProtoTaskDefinition + err = db.deserializeModel(logger, taskDefData, &protoTaskDef) + taskDef = *protoTaskDef.FromProto() if err != nil { return nil, guid, models.ErrDeserialize } diff --git a/db/sqldb/task_db_test.go b/db/sqldb/task_db_test.go index cd3e1fef..6030ac32 100644 --- a/db/sqldb/task_db_test.go +++ b/db/sqldb/task_db_test.go @@ -87,7 +87,9 @@ var _ = Describe("TaskDB", func() { Expect(rejectionReason).To(Equal("")) var actualTaskDef models.TaskDefinition - err = serializer.Unmarshal(logger, taskDefData, &actualTaskDef) + var protoActualTaskDef models.ProtoTaskDefinition + err = serializer.Unmarshal(logger, taskDefData, &protoActualTaskDef) + actualTaskDef = *protoActualTaskDef.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(actualTaskDef).To(Equal(*taskDef)) @@ -1250,7 +1252,8 @@ var _ = Describe("TaskDB", func() { }) func insertTask(ctx context.Context, db helpers.QueryableDB, serializer format.Serializer, task *models.Task, malformedTaskDefinition bool) { - taskDefData, err := serializer.Marshal(logger, task.TaskDefinition) + protoTaskDef := task.TaskDefinition.ToProto() + taskDefData, err := serializer.Marshal(logger, protoTaskDef) Expect(err).NotTo(HaveOccurred()) if malformedTaskDefinition { @@ -1284,7 +1287,8 @@ func insertTask(ctx context.Context, db helpers.QueryableDB, serializer format.S } func updateTaskToInvalid(ctx context.Context, db helpers.QueryableDB, serializer format.Serializer, task *models.Task) { - _, err := serializer.Marshal(logger, task.TaskDefinition) + protoTaskDef := task.TaskDefinition.ToProto() + _, err := serializer.Marshal(logger, protoTaskDef) Expect(err).NotTo(HaveOccurred()) taskDefData := []byte("{{{{{{{{{{") diff --git a/docs/021-defining-tasks.md b/docs/021-defining-tasks.md index 9d7496d2..e8a1c423 100644 --- a/docs/021-defining-tasks.md +++ b/docs/021-defining-tasks.md @@ -37,9 +37,9 @@ err := client.DesireTask( Url: "https://blobstore.com/bits/other-bits", DestinationPath: "/usr/local/app/other", DigestValue: "some digest", - DigestAlgorithm: models.DigestAlgorithmSha256, - MediaType: models.MediaTypeTgz, - LayerType: models.LayerTypeExclusive, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, + MediaType: models.ImageLayer_MediaTypeTgz, + LayerType: models.ImageLayer_LayerTypeExclusive, }, }, Action: models.WrapAction(&models.RunAction{ diff --git a/docs/022-task-examples.md b/docs/022-task-examples.md index 04db7d1d..325ac861 100644 --- a/docs/022-task-examples.md +++ b/docs/022-task-examples.md @@ -47,7 +47,7 @@ for { } ``` -## Recieving a TaskCallbackResponse +## Receiving a TaskCallbackResponse To receive the TaskCallbackResponse, we first start an HTTP server. diff --git a/docs/030-lrps.md b/docs/030-lrps.md index 9dc66a58..4d21a316 100644 --- a/docs/030-lrps.md +++ b/docs/030-lrps.md @@ -153,9 +153,7 @@ In all cases, the consumer is given an array of `ActualLRPResponse`: "space_id": "some-space-guid", "space_name": "some-space-name" }, - "OptionalRoutable": { - "routable": true - }, + "routable": true, "availability_zone": "some-zone" }, ... diff --git a/docs/031-defining-lrps.md b/docs/031-defining-lrps.md index fe23a094..1d2817cb 100644 --- a/docs/031-defining-lrps.md +++ b/docs/031-defining-lrps.md @@ -39,9 +39,9 @@ err := client.DesireLRP(logger, &models.DesiredLRP{ Url: "https://blobstore.com/bits/other-bits", DestinationPath: "/usr/local/app/other", DigestValue: "some digest", - DigestAlgorithm: models.DigestAlgorithmSha256, - MediaType: models.MediaTypeTgz, - LayerType: models.LayerTypeExclusive, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, + MediaType: models.ImageLayer_MediaTypeTgz, + LayerType: models.ImageLayer_LayerTypeExclusive, }, }, Setup: models.WrapAction(&models.RunAction{Path: "ls", User: "name"}), @@ -122,7 +122,7 @@ err := client.DesireLRP(logger, &models.DesiredLRP{ Static: "some-source-id", }, "instance_index": &models.MetricTagValue{ - Dynamic: models.MetricTagDynamicValueIndex, + Dynamic: models.MetricTagValue_MetricTagDynamicValueIndex, }, }, }) diff --git a/docs/032-lrp-examples.md b/docs/032-lrp-examples.md index 0ab9acba..e74c85df 100644 --- a/docs/032-lrp-examples.md +++ b/docs/032-lrp-examples.md @@ -87,7 +87,7 @@ err = client.DesireLRP(logger, &models.DesiredLRP{ Static: "some-source-id", }, "instance_index": &models.MetricTagValue{ - Dynamic: models.MetricTagDynamicValueIndex, + Dynamic: models.MetricTagValue_MetricTagDynamicValueIndex, }, }, }) @@ -109,7 +109,7 @@ for { } ``` -## Recieving a LRPCallbackResponse +## Receiving a LRPCallbackResponse To receive the LRPCallbackResponse, we first start an HTTP server. diff --git a/docs/054-common-models.md b/docs/054-common-models.md index 36ac50c9..fb07210f 100644 --- a/docs/054-common-models.md +++ b/docs/054-common-models.md @@ -4,6 +4,11 @@ expires_at : never tags: [diego-release, bbs] --- +## Protobuf Models + +BBS utilizes [Google's Protobuf Implementation](https://google.golang.org/protobuf) for code generation purposes. +See [Protobuf Models](055-protobuf-models.md) for details. + ##### `EnvironmentVariables` [optional] Clients may define environment variables at the container level, which all processes running in the container will receive. For example: @@ -53,18 +58,18 @@ ImageLayers: []*models.ImageLayer{ Url: "https://blobstore.com/bits/app-bits", DestinationPath: "/usr/local/app", DigestValue: "some digest", - DigestAlgorithm: models.DigestAlgorithmSha256, - MediaType: models.MediaTypeTgz, - LayerType: models.LayerTypeExclusive, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, + MediaType: models.ImageLayer_MediaTypeTgz, + LayerType: models.ImageLayer_LayerTypeExclusive, } }, ``` -`DigestAlgorithm` and `DigestValue` are optional for image layers of type `LayerTypeShared`. All other fields are required. +`DigestAlgorithm` and `DigestValue` are optional for image layers of type `ImageLayer_LayerTypeShared`. All other fields are required. -Image layers of type `LayerTypeShared` could be converted to `CachedDependency` for diego cells that do not support ImageLayers or api clients that are using old api endpoints. +Image layers of type `ImageLayer_LayerTypeShared` could be converted to `CachedDependency` for diego cells that do not support ImageLayers or api clients that are using old api endpoints. -`LayerTypeExclusive` layers are converted to DownloadActions and are ran before +`ImageLayer_LayerTypeExclusive` layers are converted to DownloadActions and are ran before LRP `Setup` action or the task's`Action`. For more information see the [Actions Documentation](053-actions.md). diff --git a/docs/055-protobuf-models.md b/docs/055-protobuf-models.md new file mode 100644 index 00000000..ae0442d6 --- /dev/null +++ b/docs/055-protobuf-models.md @@ -0,0 +1,40 @@ +--- +title: Protobuf Models +expires_at : never +tags: [diego-release, bbs] +--- + +# Protobuf Models + +BBS utilizes [Google's Protobuf Implementation](https://google.golang.org/protobuf) for code generation purposes. +In addition to this, the `protoc-gen-go-bbs` [plugin](../protoc-gen-go-bbs) has been created to accomodate special use cases for BBS itself. +For example, "raw" protos generated by the `protoc` compiler cannot be passed to functions conventionally due to copylocks, +so `protoc-gen-go-bbs` generates an additional model that supports this. + +> \[!IMPORTANT\] +> New protos MUST be created with the "Proto" prefix on the struct name (e.g. ProtoRunAction) in order to be picked up by the plugin + +# Generating models from protobufs + +### [Official Documentation](https://protobuf.dev/getting-started/gotutorial/) + +## One-step solution for generating all protos + - Use the `check-proto-files` [script](https://github.com/cloudfoundry/wg-app-platform-runtime-ci/blob/main/diego-release/linters/check-proto-files.bash) + from the Working Group CI [repo](https://github.com/cloudfoundry/wg-app-platform-runtime-ci) + +## Installation + - Download the latest `protoc` [compiler](https://github.com/protocolbuffers/protobuf/releases) + - Unzip and add to PATH + - Install the latest golang plugin + - `go install google.golang.org/protobuf/cmd/protoc-gen-go@latest` + - Install the latest grpc plugin + - `go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest` + - Install the `protoc-gen-go-bbs` plugin + - `cd protoc-gen-go-bbs && go install .` + +## Usage +### To generate all protos + - Use the BBS helper [script](../scripts/generate_protos.sh) + +### For a single file + - `protoc --go_out=. --go-grpc_out=. --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative .proto` diff --git a/events/calculator/actual_lrp_event_calculator.go b/events/calculator/actual_lrp_event_calculator.go index d77fbac9..af1a7724 100644 --- a/events/calculator/actual_lrp_event_calculator.go +++ b/events/calculator/actual_lrp_event_calculator.go @@ -217,7 +217,7 @@ func (e ActualLRPEventCalculator) RecordChange(before, after *models.ActualLRP, continue } - if before != nil && l.ActualLRPInstanceKey.Equal(before.ActualLRPInstanceKey) { + if before != nil && l.ActualLrpInstanceKey.Equal(before.ActualLrpInstanceKey) { newLRPs = append(newLRPs, after) found = true } else { @@ -307,8 +307,8 @@ func generateUnclaimedGroupEvents(before, after *models.ActualLRP) []models.Even } func generateUpdateGroupEvents(before, after *models.ActualLRP) []models.Event { - if !before.ActualLRPInstanceKey.Empty() && - !after.ActualLRPInstanceKey.Equal(before.ActualLRPInstanceKey) { + if !before.ActualLrpInstanceKey.Empty() && + !after.ActualLrpInstanceKey.Equal(before.ActualLrpInstanceKey) { // an Ordinary LRP replaced Suspect LRP return wrapEvent( //lint:ignore SA1019 - still need to emit these events until the ActaulLRPGroup api is deleted @@ -374,7 +374,7 @@ func getEventLRP(e models.Event) (*models.ActualLRP, bool) { case *models.ActualLRPInstanceCreatedEvent: return x.ActualLrp, false case *models.ActualLRPInstanceChangedEvent: - return x.After.ToActualLRP(x.ActualLRPKey, x.ActualLRPInstanceKey), false + return x.After.ToActualLRP(x.ActualLrpKey, x.ActualLrpInstanceKey), false case *models.ActualLRPCrashedEvent: return nil, true } diff --git a/events/calculator/actual_lrp_event_calculator_test.go b/events/calculator/actual_lrp_event_calculator_test.go index 2104a331..3908b81e 100644 --- a/events/calculator/actual_lrp_event_calculator_test.go +++ b/events/calculator/actual_lrp_event_calculator_test.go @@ -232,7 +232,7 @@ var _ = Describe("ActualLrpEventCalculator", func() { Context("from UNCLAIMED", func() { BeforeEach(func() { originalLRP.State = models.ActualLRPStateUnclaimed - originalLRP.ActualLRPInstanceKey = models.ActualLRPInstanceKey{} + originalLRP.ActualLrpInstanceKey = models.ActualLRPInstanceKey{} }) It("emits an ActualLRPChanged event", func() { @@ -407,7 +407,7 @@ var _ = Describe("ActualLrpEventCalculator", func() { suspectLRP.Presence = models.ActualLRP_Suspect replacementLRP = model_helpers.NewValidActualLRP("some-guid-1", 0) - replacementLRP.ActualLRPInstanceKey = models.NewActualLRPInstanceKey( + replacementLRP.ActualLrpInstanceKey = models.NewActualLRPInstanceKey( "replacement", "replacement-cell", ) @@ -476,7 +476,7 @@ var _ = Describe("ActualLrpEventCalculator", func() { BeforeEach(func() { unclaimedLRP = model_helpers.NewValidActualLRP("some-guid-1", 0) - unclaimedLRP.ActualLRPInstanceKey = models.ActualLRPInstanceKey{} + unclaimedLRP.ActualLrpInstanceKey = models.ActualLRPInstanceKey{} unclaimedLRP.State = models.ActualLRPStateUnclaimed originalLRP = model_helpers.NewValidActualLRP("some-guid-1", 0) diff --git a/events/event_source.go b/events/event_source.go index a8271690..57eb2f9c 100644 --- a/events/event_source.go +++ b/events/event_source.go @@ -8,8 +8,8 @@ import ( "strconv" "code.cloudfoundry.org/bbs/models" - "github.com/gogo/protobuf/proto" "github.com/vito/go-sse/sse" + "google.golang.org/protobuf/proto" ) var ( @@ -56,7 +56,7 @@ func (e closeError) Error() string { } func NewEventFromModelEvent(eventID int, event models.Event) (sse.Event, error) { - payload, err := proto.Marshal(event) + payload, err := proto.Marshal(event.ToEventProto()) if err != nil { return sse.Event{}, err } @@ -143,28 +143,34 @@ func parseRawEvent(rawEvent sse.Event) (models.Event, error) { switch rawEvent.Name { case models.EventTypeDesiredLRPCreated: event := new(models.DesiredLRPCreatedEvent) - err := proto.Unmarshal(data, event) + protoEvent := new(models.ProtoDesiredLRPCreatedEvent) + err := proto.Unmarshal(data, protoEvent) if err != nil { return nil, NewInvalidPayloadError(rawEvent.Name, err) } + event = protoEvent.FromProto() return event, nil case models.EventTypeDesiredLRPChanged: event := new(models.DesiredLRPChangedEvent) - err := proto.Unmarshal(data, event) + protoEvent := new(models.ProtoDesiredLRPChangedEvent) + err := proto.Unmarshal(data, protoEvent) if err != nil { return nil, NewInvalidPayloadError(rawEvent.Name, err) } + event = protoEvent.FromProto() return event, nil case models.EventTypeDesiredLRPRemoved: event := new(models.DesiredLRPRemovedEvent) - err := proto.Unmarshal(data, event) + protoEvent := new(models.ProtoDesiredLRPRemovedEvent) + err := proto.Unmarshal(data, protoEvent) if err != nil { return nil, NewInvalidPayloadError(rawEvent.Name, err) } + event = protoEvent.FromProto() return event, nil @@ -172,10 +178,13 @@ func parseRawEvent(rawEvent sse.Event) (models.Event, error) { case models.EventTypeActualLRPCreated: //lint:ignore SA1019 - need to support this event until the deprecation becomes deletion event := new(models.ActualLRPCreatedEvent) - err := proto.Unmarshal(data, event) + //lint:ignore SA1019 - need to support this event until the deprecation becomes deletion + protoEvent := new(models.ProtoActualLRPCreatedEvent) + err := proto.Unmarshal(data, protoEvent) if err != nil { return nil, NewInvalidPayloadError(rawEvent.Name, err) } + event = protoEvent.FromProto() return event, nil @@ -183,10 +192,13 @@ func parseRawEvent(rawEvent sse.Event) (models.Event, error) { case models.EventTypeActualLRPChanged: //lint:ignore SA1019 - need to support this event until the deprecation becomes deletion event := new(models.ActualLRPChangedEvent) - err := proto.Unmarshal(data, event) + //lint:ignore SA1019 - need to support this event until the deprecation becomes deletion + protoEvent := new(models.ProtoActualLRPChangedEvent) + err := proto.Unmarshal(data, protoEvent) if err != nil { return nil, NewInvalidPayloadError(rawEvent.Name, err) } + event = protoEvent.FromProto() return event, nil @@ -194,73 +206,101 @@ func parseRawEvent(rawEvent sse.Event) (models.Event, error) { case models.EventTypeActualLRPRemoved: //lint:ignore SA1019 - need to support this event until the deprecation becomes deletion event := new(models.ActualLRPRemovedEvent) - err := proto.Unmarshal(data, event) + //lint:ignore SA1019 - need to support this event until the deprecation becomes deletion + protoEvent := new(models.ProtoActualLRPRemovedEvent) + err := proto.Unmarshal(data, protoEvent) if err != nil { return nil, NewInvalidPayloadError(rawEvent.Name, err) } + event = protoEvent.FromProto() return event, nil case models.EventTypeActualLRPCrashed: event := new(models.ActualLRPCrashedEvent) - err := proto.Unmarshal(data, event) + protoEvent := new(models.ProtoActualLRPCrashedEvent) + err := proto.Unmarshal(data, protoEvent) if err != nil { return nil, NewInvalidPayloadError(rawEvent.Name, err) } + event = protoEvent.FromProto() return event, nil case models.EventTypeTaskCreated: event := new(models.TaskCreatedEvent) - err := proto.Unmarshal(data, event) + protoEvent := new(models.ProtoTaskCreatedEvent) + err := proto.Unmarshal(data, protoEvent) if err != nil { return nil, NewInvalidPayloadError(rawEvent.Name, err) } + event = protoEvent.FromProto() return event, nil case models.EventTypeTaskChanged: event := new(models.TaskChangedEvent) - err := proto.Unmarshal(data, event) + protoEvent := new(models.ProtoTaskChangedEvent) + err := proto.Unmarshal(data, protoEvent) if err != nil { return nil, NewInvalidPayloadError(rawEvent.Name, err) } + event = protoEvent.FromProto() return event, nil case models.EventTypeTaskRemoved: event := new(models.TaskRemovedEvent) - err := proto.Unmarshal(data, event) + protoEvent := new(models.ProtoTaskRemovedEvent) + err := proto.Unmarshal(data, protoEvent) if err != nil { return nil, NewInvalidPayloadError(rawEvent.Name, err) } + event = protoEvent.FromProto() return event, nil case models.EventTypeActualLRPInstanceCreated: event := new(models.ActualLRPInstanceCreatedEvent) - err := proto.Unmarshal(data, event) + protoEvent := new(models.ProtoActualLRPInstanceCreatedEvent) + err := proto.Unmarshal(data, protoEvent) if err != nil { return nil, NewInvalidPayloadError(rawEvent.Name, err) } + event = protoEvent.FromProto() return event, nil case models.EventTypeActualLRPInstanceChanged: event := new(models.ActualLRPInstanceChangedEvent) - err := proto.Unmarshal(data, event) + protoEvent := new(models.ProtoActualLRPInstanceChangedEvent) + err := proto.Unmarshal(data, protoEvent) if err != nil { return nil, NewInvalidPayloadError(rawEvent.Name, err) } + event = protoEvent.FromProto() return event, nil case models.EventTypeActualLRPInstanceRemoved: event := new(models.ActualLRPInstanceRemovedEvent) - err := proto.Unmarshal(data, event) + protoEvent := new(models.ProtoActualLRPInstanceRemovedEvent) + err := proto.Unmarshal(data, protoEvent) + if err != nil { + return nil, NewInvalidPayloadError(rawEvent.Name, err) + } + event = protoEvent.FromProto() + + return event, nil + + case models.EventTypeFake: + event := new(models.FakeEvent) + protoEvent := new(models.ProtoFakeEvent) + err := proto.Unmarshal(data, protoEvent) if err != nil { return nil, NewInvalidPayloadError(rawEvent.Name, err) } + event = protoEvent.FromProto() return event, nil } diff --git a/events/event_source_test.go b/events/event_source_test.go index bd0f1858..2d81d7c4 100644 --- a/events/event_source_test.go +++ b/events/event_source_test.go @@ -9,10 +9,10 @@ import ( "code.cloudfoundry.org/bbs/events/eventfakes" "code.cloudfoundry.org/bbs/models" "code.cloudfoundry.org/bbs/models/test/model_helpers" - "github.com/gogo/protobuf/proto" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/vito/go-sse/sse" + "google.golang.org/protobuf/proto" ) var _ = Describe("EventSource", func() { @@ -45,7 +45,7 @@ var _ = Describe("EventSource", func() { BeforeEach(func() { expectedEvent = models.NewDesiredLRPCreatedEvent(desiredLRP, "some-trace-id") - payload, err := proto.Marshal(expectedEvent) + payload, err := proto.Marshal(expectedEvent.ToProto()) Expect(err).NotTo(HaveOccurred()) payload = []byte(base64.StdEncoding.EncodeToString(payload)) @@ -74,7 +74,7 @@ var _ = Describe("EventSource", func() { BeforeEach(func() { expectedEvent = models.NewDesiredLRPChangedEvent(desiredLRP, desiredLRP, "some-trace-id") - payload, err := proto.Marshal(expectedEvent) + payload, err := proto.Marshal(expectedEvent.ToProto()) Expect(err).NotTo(HaveOccurred()) payload = []byte(base64.StdEncoding.EncodeToString(payload)) @@ -103,7 +103,7 @@ var _ = Describe("EventSource", func() { BeforeEach(func() { expectedEvent = models.NewDesiredLRPRemovedEvent(desiredLRP, "some-trace-id") - payload, err := proto.Marshal(expectedEvent) + payload, err := proto.Marshal(expectedEvent.ToProto()) Expect(err).NotTo(HaveOccurred()) payload = []byte(base64.StdEncoding.EncodeToString(payload)) @@ -146,7 +146,7 @@ var _ = Describe("EventSource", func() { BeforeEach(func() { //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method expectedEvent = models.NewActualLRPCreatedEvent(actualLRPGroup) - payload, err := proto.Marshal(expectedEvent) + payload, err := proto.Marshal(expectedEvent.ToProto()) Expect(err).NotTo(HaveOccurred()) payload = []byte(base64.StdEncoding.EncodeToString(payload)) @@ -179,7 +179,7 @@ var _ = Describe("EventSource", func() { BeforeEach(func() { //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method expectedEvent = models.NewActualLRPChangedEvent(actualLRPGroup, actualLRPGroup) - payload, err := proto.Marshal(expectedEvent) + payload, err := proto.Marshal(expectedEvent.ToProto()) Expect(err).NotTo(HaveOccurred()) payload = []byte(base64.StdEncoding.EncodeToString(payload)) @@ -212,7 +212,7 @@ var _ = Describe("EventSource", func() { BeforeEach(func() { //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method expectedEvent = models.NewActualLRPRemovedEvent(actualLRPGroup) - payload, err := proto.Marshal(expectedEvent) + payload, err := proto.Marshal(expectedEvent.ToProto()) Expect(err).NotTo(HaveOccurred()) payload = []byte(base64.StdEncoding.EncodeToString(payload)) @@ -243,7 +243,7 @@ var _ = Describe("EventSource", func() { BeforeEach(func() { expectedEvent = models.NewActualLRPCrashedEvent(actualLRP, actualLRP) - payload, err := proto.Marshal(expectedEvent) + payload, err := proto.Marshal(expectedEvent.ToProto()) Expect(err).NotTo(HaveOccurred()) payload = []byte(base64.StdEncoding.EncodeToString(payload)) @@ -280,7 +280,7 @@ var _ = Describe("EventSource", func() { BeforeEach(func() { expectedEvent = models.NewTaskCreatedEvent(task) - payload, err := proto.Marshal(expectedEvent) + payload, err := proto.Marshal(expectedEvent.ToProto()) Expect(err).NotTo(HaveOccurred()) payload = []byte(base64.StdEncoding.EncodeToString(payload)) @@ -309,7 +309,7 @@ var _ = Describe("EventSource", func() { BeforeEach(func() { expectedEvent = models.NewTaskChangedEvent(task, task) - payload, err := proto.Marshal(expectedEvent) + payload, err := proto.Marshal(expectedEvent.ToProto()) Expect(err).NotTo(HaveOccurred()) payload = []byte(base64.StdEncoding.EncodeToString(payload)) @@ -338,7 +338,7 @@ var _ = Describe("EventSource", func() { BeforeEach(func() { expectedEvent = models.NewTaskRemovedEvent(task) - payload, err := proto.Marshal(expectedEvent) + payload, err := proto.Marshal(expectedEvent.ToProto()) Expect(err).NotTo(HaveOccurred()) payload = []byte(base64.StdEncoding.EncodeToString(payload)) diff --git a/events/eventfakes/fake_events.go b/events/eventfakes/fake_events.go deleted file mode 100644 index 842c303a..00000000 --- a/events/eventfakes/fake_events.go +++ /dev/null @@ -1,21 +0,0 @@ -package eventfakes - -import "errors" - -type FakeEvent struct{ Token string } - -func (FakeEvent) EventType() string { return "fake" } -func (FakeEvent) Key() string { return "fake" } -func (FakeEvent) ProtoMessage() {} -func (FakeEvent) Reset() {} -func (FakeEvent) String() string { return "fake" } -func (e FakeEvent) Marshal() ([]byte, error) { return []byte(e.Token), nil } - -type UnmarshalableEvent struct{ Fn func() } - -func (UnmarshalableEvent) EventType() string { return "unmarshalable" } -func (UnmarshalableEvent) Key() string { return "unmarshalable" } -func (UnmarshalableEvent) ProtoMessage() {} -func (UnmarshalableEvent) Reset() {} -func (UnmarshalableEvent) String() string { return "unmarshalable" } -func (UnmarshalableEvent) Marshal() ([]byte, error) { return nil, errors.New("no workie") } diff --git a/events/hub_test.go b/events/hub_test.go index ca62a7cd..156067d4 100644 --- a/events/hub_test.go +++ b/events/hub_test.go @@ -4,7 +4,7 @@ import ( "strconv" "code.cloudfoundry.org/bbs/events" - "code.cloudfoundry.org/bbs/events/eventfakes" + "code.cloudfoundry.org/bbs/models" "code.cloudfoundry.org/lager/v3/lagertest" . "github.com/onsi/ginkgo/v2" @@ -88,13 +88,13 @@ var _ = Describe("Hub", func() { source2, err := hub.Subscribe() Expect(err).NotTo(HaveOccurred()) - hub.Emit(eventfakes.FakeEvent{Token: "1"}) - Expect(source1.Next()).To(Equal(eventfakes.FakeEvent{Token: "1"})) - Expect(source2.Next()).To(Equal(eventfakes.FakeEvent{Token: "1"})) + hub.Emit(&models.FakeEvent{Token: "1"}) + Expect(source1.Next()).To(Equal(&models.FakeEvent{Token: "1"})) + Expect(source2.Next()).To(Equal(&models.FakeEvent{Token: "1"})) - hub.Emit(eventfakes.FakeEvent{Token: "2"}) - Expect(source1.Next()).To(Equal(eventfakes.FakeEvent{Token: "2"})) - Expect(source2.Next()).To(Equal(eventfakes.FakeEvent{Token: "2"})) + hub.Emit(&models.FakeEvent{Token: "2"}) + Expect(source1.Next()).To(Equal(&models.FakeEvent{Token: "2"})) + Expect(source2.Next()).To(Equal(&models.FakeEvent{Token: "2"})) }) It("closes slow consumers after MAX_PENDING_SUBSCRIBER_EVENTS missed events", func() { @@ -103,28 +103,28 @@ var _ = Describe("Hub", func() { By("filling the 'buffer'") for eventToken := 0; eventToken < events.MAX_PENDING_SUBSCRIBER_EVENTS; eventToken++ { - hub.Emit(eventfakes.FakeEvent{Token: strconv.Itoa(eventToken)}) + hub.Emit(&models.FakeEvent{Token: strconv.Itoa(eventToken)}) } By("reading 2 events off") ev, err := slowConsumer.Next() Expect(err).NotTo(HaveOccurred()) - Expect(ev).To(Equal(eventfakes.FakeEvent{Token: "0"})) + Expect(ev).To(Equal(&models.FakeEvent{Token: "0"})) ev, err = slowConsumer.Next() Expect(err).NotTo(HaveOccurred()) - Expect(ev).To(Equal(eventfakes.FakeEvent{Token: "1"})) + Expect(ev).To(Equal(&models.FakeEvent{Token: "1"})) By("putting 3 more events on, 'overflowing the buffer' and making the consumer 'slow'") for eventToken := events.MAX_PENDING_SUBSCRIBER_EVENTS; eventToken < events.MAX_PENDING_SUBSCRIBER_EVENTS+3; eventToken++ { - hub.Emit(eventfakes.FakeEvent{Token: strconv.Itoa(eventToken)}) + hub.Emit(&models.FakeEvent{Token: strconv.Itoa(eventToken)}) } By("reading off all the 'buffered' events") for eventToken := 2; eventToken < events.MAX_PENDING_SUBSCRIBER_EVENTS+2; eventToken++ { ev, err = slowConsumer.Next() Expect(err).NotTo(HaveOccurred()) - Expect(ev).To(Equal(eventfakes.FakeEvent{Token: strconv.Itoa(eventToken)})) + Expect(ev).To(Equal(&models.FakeEvent{Token: strconv.Itoa(eventToken)})) } By("trying to read more out of the source") @@ -137,8 +137,8 @@ var _ = Describe("Hub", func() { source, err := hub.Subscribe() Expect(err).NotTo(HaveOccurred()) - hub.Emit(eventfakes.FakeEvent{Token: "1"}) - Expect(source.Next()).To(Equal(eventfakes.FakeEvent{Token: "1"})) + hub.Emit(&models.FakeEvent{Token: "1"}) + Expect(source.Next()).To(Equal(&models.FakeEvent{Token: "1"})) err = source.Close() Expect(err).NotTo(HaveOccurred()) @@ -154,7 +154,7 @@ var _ = Describe("Hub", func() { err = source.Close() Expect(err).NotTo(HaveOccurred()) - hub.Emit(eventfakes.FakeEvent{Token: "1"}) + hub.Emit(&models.FakeEvent{Token: "1"}) _, err = source.Next() Expect(err).To(Equal(events.ErrReadFromClosedSource)) diff --git a/format/envelope.go b/format/envelope.go index dcd306d0..a9d814fa 100644 --- a/format/envelope.go +++ b/format/envelope.go @@ -2,7 +2,7 @@ package format import ( "code.cloudfoundry.org/lager/v3" - "github.com/gogo/protobuf/proto" + "google.golang.org/protobuf/proto" ) type EnvelopeFormat byte diff --git a/format/envelope_test.go b/format/envelope_test.go index ed7ebe53..742bff67 100644 --- a/format/envelope_test.go +++ b/format/envelope_test.go @@ -5,9 +5,9 @@ import ( "code.cloudfoundry.org/bbs/models" "code.cloudfoundry.org/bbs/models/test/model_helpers" "code.cloudfoundry.org/lager/v3/lagertest" - "github.com/gogo/protobuf/proto" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) var _ = Describe("Envelope", func() { @@ -20,36 +20,36 @@ var _ = Describe("Envelope", func() { Describe("Marshal", func() { It("can successfully marshal a model object envelope", func() { task := model_helpers.NewValidTask("some-guid") - encoded, err := format.MarshalEnvelope(task) + encoded, err := format.MarshalEnvelope(task.ToProto()) Expect(err).NotTo(HaveOccurred()) Expect(format.EnvelopeFormat(encoded[0])).To(Equal(format.PROTO)) - var newTask models.Task + var newTask models.ProtoTask modelErr := proto.Unmarshal(encoded[2:], &newTask) Expect(modelErr).To(BeNil()) - Expect(*task).To(Equal(newTask)) + Expect(task).To(Equal(newTask.FromProto())) }) }) Describe("Unmarshal", func() { It("can marshal and unmarshal a task without losing data", func() { task := model_helpers.NewValidTask("some-guid") - payload, err := format.MarshalEnvelope(task) + payload, err := format.MarshalEnvelope(task.ToProto()) Expect(err).NotTo(HaveOccurred()) - resultingTask := new(models.Task) + resultingTask := new(models.ProtoTask) err = format.UnmarshalEnvelope(logger, payload, resultingTask) Expect(err).NotTo(HaveOccurred()) - Expect(*resultingTask).To(BeEquivalentTo(*task)) + Expect(resultingTask.FromProto()).To(BeEquivalentTo(task)) }) It("returns an error when the protobuf payload is invalid", func() { model := model_helpers.NewValidTask("foo") payload := []byte{byte(format.PROTO), byte(format.V0), 'f', 'o', 'o'} - err := format.UnmarshalEnvelope(logger, payload, model) + err := format.UnmarshalEnvelope(logger, payload, model.ToProto()) Expect(err).To(HaveOccurred()) }) }) diff --git a/format/format_test.go b/format/format_test.go index a9a08a05..60c5ae2d 100644 --- a/format/format_test.go +++ b/format/format_test.go @@ -3,9 +3,9 @@ package format_test import ( "code.cloudfoundry.org/lager/v3" "code.cloudfoundry.org/lager/v3/lagertest" - "github.com/gogo/protobuf/proto" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" "code.cloudfoundry.org/bbs/encryption" "code.cloudfoundry.org/bbs/encryption/encryptionfakes" @@ -45,17 +45,17 @@ var _ = Describe("Format", func() { Describe("Marshal", func() { Describe("ENCRYPTED_PROTO", func() { It("marshals the data as protobuf with an base64 encoded ciphertext envelope", func() { - encoded, err := serializer.Marshal(logger, task) + encoded, err := serializer.Marshal(logger, task.ToProto()) Expect(err).NotTo(HaveOccurred()) unencoded, err := encoder.Decode(encoded) Expect(err).NotTo(HaveOccurred()) Expect(unencoded[0]).To(BeEquivalentTo(format.PROTO)) - var actualTask models.Task + var actualTask models.ProtoTask err = proto.Unmarshal(unencoded[2:], &actualTask) Expect(err).NotTo(HaveOccurred()) - Expect(actualTask).To(Equal(*task)) + Expect(*actualTask.FromProto()).To(Equal(*task)) }) }) }) @@ -63,13 +63,13 @@ var _ = Describe("Format", func() { Describe("Unmarshal", func() { Describe("ENCRYPTED_PROTO", func() { It("unmarshals the protobuf data from a base64 encoded ciphertext envelope", func() { - payload, err := serializer.Marshal(logger, task) + payload, err := serializer.Marshal(logger, task.ToProto()) Expect(err).NotTo(HaveOccurred()) - var decodedTask models.Task + var decodedTask models.ProtoTask err = serializer.Unmarshal(logger, payload, &decodedTask) Expect(err).NotTo(HaveOccurred()) - Expect(*task).To(Equal(decodedTask)) + Expect(*task).To(Equal(*decodedTask.FromProto())) }) }) }) diff --git a/format/versioner.go b/format/versioner.go index e4c3feb2..6eec60ef 100644 --- a/format/versioner.go +++ b/format/versioner.go @@ -1,6 +1,6 @@ package format -import "github.com/gogo/protobuf/proto" +import "google.golang.org/protobuf/proto" type Version byte diff --git a/handlers/actual_lrp_handlers.go b/handlers/actual_lrp_handlers.go index ebf76d0f..21b6cf8f 100644 --- a/handlers/actual_lrp_handlers.go +++ b/handlers/actual_lrp_handlers.go @@ -26,15 +26,17 @@ func (h *ActualLRPHandler) ActualLRPs(logger lager.Logger, w http.ResponseWriter logger.Debug("starting") defer logger.Debug("complete") - request := &models.ActualLRPsRequest{} + var request *models.ActualLRPsRequest + protoRequest := &models.ProtoActualLRPsRequest{} response := &models.ActualLRPsResponse{} - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err == nil { var index *int32 if request.IndexExists() { i := request.GetIndex() - index = &i + index = i } filter := models.ActualLRPFilter{Domain: request.Domain, CellID: request.CellId, Index: index, ProcessGuid: request.ProcessGuid} response.ActualLrps, err = h.db.ActualLRPs(req.Context(), logger, filter) @@ -42,7 +44,7 @@ func (h *ActualLRPHandler) ActualLRPs(logger lager.Logger, w http.ResponseWriter response.Error = models.ConvertError(err) - writeResponse(w, response) + writeResponse(w, response.ToProto()) exitIfUnrecoverable(logger, h.exitChan, response.Error) } @@ -51,12 +53,14 @@ func (h *ActualLRPHandler) ActualLRPGroups(logger lager.Logger, w http.ResponseW var err error logger = logger.Session("actual-lrp-groups").WithTraceInfo(req) - request := &models.ActualLRPGroupsRequest{} + var request *models.ActualLRPGroupsRequest + protoRequest := &models.ProtoActualLRPGroupsRequest{} response := &models.ActualLRPGroupsResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { writeResponse(w, response.ToProto()) }() - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { response.Error = models.ConvertError(err) return @@ -76,12 +80,14 @@ func (h *ActualLRPHandler) ActualLRPGroupsByProcessGuid(logger lager.Logger, w h var err error logger = logger.Session("actual-lrp-groups-by-process-guid").WithTraceInfo(req) - request := &models.ActualLRPGroupsByProcessGuidRequest{} + var request *models.ActualLRPGroupsByProcessGuidRequest + protoRequest := &models.ProtoActualLRPGroupsByProcessGuidRequest{} response := &models.ActualLRPGroupsResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { writeResponse(w, response.ToProto()) }() - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { response.Error = models.ConvertError(err) return @@ -100,12 +106,14 @@ func (h *ActualLRPHandler) ActualLRPGroupByProcessGuidAndIndex(logger lager.Logg var err error logger = logger.Session("actual-lrp-group-by-process-guid-and-index").WithTraceInfo(req) - request := &models.ActualLRPGroupByProcessGuidAndIndexRequest{} + var request *models.ActualLRPGroupByProcessGuidAndIndexRequest + protoRequest := &models.ProtoActualLRPGroupByProcessGuidAndIndexRequest{} response := &models.ActualLRPGroupResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { writeResponse(w, response.ToProto()) }() - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { response.Error = models.ConvertError(err) return diff --git a/handlers/actual_lrp_handlers_test.go b/handlers/actual_lrp_handlers_test.go index 1999fc6b..4af98269 100644 --- a/handlers/actual_lrp_handlers_test.go +++ b/handlers/actual_lrp_handlers_test.go @@ -14,6 +14,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" + "google.golang.org/protobuf/proto" ) var _ = Describe("ActualLRP Handlers", func() { @@ -34,12 +35,12 @@ var _ = Describe("ActualLRP Handlers", func() { BeforeEach(func() { actualLRP1 = models.ActualLRP{ - ActualLRPKey: models.NewActualLRPKey( + ActualLrpKey: models.NewActualLRPKey( "process-guid-0", 1, "domain-0", ), - ActualLRPInstanceKey: models.NewActualLRPInstanceKey( + ActualLrpInstanceKey: models.NewActualLRPInstanceKey( "instance-guid-0", "cell-id-0", ), @@ -48,12 +49,12 @@ var _ = Describe("ActualLRP Handlers", func() { } actualLRP2 = models.ActualLRP{ - ActualLRPKey: models.NewActualLRPKey( + ActualLrpKey: models.NewActualLRPKey( "process-guid-1", 2, "domain-1", ), - ActualLRPInstanceKey: models.NewActualLRPInstanceKey( + ActualLrpInstanceKey: models.NewActualLRPInstanceKey( "instance-guid-1", "cell-id-1", ), @@ -65,7 +66,7 @@ var _ = Describe("ActualLRP Handlers", func() { evacuatingLRP2.Presence = models.ActualLRP_Evacuating evacuatingLRP2.State = models.ActualLRPStateRunning evacuatingLRP2.Since = 3417 - evacuatingLRP2.ActualLRPInstanceKey = models.NewActualLRPInstanceKey( + evacuatingLRP2.ActualLrpInstanceKey = models.NewActualLRPInstanceKey( "instance-guid-1", "cell-id-0", ) @@ -83,7 +84,7 @@ var _ = Describe("ActualLRP Handlers", func() { var requestBody interface{} BeforeEach(func() { - requestBody = &models.ActualLRPsRequest{} + requestBody = &models.ProtoActualLRPsRequest{} }) JustBeforeEach(func() { @@ -102,12 +103,12 @@ var _ = Describe("ActualLRP Handlers", func() { actualLRP1.State = models.ActualLRPStateUnclaimed suspectLRP1 = models.ActualLRP{ - ActualLRPKey: models.NewActualLRPKey( + ActualLrpKey: models.NewActualLRPKey( "process-guid-0", 1, "domain-0", ), - ActualLRPInstanceKey: models.NewActualLRPInstanceKey( + ActualLrpInstanceKey: models.NewActualLRPInstanceKey( "instance-guid-0", "cell-id-2", ), @@ -124,8 +125,10 @@ var _ = Describe("ActualLRP Handlers", func() { It("returns a list of actual lrps", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.ActualLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPsResponse + var protoResponse models.ProtoActualLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -142,7 +145,7 @@ var _ = Describe("ActualLRP Handlers", func() { Context("and filtering by domain", func() { BeforeEach(func() { - requestBody = &models.ActualLRPsRequest{Domain: "domain-1"} + requestBody = &models.ProtoActualLRPsRequest{Domain: "domain-1"} }) It("calls the DB with the domain filter to retrieve the actual lrps", func() { @@ -154,7 +157,7 @@ var _ = Describe("ActualLRP Handlers", func() { Context("and filtering by cellId", func() { BeforeEach(func() { - requestBody = &models.ActualLRPsRequest{CellId: "cellid-1"} + requestBody = &models.ProtoActualLRPsRequest{CellId: "cellid-1"} }) It("calls the DB with the cell id filter to retrieve the actual lrps ", func() { @@ -166,7 +169,7 @@ var _ = Describe("ActualLRP Handlers", func() { Context("and filtering by processGuid", func() { BeforeEach(func() { - requestBody = &models.ActualLRPsRequest{ProcessGuid: "process-guid-1"} + requestBody = &models.ProtoActualLRPsRequest{ProcessGuid: "process-guid-1"} }) It("calls the DB with the process guid filter to retrieve the actual lrps", func() { @@ -179,8 +182,9 @@ var _ = Describe("ActualLRP Handlers", func() { Context("and filtering by instance index", func() { BeforeEach(func() { req := &models.ActualLRPsRequest{} - req.SetIndex(1) - requestBody = req + index := int32(1) + req.SetIndex(&index) + requestBody = req.ToProto() }) It("calls the DB with the index filter to retrieve the actual lrps", func() { @@ -198,8 +202,9 @@ var _ = Describe("ActualLRP Handlers", func() { CellId: "cellid-1", ProcessGuid: "process-guid-0", } - req.SetIndex(2) - requestBody = req + index := int32(2) + req.SetIndex(&index) + requestBody = req.ToProto() }) It("call the DB with all provided filters to retrieve the actual lrps", func() { @@ -221,8 +226,10 @@ var _ = Describe("ActualLRP Handlers", func() { It("returns an empty list", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.ActualLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPsResponse + var protoResponse models.ProtoActualLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -249,8 +256,10 @@ var _ = Describe("ActualLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.ActualLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPsResponse + var protoResponse models.ProtoActualLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -259,7 +268,8 @@ var _ = Describe("ActualLRP Handlers", func() { }) Describe("ActualLRPGroups", func() { - var requestBody interface{} + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var requestBody *models.ActualLRPGroupsRequest BeforeEach(func() { //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method @@ -267,7 +277,8 @@ var _ = Describe("ActualLRP Handlers", func() { }) JustBeforeEach(func() { - request := newTestRequest(requestBody) + protoRequestBody := requestBody.ToProto() + request := newTestRequest(protoRequestBody) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.ActualLRPGroups(logger, responseRecorder, request) }) @@ -297,8 +308,11 @@ var _ = Describe("ActualLRP Handlers", func() { It("returns a list of actual lrp groups", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method - response := models.ActualLRPGroupsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPGroupsResponse + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var protoResponse models.ProtoActualLRPGroupsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -362,8 +376,11 @@ var _ = Describe("ActualLRP Handlers", func() { It("returns an empty list", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method - response := &models.ActualLRPGroupsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPGroupsResponse + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var protoResponse models.ProtoActualLRPGroupsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -391,8 +408,11 @@ var _ = Describe("ActualLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method - response := &models.ActualLRPGroupsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPGroupsResponse + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var protoResponse models.ProtoActualLRPGroupsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -408,7 +428,7 @@ var _ = Describe("ActualLRP Handlers", func() { BeforeEach(func() { //lint:ignore SA1019 - deprecated model used for testing deprecated functionality - requestBody = &models.ActualLRPGroupsByProcessGuidRequest{ + requestBody = &models.ProtoActualLRPGroupsByProcessGuidRequest{ ProcessGuid: processGuid, } }) @@ -452,8 +472,11 @@ var _ = Describe("ActualLRP Handlers", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method - response := &models.ActualLRPGroupsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPGroupsResponse + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var protoResponse models.ProtoActualLRPGroupsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.ActualLrpGroups).To(Equal(actualLRPGroups)) @@ -469,8 +492,11 @@ var _ = Describe("ActualLRP Handlers", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method - response := &models.ActualLRPGroupsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPGroupsResponse + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var protoResponse models.ProtoActualLRPGroupsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.ActualLrpGroups).To(BeNil()) @@ -498,8 +524,11 @@ var _ = Describe("ActualLRP Handlers", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method - response := &models.ActualLRPGroupsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPGroupsResponse + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var protoResponse models.ProtoActualLRPGroupsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -517,7 +546,7 @@ var _ = Describe("ActualLRP Handlers", func() { BeforeEach(func() { //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method - requestBody = &models.ActualLRPGroupByProcessGuidAndIndexRequest{ + requestBody = &models.ProtoActualLRPGroupByProcessGuidAndIndexRequest{ ProcessGuid: processGuid, Index: index, } @@ -551,9 +580,12 @@ var _ = Describe("ActualLRP Handlers", func() { It("returns an actual lrp group", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - //lint:ignore SA1019 - deprecated model used for testing deprecated functionality - response := &models.ActualLRPGroupResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var response models.ActualLRPGroupResponse + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var protoResponse models.ProtoActualLRPGroupResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -569,9 +601,12 @@ var _ = Describe("ActualLRP Handlers", func() { }) It("returns both LRPs in the group", func() { - //lint:ignore SA1019 - deprecated model used for testing deprecated functionality - response := &models.ActualLRPGroupResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var response models.ActualLRPGroupResponse + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var protoResponse models.ProtoActualLRPGroupResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -587,9 +622,12 @@ var _ = Describe("ActualLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - //lint:ignore SA1019 - deprecated model used for testing deprecated functionality - response := &models.ActualLRPGroupResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var response models.ActualLRPGroupResponse + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var protoResponse models.ProtoActualLRPGroupResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrResourceNotFound)) @@ -615,9 +653,12 @@ var _ = Describe("ActualLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - //lint:ignore SA1019 - deprecated model used for testing deprecated functionality - response := &models.ActualLRPGroupResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var response models.ActualLRPGroupResponse + //lint:ignore SA1019 - calling deprecated model while unit testing deprecated method + var protoResponse models.ProtoActualLRPGroupResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) diff --git a/handlers/actual_lrp_lifecycle_handler.go b/handlers/actual_lrp_lifecycle_handler.go index f8d3defb..7b215f77 100644 --- a/handlers/actual_lrp_lifecycle_handler.go +++ b/handlers/actual_lrp_lifecycle_handler.go @@ -51,19 +51,21 @@ func (h *ActualLRPLifecycleHandler) ClaimActualLRP(logger lager.Logger, w http.R logger.Debug("starting") defer logger.Debug("complete") - request := &models.ClaimActualLRPRequest{} - response := &models.ActualLRPLifecycleResponse{} - defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) - - err = parseRequest(logger, req, request) + var request *models.ClaimActualLRPRequest + protoRequest := &models.ProtoClaimActualLRPRequest{} + protoResponse := &models.ProtoActualLRPLifecycleResponse{} + defer func() { exitIfUnrecoverable(logger, h.exitChan, protoResponse.Error.FromProto()) }() + defer writeResponse(w, protoResponse) + + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() return } err = h.controller.ClaimActualLRP(req.Context(), logger, request.ProcessGuid, request.Index, request.ActualLrpInstanceKey) - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() } func (h *ActualLRPLifecycleHandler) StartActualLRP(logger lager.Logger, w http.ResponseWriter, req *http.Request) { @@ -71,25 +73,27 @@ func (h *ActualLRPLifecycleHandler) StartActualLRP(logger lager.Logger, w http.R logger.Debug("starting") defer logger.Debug("complete") - request := &models.StartActualLRPRequest{} - response := &models.ActualLRPLifecycleResponse{} + var request *models.StartActualLRPRequest + protoRequest := &models.ProtoStartActualLRPRequest{} + protoResponse := &models.ProtoActualLRPLifecycleResponse{} - defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { exitIfUnrecoverable(logger, h.exitChan, protoResponse.Error.FromProto()) }() + defer writeResponse(w, protoResponse) - err := parseRequest(logger, req, request) + err := parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() return } routable := true if request.RoutableExists() { r := request.GetRoutable() - routable = r + routable = *r } err = h.controller.StartActualLRP(req.Context(), logger, request.ActualLrpKey, request.ActualLrpInstanceKey, request.ActualLrpNetInfo, request.ActualLrpInternalRoutes, request.MetricTags, routable, request.AvailabilityZone) - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() } func (h *ActualLRPLifecycleHandler) StartActualLRP_r0(logger lager.Logger, w http.ResponseWriter, req *http.Request) { @@ -97,25 +101,27 @@ func (h *ActualLRPLifecycleHandler) StartActualLRP_r0(logger lager.Logger, w htt logger.Debug("starting") defer logger.Debug("complete") - request := &models.StartActualLRPRequest{} - response := &models.ActualLRPLifecycleResponse{} + var request *models.StartActualLRPRequest + protoRequest := &models.ProtoStartActualLRPRequest{} + protoResponse := &models.ProtoActualLRPLifecycleResponse{} - defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { exitIfUnrecoverable(logger, h.exitChan, protoResponse.Error.FromProto()) }() + defer writeResponse(w, protoResponse) - err := parseRequest(logger, req, request) + err := parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() return } routable := true if request.RoutableExists() { r := request.GetRoutable() - routable = r + routable = *r } err = h.controller.StartActualLRP(req.Context(), logger, request.ActualLrpKey, request.ActualLrpInstanceKey, request.ActualLrpNetInfo, []*models.ActualLRPInternalRoute{}, nil, routable, request.AvailabilityZone) - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() } func (h *ActualLRPLifecycleHandler) CrashActualLRP(logger lager.Logger, w http.ResponseWriter, req *http.Request) { @@ -123,14 +129,16 @@ func (h *ActualLRPLifecycleHandler) CrashActualLRP(logger lager.Logger, w http.R logger.Debug("starting") defer logger.Debug("complete") - request := &models.CrashActualLRPRequest{} - response := &models.ActualLRPLifecycleResponse{} - defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + var request *models.CrashActualLRPRequest + protoRequest := &models.ProtoCrashActualLRPRequest{} + protoResponse := &models.ProtoActualLRPLifecycleResponse{} + defer func() { exitIfUnrecoverable(logger, h.exitChan, protoResponse.Error.FromProto()) }() + defer writeResponse(w, protoResponse) - err := parseRequest(logger, req, request) + err := parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() return } @@ -138,7 +146,7 @@ func (h *ActualLRPLifecycleHandler) CrashActualLRP(logger lager.Logger, w http.R actualLRPInstanceKey := request.ActualLrpInstanceKey err = h.controller.CrashActualLRP(req.Context(), logger, actualLRPKey, actualLRPInstanceKey, request.ErrorMessage) - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() } func (h *ActualLRPLifecycleHandler) FailActualLRP(logger lager.Logger, w http.ResponseWriter, req *http.Request) { @@ -147,20 +155,22 @@ func (h *ActualLRPLifecycleHandler) FailActualLRP(logger lager.Logger, w http.Re logger.Debug("starting") defer logger.Debug("complete") - request := &models.FailActualLRPRequest{} - response := &models.ActualLRPLifecycleResponse{} + var request *models.FailActualLRPRequest + protoRequest := &models.ProtoFailActualLRPRequest{} + protoResponse := &models.ProtoActualLRPLifecycleResponse{} - defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { exitIfUnrecoverable(logger, h.exitChan, protoResponse.Error.FromProto()) }() + defer writeResponse(w, protoResponse) - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() return } err = h.controller.FailActualLRP(req.Context(), logger, request.ActualLrpKey, request.ErrorMessage) - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() } func (h *ActualLRPLifecycleHandler) RemoveActualLRP(logger lager.Logger, w http.ResponseWriter, req *http.Request) { @@ -169,39 +179,44 @@ func (h *ActualLRPLifecycleHandler) RemoveActualLRP(logger lager.Logger, w http. logger.Debug("starting") defer logger.Debug("complete") - request := &models.RemoveActualLRPRequest{} - response := &models.ActualLRPLifecycleResponse{} + var request *models.RemoveActualLRPRequest + protoRequest := &models.ProtoRemoveActualLRPRequest{} + protoResponse := &models.ProtoActualLRPLifecycleResponse{} - defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { exitIfUnrecoverable(logger, h.exitChan, protoResponse.Error.FromProto()) }() + defer writeResponse(w, protoResponse) - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() return } err = h.controller.RemoveActualLRP(req.Context(), logger, request.ProcessGuid, request.Index, request.ActualLrpInstanceKey) - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() } func (h *ActualLRPLifecycleHandler) RetireActualLRP(logger lager.Logger, w http.ResponseWriter, req *http.Request) { logger = logger.Session("retire-actual-lrp").WithTraceInfo(req) logger.Debug("starting") defer logger.Debug("complete") - request := &models.RetireActualLRPRequest{} - response := &models.ActualLRPLifecycleResponse{} + + var request *models.RetireActualLRPRequest + protoRequest := &models.ProtoRetireActualLRPRequest{} + protoResponse := &models.ProtoActualLRPLifecycleResponse{} var err error - defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { exitIfUnrecoverable(logger, h.exitChan, protoResponse.Error.FromProto()) }() + defer writeResponse(w, protoResponse) - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() return } err = h.controller.RetireActualLRP(trace.ContextWithRequestId(req), logger, request.ActualLrpKey) - response.Error = models.ConvertError(err) + protoResponse.Error = models.ConvertError(err).ToProto() } diff --git a/handlers/actual_lrp_lifecycle_handler_test.go b/handlers/actual_lrp_lifecycle_handler_test.go index 2acd9942..da20b7bf 100644 --- a/handlers/actual_lrp_lifecycle_handler_test.go +++ b/handlers/actual_lrp_lifecycle_handler_test.go @@ -17,6 +17,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" + "google.golang.org/protobuf/proto" ) var _ = Describe("ActualLRP Lifecycle Handlers", func() { @@ -61,10 +62,10 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { "cell-id-0", ) requestBody = &instanceKey - requestBody = &models.ClaimActualLRPRequest{ + requestBody = &models.ProtoClaimActualLRPRequest{ ProcessGuid: processGuid, Index: index, - ActualLrpInstanceKey: &instanceKey, + ActualLrpInstanceKey: instanceKey.ToProto(), } }) @@ -89,8 +90,10 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { It("response with no error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.ActualLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPLifecycleResponse + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -116,8 +119,10 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.ActualLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPLifecycleResponse + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -160,11 +165,12 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { MetricTags: metricTags, AvailabilityZone: "some-availability-zone", } - requestBody.SetRoutable(true) + routable := true + requestBody.SetRoutable(&routable) }) JustBeforeEach(func() { - request := newTestRequest(&requestBody) + request := newTestRequest(requestBody.ToProto()) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.StartActualLRP(logger, responseRecorder, request) }) @@ -202,7 +208,8 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { Context("when routable is provided as false", func() { BeforeEach(func() { - requestBody.SetRoutable(false) + routable := false + requestBody.SetRoutable(&routable) }) It("sets it to false", func() { @@ -214,7 +221,8 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { Context("when routable is provided as true", func() { BeforeEach(func() { - requestBody.SetRoutable(true) + routable := true + requestBody.SetRoutable(&routable) }) It("sets it to true", func() { @@ -231,8 +239,10 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { It("responds with no error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.ActualLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPLifecycleResponse + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -258,8 +268,10 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.ActualLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPLifecycleResponse + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -302,11 +314,12 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { MetricTags: metricTags, AvailabilityZone: "some-zone", } - requestBody.SetRoutable(true) + routable := true + requestBody.SetRoutable(&routable) }) JustBeforeEach(func() { - request := newTestRequest(&requestBody) + request := newTestRequest(requestBody.ToProto()) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.StartActualLRP_r0(logger, responseRecorder, request) }) @@ -343,7 +356,8 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { Context("when routable is provided as false", func() { BeforeEach(func() { - requestBody.SetRoutable(false) + routable := false + requestBody.SetRoutable(&routable) }) It("sets it to false", func() { @@ -362,8 +376,10 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) Eventually(logger).Should(gbytes.Say("starting")) Eventually(logger).Should(gbytes.Say(b3RequestIdHeader)) - response := &models.ActualLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPLifecycleResponse + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -389,8 +405,10 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.ActualLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPLifecycleResponse + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -419,9 +437,9 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { ) instanceKey = models.NewActualLRPInstanceKey(instanceGuid, cellId) errorMessage = "something went wrong" - requestBody = &models.CrashActualLRPRequest{ - ActualLrpKey: &key, - ActualLrpInstanceKey: &instanceKey, + requestBody = &models.ProtoCrashActualLRPRequest{ + ActualLrpKey: key.ToProto(), + ActualLrpInstanceKey: instanceKey.ToProto(), ErrorMessage: errorMessage, } }) @@ -447,8 +465,10 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { It("response with no error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.ActualLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPLifecycleResponse + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -474,8 +494,10 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.ActualLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPLifecycleResponse + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -486,7 +508,6 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { Describe("RetireActualLRP", func() { var ( request *http.Request - response *models.ActualLRPLifecycleResponse processGuid = "process-guid" index = int32(1) @@ -502,8 +523,8 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { "domain-0", ) - requestBody = &models.RetireActualLRPRequest{ - ActualLrpKey: &key, + requestBody = &models.ProtoRetireActualLRPRequest{ + ActualLrpKey: key.ToProto(), } }) @@ -512,8 +533,8 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.RetireActualLRP(logger, responseRecorder, request) - response = &models.ActualLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) Expect(err).NotTo(HaveOccurred()) }) @@ -541,6 +562,12 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { }) It("returns an error and does not retry", func() { + Expect(responseRecorder.Code).To(Equal(http.StatusOK)) + var response models.ActualLRPLifecycleResponse + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() + Expect(err).NotTo(HaveOccurred()) Expect(response.Error.Message).To(Equal("could not find lrp")) }) }) @@ -565,8 +592,8 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { "domain-0", ) errorMessage = "something went wrong" - requestBody = &models.FailActualLRPRequest{ - ActualLrpKey: &key, + requestBody = &models.ProtoFailActualLRPRequest{ + ActualLrpKey: key.ToProto(), ErrorMessage: errorMessage, } }) @@ -592,8 +619,10 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { It("fails the actual lrp by process guid and index", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.ActualLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPLifecycleResponse + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -619,8 +648,10 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.ActualLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPLifecycleResponse + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -644,10 +675,10 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { "cell-id-0", ) - requestBody = &models.RemoveActualLRPRequest{ + requestBody = &models.ProtoRemoveActualLRPRequest{ ProcessGuid: processGuid, Index: index, - ActualLrpInstanceKey: &instanceKey, + ActualLrpInstanceKey: instanceKey.ToProto(), } }) @@ -672,10 +703,12 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { It("responds with no error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.ActualLRPLifecycleResponse{} - - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPLifecycleResponse + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) + Expect(response.Error).To(BeNil()) }) }) @@ -699,8 +732,10 @@ var _ = Describe("ActualLRP Lifecycle Handlers", func() { It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.ActualLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPLifecycleResponse + var protoResponse models.ProtoActualLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) diff --git a/handlers/cell_handlers.go b/handlers/cell_handlers.go index df2c13dd..f6297cae 100644 --- a/handlers/cell_handlers.go +++ b/handlers/cell_handlers.go @@ -31,6 +31,6 @@ func (h *CellHandler) Cells(logger lager.Logger, w http.ResponseWriter, req *htt } response.Cells = cells response.Error = models.ConvertError(err) - writeResponse(w, response) + writeResponse(w, response.ToProto()) exitIfUnrecoverable(logger, h.exitChan, response.Error) } diff --git a/handlers/cell_handlers_test.go b/handlers/cell_handlers_test.go index 7439197a..e9421db0 100644 --- a/handlers/cell_handlers_test.go +++ b/handlers/cell_handlers_test.go @@ -14,6 +14,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" + "google.golang.org/protobuf/proto" ) var _ = Describe("Cell Handlers", func() { @@ -89,8 +90,10 @@ var _ = Describe("Cell Handlers", func() { It("returns a list of cells", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.CellsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.CellsResponse + var protoResponse models.ProtoCellsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -106,8 +109,10 @@ var _ = Describe("Cell Handlers", func() { It("returns an empty list", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.CellsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.CellsResponse + var protoResponse models.ProtoCellsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -135,8 +140,10 @@ var _ = Describe("Cell Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.CellsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.CellsResponse + var protoResponse models.ProtoCellsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) diff --git a/handlers/context_test.go b/handlers/context_test.go index 48f7f71b..59158002 100644 --- a/handlers/context_test.go +++ b/handlers/context_test.go @@ -22,6 +22,7 @@ import ( "code.cloudfoundry.org/lager/v3/lagertest" "github.com/tedsuo/ifrit" ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2" + "google.golang.org/protobuf/proto" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -139,7 +140,7 @@ var _ = Describe("Context", func() { <-sleepStarting ctxWithCancel, cancelFn := context.WithCancel(context.Background()) - requestBody := &models.ActualLRPsRequest{} + requestBody := &models.ProtoActualLRPsRequest{} request := newTestRequest(requestBody).WithContext(ctxWithCancel) responseRecorder := httptest.NewRecorder() finishedRequest := make(chan struct{}, 1) @@ -148,8 +149,10 @@ var _ = Describe("Context", func() { defer GinkgoRecover() handler.ActualLRPs(logger, responseRecorder, request) - response := models.ActualLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.ActualLRPsResponse + var protoResponse models.ProtoActualLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(HaveOccurred()) diff --git a/handlers/desired_lrp_handlers.go b/handlers/desired_lrp_handlers.go index 4bd01a32..cc2aa777 100644 --- a/handlers/desired_lrp_handlers.go +++ b/handlers/desired_lrp_handlers.go @@ -70,10 +70,15 @@ func (h *DesiredLRPHandler) commonDesiredLRPs(logger lager.Logger, targetVersion var err error logger = logger.Session("desired-lrps").WithTraceInfo(req) - request := &models.DesiredLRPsRequest{} + var request *models.DesiredLRPsRequest + protoRequest := &models.ProtoDesiredLRPsRequest{} response := &models.DesiredLRPsResponse{} - err = parseRequest(logger, req, request) + defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() + defer func() { writeResponse(w, response.ToProto()) }() + + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err == nil { filter := models.DesiredLRPFilter{Domain: request.Domain, ProcessGuids: request.ProcessGuids} @@ -90,9 +95,6 @@ func (h *DesiredLRPHandler) commonDesiredLRPs(logger lager.Logger, targetVersion } response.Error = models.ConvertError(err) - writeResponse(w, response) - exitIfUnrecoverable(logger, h.exitChan, response.Error) - } func (h *DesiredLRPHandler) DesiredLRPs(logger lager.Logger, w http.ResponseWriter, req *http.Request) { @@ -107,10 +109,15 @@ func (h *DesiredLRPHandler) commonDesiredLRPByProcessGuid(logger lager.Logger, t var err error logger = logger.Session("desired-lrp-by-process-guid").WithTraceInfo(req) - request := &models.DesiredLRPByProcessGuidRequest{} + var request *models.DesiredLRPByProcessGuidRequest + protoRequest := &models.ProtoDesiredLRPByProcessGuidRequest{} response := &models.DesiredLRPResponse{} - err = parseRequest(logger, req, request) + defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() + defer func() { writeResponse(w, response.ToProto()) }() + + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err == nil { var desiredLRP *models.DesiredLRP desiredLRP, err = h.desiredLRPDB.DesiredLRPByProcessGuid(req.Context(), logger, request.ProcessGuid) @@ -121,9 +128,6 @@ func (h *DesiredLRPHandler) commonDesiredLRPByProcessGuid(logger lager.Logger, t } response.Error = models.ConvertError(err) - writeResponse(w, response) - exitIfUnrecoverable(logger, h.exitChan, response.Error) - } func (h *DesiredLRPHandler) DesiredLRPByProcessGuid(logger lager.Logger, w http.ResponseWriter, req *http.Request) { @@ -140,10 +144,15 @@ func (h *DesiredLRPHandler) DesiredLRPSchedulingInfos(logger lager.Logger, w htt logger.Debug("starting") defer logger.Debug("complete") - request := &models.DesiredLRPsRequest{} + var request *models.DesiredLRPsRequest + protoRequest := &models.ProtoDesiredLRPsRequest{} response := &models.DesiredLRPSchedulingInfosResponse{} - err = parseRequest(logger, req, request) + defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() + defer func() { writeResponse(w, response.ToProto()) }() + + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err == nil { filter := models.DesiredLRPFilter{ Domain: request.Domain, @@ -153,8 +162,6 @@ func (h *DesiredLRPHandler) DesiredLRPSchedulingInfos(logger lager.Logger, w htt } response.Error = models.ConvertError(err) - writeResponse(w, response) - exitIfUnrecoverable(logger, h.exitChan, response.Error) } func (h *DesiredLRPHandler) DesiredLRPSchedulingInfoByProcessGuid(logger lager.Logger, w http.ResponseWriter, req *http.Request) { @@ -163,17 +170,20 @@ func (h *DesiredLRPHandler) DesiredLRPSchedulingInfoByProcessGuid(logger lager.L logger.Debug("starting") defer logger.Debug("complete") - request := &models.DesiredLRPByProcessGuidRequest{} + var request *models.DesiredLRPByProcessGuidRequest + protoRequest := &models.ProtoDesiredLRPByProcessGuidRequest{} response := &models.DesiredLRPSchedulingInfoByProcessGuidResponse{} - err = parseRequest(logger, req, request) + defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() + defer func() { writeResponse(w, response.ToProto()) }() + + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err == nil { response.DesiredLrpSchedulingInfo, err = h.desiredLRPDB.DesiredLRPSchedulingInfoByProcessGuid(req.Context(), logger, request.ProcessGuid) } response.Error = models.ConvertError(err) - writeResponse(w, response) - exitIfUnrecoverable(logger, h.exitChan, response.Error) } func (h *DesiredLRPHandler) DesiredLRPRoutingInfos(logger lager.Logger, w http.ResponseWriter, req *http.Request) { @@ -182,10 +192,15 @@ func (h *DesiredLRPHandler) DesiredLRPRoutingInfos(logger lager.Logger, w http.R logger.Debug("starting") defer logger.Debug("complete") - request := &models.DesiredLRPsRequest{} + var request *models.DesiredLRPsRequest + protoRequest := &models.ProtoDesiredLRPsRequest{} response := &models.DesiredLRPsResponse{} - err = parseRequest(logger, req, request) + defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() + defer func() { writeResponse(w, response.ToProto()) }() + + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err == nil { filter := models.DesiredLRPFilter{ Domain: request.Domain, @@ -195,19 +210,19 @@ func (h *DesiredLRPHandler) DesiredLRPRoutingInfos(logger lager.Logger, w http.R } response.Error = models.ConvertError(err) - writeResponse(w, response) - exitIfUnrecoverable(logger, h.exitChan, response.Error) } func (h *DesiredLRPHandler) DesireDesiredLRP(logger lager.Logger, w http.ResponseWriter, req *http.Request) { logger = logger.Session("desire-lrp").WithTraceInfo(req) - request := &models.DesireLRPRequest{} + var request *models.DesireLRPRequest + protoRequest := &models.ProtoDesireLRPRequest{} response := &models.DesiredLRPLifecycleResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { writeResponse(w, response.ToProto()) }() - err := parseRequest(logger, req, request) + err := parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) response.Error = models.ConvertError(err) @@ -240,12 +255,14 @@ func (h *DesiredLRPHandler) DesireDesiredLRP(logger lager.Logger, w http.Respons func (h *DesiredLRPHandler) UpdateDesiredLRP(logger lager.Logger, w http.ResponseWriter, req *http.Request) { logger = logger.Session("update-desired-lrp").WithTraceInfo(req) - request := &models.UpdateDesiredLRPRequest{} + var request *models.UpdateDesiredLRPRequest + protoRequest := &models.ProtoUpdateDesiredLRPRequest{} response := &models.DesiredLRPLifecycleResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { writeResponse(w, response.ToProto()) }() - err := parseRequest(logger, req, request) + err := parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) response.Error = models.ConvertError(err) @@ -276,13 +293,13 @@ func (h *DesiredLRPHandler) UpdateDesiredLRP(logger lager.Logger, w http.Respons logger.Debug("updating-lrp-instances") previousInstanceCount := beforeDesiredLRP.Instances - requestedInstances := request.Update.GetInstances() - previousInstanceCount + requestedInstances := *request.Update.GetInstances() - previousInstanceCount logger = logger.WithData(lager.Data{"instances_delta": requestedInstances}) if requestedInstances > 0 { logger.Debug("increasing-the-instances") schedulingInfo := desiredLRP.DesiredLRPSchedulingInfo() - h.startInstanceRange(trace.ContextWithRequestId(req), logger, previousInstanceCount, request.Update.GetInstances(), &schedulingInfo) + h.startInstanceRange(trace.ContextWithRequestId(req), logger, previousInstanceCount, *request.Update.GetInstances(), &schedulingInfo) } if requestedInstances < 0 { @@ -305,12 +322,14 @@ func (h *DesiredLRPHandler) UpdateDesiredLRP(logger lager.Logger, w http.Respons func (h *DesiredLRPHandler) RemoveDesiredLRP(logger lager.Logger, w http.ResponseWriter, req *http.Request) { logger = logger.Session("remove-desired-lrp").WithTraceInfo(req) - request := &models.RemoveDesiredLRPRequest{} + var request *models.RemoveDesiredLRPRequest + protoRequest := &models.ProtoRemoveDesiredLRPRequest{} response := &models.DesiredLRPLifecycleResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { writeResponse(w, response.ToProto()) }() - err := parseRequest(logger, req, request) + err := parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { response.Error = models.ConvertError(err) return @@ -341,16 +360,16 @@ func (h *DesiredLRPHandler) startInstanceRange(ctx context.Context, logger lager keys := []*models.ActualLRPKey{} for actualIndex := lower; actualIndex < upper; actualIndex++ { - key := models.NewActualLRPKey(schedulingInfo.ProcessGuid, int32(actualIndex), schedulingInfo.Domain) + key := models.NewActualLRPKey(schedulingInfo.DesiredLrpKey.ProcessGuid, int32(actualIndex), schedulingInfo.DesiredLrpKey.Domain) keys = append(keys, &key) } createdIndices := h.createUnclaimedActualLRPs(ctx, logger, keys) start := auctioneer.NewLRPStartRequestFromSchedulingInfo(schedulingInfo, createdIndices...) - logger.Info("start-lrp-auction-request", lager.Data{"app_guid": schedulingInfo.ProcessGuid, "indices": createdIndices}) + logger.Info("start-lrp-auction-request", lager.Data{"app_guid": schedulingInfo.DesiredLrpKey.ProcessGuid, "indices": createdIndices}) err := h.auctioneerClient.RequestLRPAuctions(logger, trace.RequestIdFromContext(ctx), []*auctioneer.LRPStartRequest{&start}) - logger.Info("finished-lrp-auction-request", lager.Data{"app_guid": schedulingInfo.ProcessGuid, "indices": createdIndices}) + logger.Info("finished-lrp-auction-request", lager.Data{"app_guid": schedulingInfo.DesiredLrpKey.ProcessGuid, "indices": createdIndices}) if err != nil { logger.Error("failed-to-request-auction", err) } @@ -415,10 +434,10 @@ func (h *DesiredLRPHandler) stopInstancesFrom(ctx context.Context, logger lager. lrp := actualLRPs[i] if lrp.Presence != models.ActualLRP_Evacuating { - if lrp.Index >= int32(index) { + if lrp.ActualLrpKey.Index >= int32(index) { switch lrp.State { case models.ActualLRPStateUnclaimed, models.ActualLRPStateCrashed: - err = h.actualLRPDB.RemoveActualLRP(ctx, logger.Session("remove-actual"), lrp.ProcessGuid, lrp.Index, nil) + err = h.actualLRPDB.RemoveActualLRP(ctx, logger.Session("remove-actual"), lrp.ActualLrpKey.ProcessGuid, lrp.ActualLrpKey.Index, nil) if err != nil { logger.Error("failed-removing-lrp-instance", err) } else { @@ -427,7 +446,7 @@ func (h *DesiredLRPHandler) stopInstancesFrom(ctx context.Context, logger lager. go h.actualLRPInstanceHub.Emit(models.NewActualLRPInstanceRemovedEvent(lrp, trace.RequestIdFromContext(ctx))) } default: - cellPresence, err := h.serviceClient.CellById(logger, lrp.CellId) + cellPresence, err := h.serviceClient.CellById(logger, lrp.ActualLrpInstanceKey.CellId) if err != nil { logger.Error("failed-fetching-cell-presence", err) continue @@ -439,7 +458,7 @@ func (h *DesiredLRPHandler) stopInstancesFrom(ctx context.Context, logger lager. } logger.Debug("stopping-lrp-instance") go func() { - err := repClient.StopLRPInstance(logger, lrp.ActualLRPKey, lrp.ActualLRPInstanceKey) + err := repClient.StopLRPInstance(logger, lrp.ActualLrpKey, lrp.ActualLrpInstanceKey) if err != nil { logger.Error("failed-stopping-lrp-instance", err) } @@ -462,7 +481,7 @@ func (h *DesiredLRPHandler) updateInstances(ctx context.Context, logger lager.Lo lrp := actualLRPs[i] if lrp.Presence != models.ActualLRP_Evacuating && lrp.State != models.ActualLRPStateUnclaimed && lrp.State != models.ActualLRPStateCrashed { - cellPresence, err := h.serviceClient.CellById(logger, lrp.CellId) + cellPresence, err := h.serviceClient.CellById(logger, lrp.ActualLrpInstanceKey.CellId) if err != nil { logger.Error("failed-fetching-cell-presence", err) continue @@ -476,7 +495,7 @@ func (h *DesiredLRPHandler) updateInstances(ctx context.Context, logger lager.Lo var internalRoutes internalroutes.InternalRoutes if internalRoutesUpdated { - internalRoutes, err = internalroutes.InternalRoutesFromRoutingInfo(*update.Routes) + internalRoutes, err = internalroutes.InternalRoutesFromRoutingInfo(update.Routes) if err != nil { logger.Error("getting-internal-routes-failed", err) continue @@ -486,8 +505,8 @@ func (h *DesiredLRPHandler) updateInstances(ctx context.Context, logger lager.Lo var metricTags map[string]string if metricTagsUpdated { metricTags, err = models.ConvertMetricTags(update.MetricTags, map[models.MetricTagValue_DynamicValue]interface{}{ - models.MetricTagDynamicValueIndex: lrp.Index, - models.MetricTagDynamicValueInstanceGuid: lrp.InstanceGuid, + models.MetricTagValue_MetricTagDynamicValueIndex: lrp.ActualLrpKey.Index, + models.MetricTagValue_MetricTagDynamicValueInstanceGuid: lrp.ActualLrpInstanceKey.InstanceGuid, }) if err != nil { logger.Error("converting-metric-tags-failed", err) @@ -495,7 +514,7 @@ func (h *DesiredLRPHandler) updateInstances(ctx context.Context, logger lager.Lo } } - lrpUpdate := rep.NewLRPUpdate(lrp.ActualLRPInstanceKey.InstanceGuid, lrp.ActualLRPKey, internalRoutes, metricTags) + lrpUpdate := rep.NewLRPUpdate(lrp.ActualLrpInstanceKey.InstanceGuid, lrp.ActualLrpKey, internalRoutes, metricTags) go func() { err := repClient.UpdateLRPInstance(logger, lrpUpdate) if err != nil { diff --git a/handlers/desired_lrp_handlers_test.go b/handlers/desired_lrp_handlers_test.go index cae32410..84ee6d3e 100644 --- a/handlers/desired_lrp_handlers_test.go +++ b/handlers/desired_lrp_handlers_test.go @@ -27,6 +27,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" + "google.golang.org/protobuf/proto" ) var _ = Describe("DesiredLRP Handlers", func() { @@ -83,7 +84,7 @@ var _ = Describe("DesiredLRP Handlers", func() { }) Describe("DesiredLRPs_r2", func() { - var requestBody interface{} + var requestBody *models.DesiredLRPsRequest BeforeEach(func() { requestBody = &models.DesiredLRPsRequest{} @@ -92,7 +93,8 @@ var _ = Describe("DesiredLRP Handlers", func() { }) JustBeforeEach(func() { - request := newTestRequest(requestBody) + protoRequestBody := requestBody.ToProto() + request := newTestRequest(protoRequestBody) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.DesiredLRPs_r2(logger, responseRecorder, request) }) @@ -107,8 +109,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns a list of desired lrps", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPsResponse + var protoResponse models.ProtoDesiredLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -125,8 +129,8 @@ var _ = Describe("DesiredLRP Handlers", func() { BeforeEach(func() { desiredLRPsWithImageLayers := []*models.DesiredLRP{ - &models.DesiredLRP{ImageLayers: []*models.ImageLayer{{LayerType: models.LayerTypeExclusive}, {LayerType: models.LayerTypeShared}}}, - &models.DesiredLRP{ImageLayers: []*models.ImageLayer{{LayerType: models.LayerTypeExclusive}, {LayerType: models.LayerTypeShared}}}, + &models.DesiredLRP{ImageLayers: []*models.ImageLayer{{LayerType: models.ImageLayer_LayerTypeExclusive}, {LayerType: models.ImageLayer_LayerTypeShared}}}, + &models.DesiredLRP{ImageLayers: []*models.ImageLayer{{LayerType: models.ImageLayer_LayerTypeExclusive}, {LayerType: models.ImageLayer_LayerTypeShared}}}, } fakeDesiredLRPDB.DesiredLRPsReturns(desiredLRPsWithImageLayers, nil) @@ -138,8 +142,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns a list of desired lrps downgraded to convert image layers to cached dependencies and download actions", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPsResponse + var protoResponse models.ProtoDesiredLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -165,8 +171,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns desired lrps with populated metrics_guid", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPsResponse + var protoResponse models.ProtoDesiredLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -214,8 +222,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns an empty list", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPsResponse + var protoResponse models.ProtoDesiredLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -242,8 +252,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPsResponse + var protoResponse models.ProtoDesiredLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -252,16 +264,17 @@ var _ = Describe("DesiredLRP Handlers", func() { }) Describe("DesiredLRPs", func() { - var requestBody interface{} + var requestBody *models.DesiredLRPsRequest BeforeEach(func() { requestBody = &models.DesiredLRPsRequest{} - desiredLRP1 = models.DesiredLRP{ImageLayers: []*models.ImageLayer{{LayerType: models.LayerTypeExclusive}, {LayerType: models.LayerTypeShared}}} - desiredLRP2 = models.DesiredLRP{ImageLayers: []*models.ImageLayer{{LayerType: models.LayerTypeExclusive}, {LayerType: models.LayerTypeShared}}} + desiredLRP1 = models.DesiredLRP{ImageLayers: []*models.ImageLayer{{LayerType: models.ImageLayer_LayerTypeExclusive}, {LayerType: models.ImageLayer_LayerTypeShared}}} + desiredLRP2 = models.DesiredLRP{ImageLayers: []*models.ImageLayer{{LayerType: models.ImageLayer_LayerTypeExclusive}, {LayerType: models.ImageLayer_LayerTypeShared}}} }) JustBeforeEach(func() { - request := newTestRequest(requestBody) + protoRequestBody := requestBody.ToProto() + request := newTestRequest(protoRequestBody) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.DesiredLRPs(logger, responseRecorder, request) }) @@ -274,8 +287,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns a list of desired lrps", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPsResponse + var protoResponse models.ProtoDesiredLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -301,8 +316,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns desired lrps with populated metrics_guid", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPsResponse + var protoResponse models.ProtoDesiredLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -350,8 +367,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns an empty list", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPsResponse + var protoResponse models.ProtoDesiredLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -378,8 +397,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPsResponse + var protoResponse models.ProtoDesiredLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -391,7 +412,7 @@ var _ = Describe("DesiredLRP Handlers", func() { var ( processGuid = "process-guid" - requestBody interface{} + requestBody *models.DesiredLRPByProcessGuidRequest ) BeforeEach(func() { @@ -401,7 +422,8 @@ var _ = Describe("DesiredLRP Handlers", func() { }) JustBeforeEach(func() { - request := newTestRequest(requestBody) + protoRequestBody := requestBody.ToProto() + request := newTestRequest(protoRequestBody) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.DesiredLRPByProcessGuid_r2(logger, responseRecorder, request) }) @@ -420,8 +442,10 @@ var _ = Describe("DesiredLRP Handlers", func() { Expect(actualProcessGuid).To(Equal(processGuid)) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPResponse + var protoResponse models.ProtoDesiredLRPResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -435,7 +459,7 @@ var _ = Describe("DesiredLRP Handlers", func() { BeforeEach(func() { desiredLRP := &models.DesiredLRP{ ProcessGuid: processGuid, - ImageLayers: []*models.ImageLayer{{LayerType: models.LayerTypeExclusive}, {LayerType: models.LayerTypeShared}}, + ImageLayers: []*models.ImageLayer{{LayerType: models.ImageLayer_LayerTypeExclusive}, {LayerType: models.ImageLayer_LayerTypeShared}}, } fakeDesiredLRPDB.DesiredLRPByProcessGuidReturns(desiredLRP.Copy(), nil) @@ -444,8 +468,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns a list of desired lrps downgraded to convert image layers to cached dependencies and download actions", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPResponse + var protoResponse models.ProtoDesiredLRPResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -469,8 +495,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns desired lrps with populated metrics_guid", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPResponse + var protoResponse models.ProtoDesiredLRPResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -485,8 +513,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns a resource not found error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPResponse + var protoResponse models.ProtoDesiredLRPResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrResourceNotFound)) @@ -512,8 +542,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPResponse + var protoResponse models.ProtoDesiredLRPResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -525,7 +557,7 @@ var _ = Describe("DesiredLRP Handlers", func() { var ( processGuid = "process-guid" - requestBody interface{} + requestBody *models.DesiredLRPByProcessGuidRequest ) BeforeEach(func() { @@ -535,7 +567,8 @@ var _ = Describe("DesiredLRP Handlers", func() { }) JustBeforeEach(func() { - request := newTestRequest(requestBody) + protoRequestBody := requestBody.ToProto() + request := newTestRequest(protoRequestBody) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.DesiredLRPByProcessGuid(logger, responseRecorder, request) }) @@ -546,7 +579,7 @@ var _ = Describe("DesiredLRP Handlers", func() { BeforeEach(func() { desiredLRP = models.DesiredLRP{ ProcessGuid: processGuid, - ImageLayers: []*models.ImageLayer{{LayerType: models.LayerTypeExclusive}, {LayerType: models.LayerTypeShared}}, + ImageLayers: []*models.ImageLayer{{LayerType: models.ImageLayer_LayerTypeExclusive}, {LayerType: models.ImageLayer_LayerTypeShared}}, } fakeDesiredLRPDB.DesiredLRPByProcessGuidReturns(desiredLRP.Copy(), nil) }) @@ -557,8 +590,10 @@ var _ = Describe("DesiredLRP Handlers", func() { Expect(actualProcessGuid).To(Equal(processGuid)) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPResponse + var protoResponse models.ProtoDesiredLRPResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -580,8 +615,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns desired lrps with populated metrics_guid", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPResponse + var protoResponse models.ProtoDesiredLRPResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -596,8 +633,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns a resource not found error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPResponse + var protoResponse models.ProtoDesiredLRPResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrResourceNotFound)) @@ -623,8 +662,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPResponse + var protoResponse models.ProtoDesiredLRPResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -634,7 +675,7 @@ var _ = Describe("DesiredLRP Handlers", func() { Describe("DesiredLRPSchedulingInfos", func() { var ( - requestBody interface{} + requestBody *models.DesiredLRPsRequest schedulingInfo1 models.DesiredLRPSchedulingInfo schedulingInfo2 models.DesiredLRPSchedulingInfo ) @@ -646,7 +687,8 @@ var _ = Describe("DesiredLRP Handlers", func() { }) JustBeforeEach(func() { - request := newTestRequest(requestBody) + protoRequestBody := requestBody.ToProto() + request := newTestRequest(protoRequestBody) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.DesiredLRPSchedulingInfos(logger, responseRecorder, request) }) @@ -661,8 +703,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns a list of desired lrps", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPSchedulingInfosResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPSchedulingInfosResponse + var protoResponse models.ProtoDesiredLRPSchedulingInfosResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -709,8 +753,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns an empty list", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPSchedulingInfosResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPSchedulingInfosResponse + var protoResponse models.ProtoDesiredLRPSchedulingInfosResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -737,8 +783,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPSchedulingInfosResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPSchedulingInfosResponse + var protoResponse models.ProtoDesiredLRPSchedulingInfosResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -750,7 +798,7 @@ var _ = Describe("DesiredLRP Handlers", func() { var ( processGuid = "process-guid" - requestBody interface{} + requestBody *models.DesiredLRPByProcessGuidRequest ) BeforeEach(func() { @@ -760,7 +808,8 @@ var _ = Describe("DesiredLRP Handlers", func() { }) JustBeforeEach(func() { - request := newTestRequest(requestBody) + protoRequestBody := requestBody.ToProto() + request := newTestRequest(protoRequestBody) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.DesiredLRPSchedulingInfoByProcessGuid(logger, responseRecorder, request) }) @@ -787,12 +836,15 @@ var _ = Describe("DesiredLRP Handlers", func() { Expect(receivedProcessGuid).To(Equal(processGuid)) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPSchedulingInfoByProcessGuidResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) - Expect(err).ToNot(HaveOccurred()) + var response models.DesiredLRPSchedulingInfoByProcessGuidResponse + var protoResponse models.ProtoDesiredLRPSchedulingInfoByProcessGuidResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() + Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) responseSchedInfo := response.DesiredLrpSchedulingInfo + Expect(*responseSchedInfo).To(Equal(schedInfo)) Expect(*responseSchedInfo).To(DeepEqual(schedInfo)) }) }) @@ -804,9 +856,11 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns a resource not found error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPSchedulingInfoByProcessGuidResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) - Expect(err).ToNot(HaveOccurred()) + var response models.DesiredLRPSchedulingInfoByProcessGuidResponse + var protoResponse models.ProtoDesiredLRPSchedulingInfoByProcessGuidResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() + Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrResourceNotFound)) }) @@ -831,8 +885,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPSchedulingInfoByProcessGuidResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPSchedulingInfoByProcessGuidResponse + var protoResponse models.ProtoDesiredLRPSchedulingInfoByProcessGuidResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -842,7 +898,7 @@ var _ = Describe("DesiredLRP Handlers", func() { Describe("DesiredLRPRoutingInfos", func() { var ( - requestBody interface{} + requestBody *models.DesiredLRPsRequest routingInfo1 models.DesiredLRP routingInfo2 models.DesiredLRP ) @@ -854,7 +910,8 @@ var _ = Describe("DesiredLRP Handlers", func() { }) JustBeforeEach(func() { - request := newTestRequest(requestBody) + protoRequestBody := requestBody.ToProto() + request := newTestRequest(protoRequestBody) handler.DesiredLRPRoutingInfos(logger, responseRecorder, request) }) @@ -868,8 +925,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns a list of desired lrps", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPsResponse + var protoResponse models.ProtoDesiredLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -916,8 +975,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("returns an empty list", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPsResponse + var protoResponse models.ProtoDesiredLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -943,8 +1004,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPsResponse + var protoResponse models.ProtoDesiredLRPsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -956,7 +1019,7 @@ var _ = Describe("DesiredLRP Handlers", func() { var ( desiredLRP *models.DesiredLRP - requestBody interface{} + requestBody *models.DesireLRPRequest ) BeforeEach(func() { @@ -968,7 +1031,8 @@ var _ = Describe("DesiredLRP Handlers", func() { }) JustBeforeEach(func() { - request := newTestRequest(requestBody) + protoRequestBody := requestBody.ToProto() + request := newTestRequest(protoRequestBody) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.DesireDesiredLRP(logger, responseRecorder, request) }) @@ -1029,8 +1093,10 @@ var _ = Describe("DesiredLRP Handlers", func() { Expect(actualDesiredLRP).To(Equal(desiredLRP)) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPLifecycleResponse + var protoResponse models.ProtoDesiredLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -1178,8 +1244,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPLifecycleResponse + var protoResponse models.ProtoDesiredLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -1198,7 +1266,7 @@ var _ = Describe("DesiredLRP Handlers", func() { beforeDesiredLRP *models.DesiredLRP afterDesiredLRP *models.DesiredLRP - requestBody interface{} + requestBody *models.UpdateDesiredLRPRequest ) BeforeEach(func() { @@ -1210,7 +1278,7 @@ var _ = Describe("DesiredLRP Handlers", func() { afterDesiredLRP.Annotation = someText update = &models.DesiredLRPUpdate{} - update.SetAnnotation(someText) + update.SetAnnotation(&someText) }) JustBeforeEach(func() { @@ -1219,7 +1287,8 @@ var _ = Describe("DesiredLRP Handlers", func() { Update: update, } - request := newTestRequest(requestBody) + protoRequestBody := requestBody.ToProto() + request := newTestRequest(protoRequestBody) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.UpdateDesiredLRP(logger, responseRecorder, request) time.Sleep(100 * time.Millisecond) @@ -1260,8 +1329,10 @@ var _ = Describe("DesiredLRP Handlers", func() { Expect(actualUpdate).To(Equal(update)) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPLifecycleResponse + var protoResponse models.ProtoDesiredLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) }) @@ -1283,7 +1354,8 @@ var _ = Describe("DesiredLRP Handlers", func() { Context("when the number of instances changes", func() { BeforeEach(func() { - update.SetInstances(3) + instances := int32(3) + update.SetInstances(&instances) desiredLRP := &models.DesiredLRP{ ProcessGuid: "some-guid", @@ -1333,11 +1405,11 @@ var _ = Describe("DesiredLRP Handlers", func() { Expect(fakeRepClient.StopLRPInstanceCallCount()).To(Equal(2)) _, key0, instanceKey0 := fakeRepClient.StopLRPInstanceArgsForCall(0) _, key1, instanceKey1 := fakeRepClient.StopLRPInstanceArgsForCall(1) - Expect((key0 == actualLRPs[0].ActualLRPKey && key1 == actualLRPs[1].ActualLRPKey) || - (key1 == actualLRPs[0].ActualLRPKey && key0 == actualLRPs[1].ActualLRPKey)).To(BeTrue()) + Expect((key0 == actualLRPs[0].ActualLrpKey && key1 == actualLRPs[1].ActualLrpKey) || + (key1 == actualLRPs[0].ActualLrpKey && key0 == actualLRPs[1].ActualLrpKey)).To(BeTrue()) - Expect((instanceKey0 == actualLRPs[0].ActualLRPInstanceKey && instanceKey1 == actualLRPs[1].ActualLRPInstanceKey) || - (instanceKey1 == actualLRPs[0].ActualLRPInstanceKey && instanceKey0 == actualLRPs[1].ActualLRPInstanceKey)).To(BeTrue()) + Expect((instanceKey0 == actualLRPs[0].ActualLrpInstanceKey && instanceKey1 == actualLRPs[1].ActualLrpInstanceKey) || + (instanceKey1 == actualLRPs[0].ActualLrpInstanceKey && instanceKey0 == actualLRPs[1].ActualLrpInstanceKey)).To(BeTrue()) }) @@ -1365,8 +1437,10 @@ var _ = Describe("DesiredLRP Handlers", func() { }) It("should return the error", func() { - response := models.DesiredLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPLifecycleResponse + var protoResponse models.ProtoDesiredLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -1488,8 +1562,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("does not update the actual lrps", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPLifecycleResponse + var protoResponse models.ProtoDesiredLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -1505,8 +1581,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("does not update the actual lrps", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPLifecycleResponse + var protoResponse models.ProtoDesiredLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -1656,7 +1734,8 @@ var _ = Describe("DesiredLRP Handlers", func() { } update = &models.DesiredLRPUpdate{MetricTags: expectedTags} - update.SetAnnotation("new-annotation") + annotation := "new-annotation" + update.SetAnnotation(&annotation) requestBody = &models.UpdateDesiredLRPRequest{ ProcessGuid: processGuid, @@ -1671,8 +1750,10 @@ var _ = Describe("DesiredLRP Handlers", func() { Expect(actualUpdate).To(Equal(update)) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPLifecycleResponse + var protoResponse models.ProtoDesiredLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) }) @@ -1834,8 +1915,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPLifecycleResponse + var protoResponse models.ProtoDesiredLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -1847,7 +1930,7 @@ var _ = Describe("DesiredLRP Handlers", func() { var ( processGuid string - requestBody interface{} + requestBody *models.RemoveDesiredLRPRequest ) BeforeEach(func() { @@ -1859,7 +1942,8 @@ var _ = Describe("DesiredLRP Handlers", func() { }) JustBeforeEach(func() { - request := newTestRequest(requestBody) + protoRequestBody := requestBody.ToProto() + request := newTestRequest(protoRequestBody) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.RemoveDesiredLRP(logger, responseRecorder, request) time.Sleep(100 * time.Millisecond) @@ -1880,8 +1964,10 @@ var _ = Describe("DesiredLRP Handlers", func() { Expect(actualProcessGuid).To(Equal(processGuid)) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPLifecycleResponse + var protoResponse models.ProtoDesiredLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -1961,11 +2047,11 @@ var _ = Describe("DesiredLRP Handlers", func() { _, key0, instanceKey0 := fakeRepClient.StopLRPInstanceArgsForCall(0) _, key1, instanceKey1 := fakeRepClient.StopLRPInstanceArgsForCall(1) - Expect((key0 == runningActualLRP0.ActualLRPKey && key1 == evacuatingActualLRP1.ActualLRPKey) || - (key1 == runningActualLRP0.ActualLRPKey && key0 == evacuatingActualLRP1.ActualLRPKey)).To(BeTrue()) + Expect((key0 == runningActualLRP0.ActualLrpKey && key1 == evacuatingActualLRP1.ActualLrpKey) || + (key1 == runningActualLRP0.ActualLrpKey && key0 == evacuatingActualLRP1.ActualLrpKey)).To(BeTrue()) - Expect((instanceKey0 == runningActualLRP0.ActualLRPInstanceKey && instanceKey1 == evacuatingActualLRP1.ActualLRPInstanceKey) || - (instanceKey1 == runningActualLRP0.ActualLRPInstanceKey && instanceKey0 == evacuatingActualLRP1.ActualLRPInstanceKey)).To(BeTrue()) + Expect((instanceKey0 == runningActualLRP0.ActualLrpInstanceKey && instanceKey1 == evacuatingActualLRP1.ActualLrpInstanceKey) || + (instanceKey1 == runningActualLRP0.ActualLrpInstanceKey && instanceKey0 == evacuatingActualLRP1.ActualLrpInstanceKey)).To(BeTrue()) }) @@ -2034,8 +2120,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("logs the error but still succeeds", func() { Expect(fakeRepClientFactory.CreateClientCallCount()).To(Equal(0)) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPLifecycleResponse + var protoResponse models.ProtoDesiredLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -2065,8 +2153,10 @@ var _ = Describe("DesiredLRP Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.DesiredLRPLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DesiredLRPLifecycleResponse + var protoResponse models.ProtoDesiredLRPLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) diff --git a/handlers/domain_handlers.go b/handlers/domain_handlers.go index 6951e24d..2ca478d5 100644 --- a/handlers/domain_handlers.go +++ b/handlers/domain_handlers.go @@ -32,7 +32,7 @@ func (h *DomainHandler) Domains(logger lager.Logger, w http.ResponseWriter, req response := &models.DomainsResponse{} response.Domains, err = h.db.FreshDomains(req.Context(), logger) response.Error = models.ConvertError(err) - writeResponse(w, response) + writeResponse(w, response.ToProto()) exitIfUnrecoverable(logger, h.exitChan, response.Error) } @@ -40,15 +40,17 @@ func (h *DomainHandler) Upsert(logger lager.Logger, w http.ResponseWriter, req * var err error logger = logger.Session("upsert").WithTraceInfo(req) - request := &models.UpsertDomainRequest{} + var request *models.UpsertDomainRequest + protoRequest := &models.ProtoUpsertDomainRequest{} response := &models.UpsertDomainResponse{} - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err == nil { err = h.db.UpsertDomain(req.Context(), logger, request.Domain, request.Ttl) } response.Error = models.ConvertError(err) - writeResponse(w, response) + writeResponse(w, response.ToProto()) exitIfUnrecoverable(logger, h.exitChan, response.Error) } diff --git a/handlers/domain_handlers_test.go b/handlers/domain_handlers_test.go index 9957b247..6b482897 100644 --- a/handlers/domain_handlers_test.go +++ b/handlers/domain_handlers_test.go @@ -14,6 +14,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" + "google.golang.org/protobuf/proto" ) var _ = Describe("Domain Handlers", func() { @@ -49,7 +50,7 @@ var _ = Describe("Domain Handlers", func() { domain = "domain-to-add" ttl = 12345 - requestBody = &models.UpsertDomainRequest{ + requestBody = &models.ProtoUpsertDomainRequest{ Domain: domain, Ttl: ttl, } @@ -78,28 +79,32 @@ var _ = Describe("Domain Handlers", func() { }) It("responds with no error", func() { - var upsertDomainResponse models.UpsertDomainResponse - err := upsertDomainResponse.Unmarshal(responseRecorder.Body.Bytes()) + var response models.UpsertDomainResponse + var protoResponse models.ProtoUpsertDomainResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) - Expect(upsertDomainResponse.Error).To(BeNil()) + Expect(response.Error).To(BeNil()) }) }) Context("when the request is invalid", func() { BeforeEach(func() { - requestBody = &models.UpsertDomainRequest{} + requestBody = &models.ProtoUpsertDomainRequest{} }) It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - var upsertDomainResponse models.UpsertDomainResponse - err := upsertDomainResponse.Unmarshal(responseRecorder.Body.Bytes()) + var response models.UpsertDomainResponse + var protoResponse models.ProtoUpsertDomainResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) - Expect(upsertDomainResponse.Error).NotTo(BeNil()) - Expect(upsertDomainResponse.Error.Type).To(Equal(models.Error_InvalidRequest)) + Expect(response.Error).NotTo(BeNil()) + Expect(response.Error.Type).To(Equal(models.Error_InvalidRequest)) }) }) @@ -111,12 +116,14 @@ var _ = Describe("Domain Handlers", func() { It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - var upsertDomainResponse models.UpsertDomainResponse - err := upsertDomainResponse.Unmarshal(responseRecorder.Body.Bytes()) + var response models.UpsertDomainResponse + var protoResponse models.ProtoUpsertDomainResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) - Expect(upsertDomainResponse.Error).NotTo(BeNil()) - Expect(upsertDomainResponse.Error).To(Equal(models.ErrBadRequest)) + Expect(response.Error).NotTo(BeNil()) + Expect(response.Error).To(Equal(models.ErrBadRequest)) }) }) @@ -140,12 +147,14 @@ var _ = Describe("Domain Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - var upsertDomainResponse models.UpsertDomainResponse - err := upsertDomainResponse.Unmarshal(responseRecorder.Body.Bytes()) + var response models.UpsertDomainResponse + var protoResponse models.ProtoUpsertDomainResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) - Expect(upsertDomainResponse.Error).NotTo(BeNil()) - Expect(upsertDomainResponse.Error).To(Equal(models.ErrUnknownError)) + Expect(response.Error).NotTo(BeNil()) + Expect(response.Error).To(Equal(models.ErrUnknownError)) }) }) }) @@ -175,8 +184,10 @@ var _ = Describe("Domain Handlers", func() { It("returns a list of domains", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.DomainsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DomainsResponse + var protoResponse models.ProtoDomainsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -192,8 +203,10 @@ var _ = Describe("Domain Handlers", func() { It("returns an empty list", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.DomainsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DomainsResponse + var protoResponse models.ProtoDomainsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -221,8 +234,10 @@ var _ = Describe("Domain Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.DomainsResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.DomainsResponse + var protoResponse models.ProtoDomainsResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) diff --git a/handlers/evacuation_handler.go b/handlers/evacuation_handler.go index 03c9a928..1a407235 100644 --- a/handlers/evacuation_handler.go +++ b/handlers/evacuation_handler.go @@ -6,7 +6,7 @@ import ( "code.cloudfoundry.org/bbs/models" "code.cloudfoundry.org/lager/v3" - "github.com/gogo/protobuf/proto" + "google.golang.org/protobuf/proto" ) //counterfeiter:generate -o fake_controllers/fake_evacuation_controller.go . EvacuationController @@ -36,7 +36,6 @@ func NewEvacuationHandler( type MessageValidator interface { proto.Message Validate() error - Unmarshal(data []byte) error } func (h *EvacuationHandler) RemoveEvacuatingActualLRP(logger lager.Logger, w http.ResponseWriter, req *http.Request) { @@ -45,13 +44,15 @@ func (h *EvacuationHandler) RemoveEvacuatingActualLRP(logger lager.Logger, w htt logger.Info("started") defer logger.Info("completed") - request := &models.RemoveEvacuatingActualLRPRequest{} + var request *models.RemoveEvacuatingActualLRPRequest + protoRequest := &models.ProtoRemoveEvacuatingActualLRPRequest{} response := &models.RemoveEvacuatingActualLRPResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { writeResponse(w, response.ToProto()) }() - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { response.Error = models.ConvertError(err) return @@ -66,12 +67,14 @@ func (h *EvacuationHandler) EvacuateClaimedActualLRP(logger lager.Logger, w http logger.Info("started") defer logger.Info("completed") - request := &models.EvacuateClaimedActualLRPRequest{} + var request *models.EvacuateClaimedActualLRPRequest + protoRequest := &models.ProtoEvacuateClaimedActualLRPRequest{} response := &models.EvacuationResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { writeResponse(w, response.ToProto()) }() - err := parseRequest(logger, req, request) + err := parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) response.Error = models.ConvertError(err) @@ -89,12 +92,14 @@ func (h *EvacuationHandler) EvacuateCrashedActualLRP(logger lager.Logger, w http logger.Info("started") defer logger.Info("completed") - request := &models.EvacuateCrashedActualLRPRequest{} + var request *models.EvacuateCrashedActualLRPRequest + protoRequest := &models.ProtoEvacuateCrashedActualLRPRequest{} response := &models.EvacuationResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { writeResponse(w, response.ToProto()) }() - err := parseRequest(logger, req, request) + err := parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) response.Error = models.ConvertError(err) @@ -110,13 +115,15 @@ func (h *EvacuationHandler) commonEvacuateRunningActualLRP(logger lager.Logger, logger.Info("starting") defer logger.Info("completed") + var request *models.EvacuateRunningActualLRPRequest + protoRequest := &models.ProtoEvacuateRunningActualLRPRequest{} response := &models.EvacuationResponse{} response.KeepContainer = true defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { writeResponse(w, response.ToProto()) }() - request := &models.EvacuateRunningActualLRPRequest{} - err := parseRequest(logger, req, request) + err := parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { response.Error = models.ConvertError(err) return @@ -132,7 +139,7 @@ func (h *EvacuationHandler) commonEvacuateRunningActualLRP(logger lager.Logger, routable := true if request.RoutableExists() { r := request.GetRoutable() - routable = r + routable = *r } keepContainer, err = h.controller.EvacuateRunningActualLRP(req.Context(), logger, request.ActualLrpKey, request.ActualLrpInstanceKey, request.ActualLrpNetInfo, actualLrpInternalRoutes, metricTags, routable, request.AvailabilityZone) @@ -153,13 +160,15 @@ func (h *EvacuationHandler) EvacuateRunningActualLRP_r0(logger lager.Logger, w h func (h *EvacuationHandler) EvacuateStoppedActualLRP(logger lager.Logger, w http.ResponseWriter, req *http.Request) { logger = logger.Session("evacuate-stopped-actual-lrp").WithTraceInfo(req) - request := &models.EvacuateStoppedActualLRPRequest{} + var request *models.EvacuateStoppedActualLRPRequest + protoRequest := &models.ProtoEvacuateStoppedActualLRPRequest{} response := &models.EvacuationResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer writeResponse(w, response) + defer func() { writeResponse(w, response.ToProto()) }() - err := parseRequest(logger, req, request) + err := parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-to-parse-request", err) response.Error = models.ConvertError(err) diff --git a/handlers/evacuation_handler_test.go b/handlers/evacuation_handler_test.go index 49dab2a6..edc88304 100644 --- a/handlers/evacuation_handler_test.go +++ b/handlers/evacuation_handler_test.go @@ -15,6 +15,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" + "google.golang.org/protobuf/proto" ) var _ = Describe("Evacuation Handlers", func() { @@ -61,9 +62,9 @@ var _ = Describe("Evacuation Handlers", func() { ) BeforeEach(func() { - requestBody = &models.RemoveEvacuatingActualLRPRequest{ - ActualLrpKey: &key, - ActualLrpInstanceKey: &instanceKey, + requestBody = &models.ProtoRemoveEvacuatingActualLRPRequest{ + ActualLrpKey: key.ToProto(), + ActualLrpInstanceKey: instanceKey.ToProto(), } }) @@ -78,7 +79,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should respond without an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.RemoveEvacuatingActualLRPResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoRemoveEvacuatingActualLRPResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) }) @@ -93,7 +96,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return the error in the response", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.RemoveEvacuatingActualLRPResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoRemoveEvacuatingActualLRPResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).NotTo(BeNil()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -116,14 +121,16 @@ var _ = Describe("Evacuation Handlers", func() { Context("when the request is invalid", func() { BeforeEach(func() { - requestBody = &models.RemoveEvacuatingActualLRPRequest{} + requestBody = &models.ProtoRemoveEvacuatingActualLRPRequest{} }) It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.RemoveEvacuatingActualLRPResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoRemoveEvacuatingActualLRPResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).NotTo(BeNil()) @@ -140,7 +147,9 @@ var _ = Describe("Evacuation Handlers", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.RemoveEvacuatingActualLRPResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoRemoveEvacuatingActualLRPResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).NotTo(BeNil()) @@ -161,10 +170,10 @@ var _ = Describe("Evacuation Handlers", func() { JustBeforeEach(func() { actual = model_helpers.NewValidActualLRP("process-guid", 1) requestBody = &models.EvacuateClaimedActualLRPRequest{ - ActualLrpKey: &actual.ActualLRPKey, - ActualLrpInstanceKey: &actual.ActualLRPInstanceKey, + ActualLrpKey: &actual.ActualLrpKey, + ActualLrpInstanceKey: &actual.ActualLrpInstanceKey, } - request = newTestRequest(requestBody) + request = newTestRequest(requestBody.ToProto()) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.EvacuateClaimedActualLRP(logger, responseRecorder, request) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) @@ -179,7 +188,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return no error and keep the container", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) Expect(response.KeepContainer).To(BeFalse()) @@ -194,7 +205,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return no error and keep the container", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) Expect(response.KeepContainer).To(BeTrue()) @@ -211,7 +224,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return the error in the response", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).NotTo(BeNil()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -227,7 +242,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return the error in the response", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).NotTo(BeNil()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -258,8 +275,10 @@ var _ = Describe("Evacuation Handlers", func() { }) It("returns an error and keeps the container", func() { - response := models.EvacuationResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.EvacuationResponse + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.KeepContainer).To(BeTrue()) Expect(response.Error).NotTo(BeNil()) @@ -279,11 +298,11 @@ var _ = Describe("Evacuation Handlers", func() { JustBeforeEach(func() { actual = model_helpers.NewValidActualLRP("process-guid", 1) requestBody = &models.EvacuateCrashedActualLRPRequest{ - ActualLrpKey: &actual.ActualLRPKey, - ActualLrpInstanceKey: &actual.ActualLRPInstanceKey, + ActualLrpKey: &actual.ActualLrpKey, + ActualLrpInstanceKey: &actual.ActualLrpInstanceKey, ErrorMessage: "i failed", } - request = newTestRequest(requestBody) + request = newTestRequest(requestBody.ToProto()) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.EvacuateCrashedActualLRP(logger, responseRecorder, request) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) @@ -297,7 +316,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return no error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) Expect(response.KeepContainer).To(BeFalse()) @@ -313,7 +334,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return the error in the response", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).NotTo(BeNil()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -344,8 +367,10 @@ var _ = Describe("Evacuation Handlers", func() { }) It("returns an error and keeps the container", func() { - response := models.EvacuationResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.EvacuationResponse + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).NotTo(BeNil()) Expect(response.Error).To(Equal(models.ErrBadRequest)) @@ -364,11 +389,11 @@ var _ = Describe("Evacuation Handlers", func() { JustBeforeEach(func() { actual = model_helpers.NewValidActualLRP("process-guid", 1) requestBody = &models.EvacuateRunningActualLRPRequest{ - ActualLrpKey: &actual.ActualLRPKey, - ActualLrpInstanceKey: &actual.ActualLRPInstanceKey, - ActualLrpNetInfo: &actual.ActualLRPNetInfo, + ActualLrpKey: &actual.ActualLrpKey, + ActualLrpInstanceKey: &actual.ActualLrpInstanceKey, + ActualLrpNetInfo: &actual.ActualLrpNetInfo, } - request = newTestRequest(requestBody) + request = newTestRequest(requestBody.ToProto()) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.EvacuateRunningActualLRP_r0(logger, responseRecorder, request) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) @@ -383,7 +408,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return no error and keep the container", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) Expect(response.KeepContainer).To(BeFalse()) @@ -398,7 +425,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return no error and keep the container", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) Expect(response.KeepContainer).To(BeTrue()) @@ -415,7 +444,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return the error in the response", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).NotTo(BeNil()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -431,7 +462,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return the error in the response", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).NotTo(BeNil()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -462,8 +495,10 @@ var _ = Describe("Evacuation Handlers", func() { }) It("returns an error and keeps the container", func() { - response := models.EvacuationResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.EvacuationResponse + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.KeepContainer).To(BeTrue()) Expect(response.Error).NotTo(BeNil()) @@ -483,9 +518,9 @@ var _ = Describe("Evacuation Handlers", func() { BeforeEach(func() { actual = model_helpers.NewValidActualLRP("process-guid", 1) requestBody = &models.EvacuateRunningActualLRPRequest{ - ActualLrpKey: &actual.ActualLRPKey, - ActualLrpInstanceKey: &actual.ActualLRPInstanceKey, - ActualLrpNetInfo: &actual.ActualLRPNetInfo, + ActualLrpKey: &actual.ActualLrpKey, + ActualLrpInstanceKey: &actual.ActualLrpInstanceKey, + ActualLrpNetInfo: &actual.ActualLrpNetInfo, ActualLrpInternalRoutes: actual.ActualLrpInternalRoutes, MetricTags: actual.MetricTags, AvailabilityZone: actual.AvailabilityZone, @@ -493,7 +528,7 @@ var _ = Describe("Evacuation Handlers", func() { }) JustBeforeEach(func() { - request = newTestRequest(requestBody) + request = newTestRequest(requestBody.ToProto()) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.EvacuateRunningActualLRP(logger, responseRecorder, request) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) @@ -502,9 +537,9 @@ var _ = Describe("Evacuation Handlers", func() { It("calls the controller", func() { Expect(controller.EvacuateRunningActualLRPCallCount()).To(Equal(1)) _, _, actualKey, actualInstanceKey, actualNetInfo, actualInternalRoutes, actualMetricTags, routable, availabilityZone := controller.EvacuateRunningActualLRPArgsForCall(0) - Expect(actualKey).To(Equal(&actual.ActualLRPKey)) - Expect(actualInstanceKey).To(Equal(&actual.ActualLRPInstanceKey)) - Expect(actualNetInfo).To(Equal(&actual.ActualLRPNetInfo)) + Expect(actualKey).To(Equal(&actual.ActualLrpKey)) + Expect(actualInstanceKey).To(Equal(&actual.ActualLrpInstanceKey)) + Expect(actualNetInfo).To(Equal(&actual.ActualLrpNetInfo)) Expect(actualInternalRoutes).To(Equal(actual.ActualLrpInternalRoutes)) Expect(actualMetricTags).To(Equal(actual.MetricTags)) Expect(availabilityZone).To(Equal(actual.AvailabilityZone)) @@ -520,7 +555,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return no error and keep the container", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) Expect(response.KeepContainer).To(BeFalse()) @@ -535,7 +572,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return no error and keep the container", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) Expect(response.KeepContainer).To(BeTrue()) @@ -552,7 +591,8 @@ var _ = Describe("Evacuation Handlers", func() { Context("when routable is provided as false", func() { BeforeEach(func() { - requestBody.SetRoutable(false) + routable := false + requestBody.SetRoutable(&routable) }) It("sets it to false", func() { @@ -564,7 +604,8 @@ var _ = Describe("Evacuation Handlers", func() { Context("when routable is provided as true", func() { BeforeEach(func() { - requestBody.SetRoutable(true) + routable := true + requestBody.SetRoutable(&routable) }) It("sets it to false", func() { @@ -584,7 +625,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return the error in the response", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).NotTo(BeNil()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -600,7 +643,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return the error in the response", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).NotTo(BeNil()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -631,8 +676,10 @@ var _ = Describe("Evacuation Handlers", func() { }) It("returns an error and keeps the container", func() { - response := models.EvacuationResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.EvacuationResponse + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.KeepContainer).To(BeTrue()) Expect(response.Error).NotTo(BeNil()) @@ -652,10 +699,10 @@ var _ = Describe("Evacuation Handlers", func() { JustBeforeEach(func() { actual = model_helpers.NewValidActualLRP("process-guid", 1) requestBody = &models.EvacuateStoppedActualLRPRequest{ - ActualLrpKey: &actual.ActualLRPKey, - ActualLrpInstanceKey: &actual.ActualLRPInstanceKey, + ActualLrpKey: &actual.ActualLrpKey, + ActualLrpInstanceKey: &actual.ActualLrpInstanceKey, } - request = newTestRequest(requestBody) + request = newTestRequest(requestBody.ToProto()) request.Header.Set(lager.RequestIdHeader, requestIdHeader) handler.EvacuateStoppedActualLRP(logger, responseRecorder, request) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) @@ -669,7 +716,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return no error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) Expect(response.KeepContainer).To(BeFalse()) @@ -685,7 +734,9 @@ var _ = Describe("Evacuation Handlers", func() { It("should return the error in the response", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.EvacuationResponse - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).NotTo(BeNil()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -716,8 +767,10 @@ var _ = Describe("Evacuation Handlers", func() { }) It("returns an error and keeps the container", func() { - response := models.EvacuationResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.EvacuationResponse + var protoResponse models.ProtoEvacuationResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).NotTo(BeNil()) Expect(response.Error).To(Equal(models.ErrBadRequest)) diff --git a/handlers/events_handlers_r0.go b/handlers/events_handlers_r0.go index 98fca66f..858be616 100644 --- a/handlers/events_handlers_r0.go +++ b/handlers/events_handlers_r0.go @@ -11,8 +11,10 @@ import ( func (h *LRPGroupEventsHandler) commonSubscribe(logger lager.Logger, w http.ResponseWriter, req *http.Request, target format.Version) { logger = logger.Session("subscribe-r0").WithTraceInfo(req) - request := &models.EventsByCellId{} - err := parseRequest(logger, req, request) + var request *models.EventsByCellId + protoRequest := &models.ProtoEventsByCellId{} + err := parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) w.WriteHeader(http.StatusInternalServerError) @@ -86,8 +88,10 @@ func (h *LRPGroupEventsHandler) Subscribe_r1(logger lager.Logger, w http.Respons func (h *LRPInstanceEventHandler) commonSubscribe(logger lager.Logger, w http.ResponseWriter, req *http.Request, target format.Version) { logger = logger.Session("subscribe-r0").WithTraceInfo(req) - request := &models.EventsByCellId{} - err := parseRequest(logger, req, request) + var request *models.EventsByCellId + protoRequest := &models.ProtoEventsByCellId{} + err := parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) w.WriteHeader(http.StatusInternalServerError) @@ -205,7 +209,7 @@ func filterByCellID(cellID string, bbsEvent models.Event, err error) (bool, erro return false, resolveError } - if lrp.CellId != cellID { + if lrp.ActualLrpInstanceKey.CellId != cellID { return false, nil } @@ -221,7 +225,7 @@ func filterByCellID(cellID string, bbsEvent models.Event, err error) (bool, erro if afterResolveError != nil { return false, afterResolveError } - if afterLRP.CellId != cellID && beforeLRP.CellId != cellID { + if afterLRP.ActualLrpInstanceKey.CellId != cellID && beforeLRP.ActualLrpInstanceKey.CellId != cellID { return false, nil } @@ -232,12 +236,12 @@ func filterByCellID(cellID string, bbsEvent models.Event, err error) (bool, erro if resolveError != nil { return false, resolveError } - if lrp.CellId != cellID { + if lrp.ActualLrpInstanceKey.CellId != cellID { return false, nil } case *models.ActualLRPCrashedEvent: - if x.ActualLRPInstanceKey.CellId != cellID { + if x.ActualLrpInstanceKey.CellId != cellID { return false, nil } } @@ -249,23 +253,23 @@ func filterInstanceEventByCellID(cellID string, bbsEvent models.Event, err error switch x := bbsEvent.(type) { case *models.ActualLRPInstanceCreatedEvent: lrp := x.ActualLrp - if lrp.CellId != cellID { + if lrp.ActualLrpInstanceKey.CellId != cellID { return false } case *models.ActualLRPInstanceChangedEvent: - if x.CellId != cellID { + if x.ActualLrpInstanceKey.CellId != cellID { return false } case *models.ActualLRPInstanceRemovedEvent: lrp := x.ActualLrp - if lrp.CellId != cellID { + if lrp.ActualLrpInstanceKey.CellId != cellID { return false } case *models.ActualLRPCrashedEvent: - if x.ActualLRPInstanceKey.CellId != cellID { + if x.ActualLrpInstanceKey.CellId != cellID { return false } } diff --git a/handlers/events_handlers_test.go b/handlers/events_handlers_test.go index 9494b5bf..805e2a83 100644 --- a/handlers/events_handlers_test.go +++ b/handlers/events_handlers_test.go @@ -9,7 +9,6 @@ import ( "strings" "code.cloudfoundry.org/bbs/events" - "code.cloudfoundry.org/bbs/events/eventfakes" "code.cloudfoundry.org/bbs/format" "code.cloudfoundry.org/bbs/handlers" "code.cloudfoundry.org/bbs/models" @@ -21,6 +20,7 @@ import ( . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" "github.com/vito/go-sse/sse" + "google.golang.org/protobuf/proto" ) var _ = Describe("Event Handlers", func() { @@ -64,7 +64,7 @@ var _ = Describe("Event Handlers", func() { Expect(err).NotTo(HaveOccurred()) go func() { for { - hub.Emit(eventfakes.FakeEvent{Token: "A"}) + hub.Emit(&models.FakeEvent{Token: "A"}) } }() Eventually(eventStreamDone, 10).Should(BeClosed()) @@ -117,18 +117,23 @@ var _ = Describe("Event Handlers", func() { It("emits events from the hub to the connection", func() { reader := sse.NewReadCloser(response.Body) - hub.Emit(&eventfakes.FakeEvent{Token: "A"}) - encodedPayload := base64.StdEncoding.EncodeToString([]byte("A")) + fakeEvent := &models.FakeEvent{Token: "A"} + marshalledFakeEvent, _ := proto.Marshal(fakeEvent.ToProto()) + hub.Emit(fakeEvent) + encodedPayload := base64.StdEncoding.EncodeToString(marshalledFakeEvent) - Expect(reader.Next()).To(Equal(sse.Event{ + tokenA, _ := reader.Next() + Expect(tokenA).To(Equal(sse.Event{ ID: "0", Name: "fake", Data: []byte(encodedPayload), })) - hub.Emit(&eventfakes.FakeEvent{Token: "B"}) + fakeEvent = &models.FakeEvent{Token: "B"} + marshalledFakeEvent, _ = proto.Marshal(fakeEvent.ToProto()) + hub.Emit(fakeEvent) - encodedPayload = base64.StdEncoding.EncodeToString([]byte("B")) + encodedPayload = base64.StdEncoding.EncodeToString(marshalledFakeEvent) Expect(reader.Next()).To(Equal(sse.Event{ ID: "1", Name: "fake", @@ -144,8 +149,10 @@ var _ = Describe("Event Handlers", func() { It("detects closed clients on the server", func() { reader := sse.NewReadCloser(response.Body) - hub.Emit(&eventfakes.FakeEvent{Token: "A"}) - encodedPayload := base64.StdEncoding.EncodeToString([]byte("A")) + fakeEvent := &models.FakeEvent{Token: "A"} + marshalledFakeEvent, _ := proto.Marshal(fakeEvent.ToProto()) + hub.Emit(fakeEvent) + encodedPayload := base64.StdEncoding.EncodeToString(marshalledFakeEvent) Expect(reader.Next()).To(Equal(sse.Event{ ID: "0", @@ -161,7 +168,7 @@ var _ = Describe("Event Handlers", func() { Context("when the source provides an unmarshalable event", func() { It("closes the event stream to the client", func() { - hub.Emit(eventfakes.UnmarshalableEvent{Fn: func() {}}) + hub.Emit(&models.FakeEvent{Token: "\xc3\x28"}) // invalid UTF-8 reader := sse.NewReadCloser(response.Body) _, err := reader.Next() @@ -244,7 +251,7 @@ var _ = Describe("Event Handlers", func() { Context("when cell id is specified", func() { var ( reader *sse.ReadCloser - requestBody interface{} + requestBody *models.EventsByCellId cellId = "cell-id" eventSource events.EventSource eventsCh chan models.Event @@ -262,7 +269,8 @@ var _ = Describe("Event Handlers", func() { JustBeforeEach(func() { By("creating server") server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - request := newTestRequest(requestBody) + protoRequestBody := requestBody.ToProto() + request := newTestRequest(protoRequestBody) handler.Subscribe_r0(logger, w, request) })) @@ -902,7 +910,7 @@ var _ = Describe("Event Handlers", func() { downgradedTask = task.VersionDownTo(format.V3) Expect(downgradedTask).To(Equal(task)) - Expect(downgradedTask.ImageLayers).NotTo(BeNil()) + Expect(downgradedTask.TaskDefinition.ImageLayers).NotTo(BeNil()) }) JustBeforeEach(func() { diff --git a/handlers/handlers.go b/handlers/handlers.go index c7d63432..a7ac6988 100644 --- a/handlers/handlers.go +++ b/handlers/handlers.go @@ -19,8 +19,8 @@ import ( loggingclient "code.cloudfoundry.org/diego-logging-client" "code.cloudfoundry.org/lager/v3" "code.cloudfoundry.org/rep" - "github.com/gogo/protobuf/proto" "github.com/tedsuo/rata" + "google.golang.org/protobuf/proto" ) func New( @@ -172,7 +172,7 @@ func parseRequest(logger lager.Logger, req *http.Request, request MessageValidat return models.ErrUnknownError } - err = request.Unmarshal(data) + err = proto.Unmarshal(data, request) if err != nil { logger.Error("failed-to-parse-request-body", err) return models.ErrBadRequest diff --git a/handlers/handlers_suite_test.go b/handlers/handlers_suite_test.go index b346a92a..045f43a0 100644 --- a/handlers/handlers_suite_test.go +++ b/handlers/handlers_suite_test.go @@ -8,9 +8,9 @@ import ( "code.cloudfoundry.org/bbs/serviceclient/serviceclientfakes" "code.cloudfoundry.org/rep/repfakes" - "github.com/gogo/protobuf/proto" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" "testing" ) diff --git a/handlers/ping_handler.go b/handlers/ping_handler.go index e76f81f4..d2af401d 100644 --- a/handlers/ping_handler.go +++ b/handlers/ping_handler.go @@ -17,5 +17,5 @@ func NewPingHandler() *PingHandler { func (h *PingHandler) Ping(logger lager.Logger, w http.ResponseWriter, req *http.Request) { response := &models.PingResponse{} response.Available = true - writeResponse(w, response) + writeResponse(w, response.ToProto()) } diff --git a/handlers/task_handlers.go b/handlers/task_handlers.go index ccff42f4..5e991cf9 100644 --- a/handlers/task_handlers.go +++ b/handlers/task_handlers.go @@ -46,13 +46,15 @@ func (h *TaskHandler) commonTasks(logger lager.Logger, targetVersion format.Vers var err error logger = logger.Session("tasks").WithTraceInfo(req) - request := &models.TasksRequest{} + var request *models.TasksRequest + protoRequest := &models.ProtoTasksRequest{} response := &models.TasksResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer func() { writeResponse(w, response) }() + defer func() { writeResponse(w, response.ToProto()) }() - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) response.Error = models.ConvertError(err) @@ -81,13 +83,15 @@ func (h *TaskHandler) commonTaskByGuid(logger lager.Logger, targetVersion format var err error logger = logger.Session("task-by-guid").WithTraceInfo(req) - request := &models.TaskByGuidRequest{} + var request *models.TaskByGuidRequest + protoRequest := &models.ProtoTaskByGuidRequest{} response := &models.TaskResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer func() { writeResponse(w, response) }() + defer func() { writeResponse(w, response.ToProto()) }() - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) response.Error = models.ConvertError(err) @@ -116,13 +120,15 @@ func (h *TaskHandler) DesireTask(logger lager.Logger, w http.ResponseWriter, req var err error logger = logger.Session("desire-task").WithTraceInfo(req) - request := &models.DesireTaskRequest{} + var request *models.DesireTaskRequest + protoRequest := &models.ProtoDesireTaskRequest{} response := &models.TaskLifecycleResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer func() { writeResponse(w, response) }() + defer func() { writeResponse(w, response.ToProto()) }() - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) response.Error = models.ConvertError(err) @@ -137,13 +143,15 @@ func (h *TaskHandler) StartTask(logger lager.Logger, w http.ResponseWriter, req var err error logger = logger.Session("start-task").WithTraceInfo(req) - request := &models.StartTaskRequest{} + var request *models.StartTaskRequest + protoRequest := &models.ProtoStartTaskRequest{} response := &models.StartTaskResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer func() { writeResponse(w, response) }() + defer func() { writeResponse(w, response.ToProto()) }() - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) response.Error = models.ConvertError(err) @@ -157,13 +165,15 @@ func (h *TaskHandler) StartTask(logger lager.Logger, w http.ResponseWriter, req func (h *TaskHandler) CancelTask(logger lager.Logger, w http.ResponseWriter, req *http.Request) { logger = logger.Session("cancel-task").WithTraceInfo(req) - request := &models.TaskGuidRequest{} + var request *models.TaskGuidRequest + protoRequest := &models.ProtoTaskGuidRequest{} response := &models.TaskLifecycleResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer func() { writeResponse(w, response) }() + defer func() { writeResponse(w, response.ToProto()) }() - err := parseRequest(logger, req, request) + err := parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) response.Error = models.ConvertError(err) @@ -179,13 +189,15 @@ func (h *TaskHandler) FailTask(logger lager.Logger, w http.ResponseWriter, req * var err error logger = logger.Session("fail-task").WithTraceInfo(req) - request := &models.FailTaskRequest{} + var request *models.FailTaskRequest + protoRequest := &models.ProtoFailTaskRequest{} response := &models.TaskLifecycleResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer func() { writeResponse(w, response) }() + defer func() { writeResponse(w, response.ToProto()) }() - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) response.Error = models.ConvertError(err) @@ -200,13 +212,15 @@ func (h *TaskHandler) RejectTask(logger lager.Logger, w http.ResponseWriter, req var err error logger = logger.Session("reject-task").WithTraceInfo(req) - request := &models.RejectTaskRequest{} + var request *models.RejectTaskRequest + protoRequest := &models.ProtoRejectTaskRequest{} response := &models.TaskLifecycleResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer func() { writeResponse(w, response) }() + defer func() { writeResponse(w, response.ToProto()) }() - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) response.Error = models.ConvertError(err) @@ -221,13 +235,15 @@ func (h *TaskHandler) CompleteTask(logger lager.Logger, w http.ResponseWriter, r var err error logger = logger.Session("complete-task").WithTraceInfo(req) - request := &models.CompleteTaskRequest{} + var request *models.CompleteTaskRequest + protoRequest := &models.ProtoCompleteTaskRequest{} response := &models.TaskLifecycleResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer func() { writeResponse(w, response) }() + defer func() { writeResponse(w, response.ToProto()) }() - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { response.Error = models.ConvertError(err) logger.Error("failed-parsing-request", err) @@ -242,13 +258,15 @@ func (h *TaskHandler) ResolvingTask(logger lager.Logger, w http.ResponseWriter, var err error logger = logger.Session("resolving-task").WithTraceInfo(req) - request := &models.TaskGuidRequest{} + var request *models.TaskGuidRequest + protoRequest := &models.ProtoTaskGuidRequest{} response := &models.TaskLifecycleResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer func() { writeResponse(w, response) }() + defer func() { writeResponse(w, response.ToProto()) }() - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) response.Error = models.ConvertError(err) @@ -263,13 +281,15 @@ func (h *TaskHandler) DeleteTask(logger lager.Logger, w http.ResponseWriter, req var err error logger = logger.Session("delete-task").WithTraceInfo(req) - request := &models.TaskGuidRequest{} + var request *models.TaskGuidRequest + protoRequest := &models.ProtoTaskGuidRequest{} response := &models.TaskLifecycleResponse{} defer func() { exitIfUnrecoverable(logger, h.exitChan, response.Error) }() - defer func() { writeResponse(w, response) }() + defer func() { writeResponse(w, response.ToProto()) }() - err = parseRequest(logger, req, request) + err = parseRequest(logger, req, protoRequest) + request = protoRequest.FromProto() if err != nil { logger.Error("failed-parsing-request", err) response.Error = models.ConvertError(err) diff --git a/handlers/task_handlers_test.go b/handlers/task_handlers_test.go index 349c4107..3c8fd835 100644 --- a/handlers/task_handlers_test.go +++ b/handlers/task_handlers_test.go @@ -19,6 +19,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" + "google.golang.org/protobuf/proto" ) var _ = Describe("Task Handlers", func() { @@ -68,7 +69,7 @@ var _ = Describe("Task Handlers", func() { }) JustBeforeEach(func() { - requestBody = &models.TasksRequest{ + requestBody = &models.ProtoTasksRequest{ Domain: domain, CellId: cellId, } @@ -88,8 +89,10 @@ var _ = Describe("Task Handlers", func() { It("returns a list of tasks", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.TasksResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TasksResponse + var protoResponse models.ProtoTasksResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -109,8 +112,8 @@ var _ = Describe("Task Handlers", func() { BeforeEach(func() { tasksWithImageLayers := []*models.Task{ - &models.Task{TaskDefinition: &models.TaskDefinition{ImageLayers: []*models.ImageLayer{{LayerType: models.LayerTypeExclusive}, {LayerType: models.LayerTypeShared}}}}, - &models.Task{TaskDefinition: &models.TaskDefinition{ImageLayers: []*models.ImageLayer{{LayerType: models.LayerTypeExclusive}, {LayerType: models.LayerTypeShared}}}}, + &models.Task{TaskDefinition: &models.TaskDefinition{ImageLayers: []*models.ImageLayer{{LayerType: models.ImageLayer_LayerTypeExclusive}, {LayerType: models.ImageLayer_LayerTypeShared}}}}, + &models.Task{TaskDefinition: &models.TaskDefinition{ImageLayers: []*models.ImageLayer{{LayerType: models.ImageLayer_LayerTypeExclusive}, {LayerType: models.ImageLayer_LayerTypeShared}}}}, } controller.TasksReturns(tasksWithImageLayers, nil) @@ -122,8 +125,10 @@ var _ = Describe("Task Handlers", func() { It("returns a list of tasks downgraded to convert image layers to cached dependencies and download actions", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.TasksResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TasksResponse + var protoResponse models.ProtoTasksResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -177,8 +182,10 @@ var _ = Describe("Task Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.TasksResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TasksResponse + var protoResponse models.ProtoTasksResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -194,14 +201,14 @@ var _ = Describe("Task Handlers", func() { ) BeforeEach(func() { - task1 = models.Task{TaskDefinition: &models.TaskDefinition{ImageLayers: []*models.ImageLayer{{LayerType: models.LayerTypeExclusive}, {LayerType: models.LayerTypeShared}}}} - task2 = models.Task{TaskDefinition: &models.TaskDefinition{ImageLayers: []*models.ImageLayer{{LayerType: models.LayerTypeExclusive}, {LayerType: models.LayerTypeShared}}}} + task1 = models.Task{TaskDefinition: &models.TaskDefinition{ImageLayers: []*models.ImageLayer{{LayerType: models.ImageLayer_LayerTypeExclusive}, {LayerType: models.ImageLayer_LayerTypeShared}}}} + task2 = models.Task{TaskDefinition: &models.TaskDefinition{ImageLayers: []*models.ImageLayer{{LayerType: models.ImageLayer_LayerTypeExclusive}, {LayerType: models.ImageLayer_LayerTypeShared}}}} requestBody = &models.TasksRequest{} }) JustBeforeEach(func() { - requestBody = &models.TasksRequest{ + requestBody = &models.ProtoTasksRequest{ Domain: domain, CellId: cellId, } @@ -221,8 +228,10 @@ var _ = Describe("Task Handlers", func() { It("returns a list of tasks", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.TasksResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TasksResponse + var protoResponse models.ProtoTasksResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -283,8 +292,10 @@ var _ = Describe("Task Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.TasksResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TasksResponse + var protoResponse models.ProtoTasksResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -296,7 +307,7 @@ var _ = Describe("Task Handlers", func() { var taskGuid = "task-guid" BeforeEach(func() { - requestBody = &models.TaskByGuidRequest{ + requestBody = &models.ProtoTaskByGuidRequest{ TaskGuid: taskGuid, } }) @@ -326,8 +337,10 @@ var _ = Describe("Task Handlers", func() { It("returns the task", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.TaskResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskResponse + var protoResponse models.ProtoTaskResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -343,8 +356,8 @@ var _ = Describe("Task Handlers", func() { TaskGuid: taskGuid, TaskDefinition: &models.TaskDefinition{ ImageLayers: []*models.ImageLayer{ - {LayerType: models.LayerTypeExclusive}, - {LayerType: models.LayerTypeShared}, + {LayerType: models.ImageLayer_LayerTypeExclusive}, + {LayerType: models.ImageLayer_LayerTypeShared}, }, }, } @@ -355,12 +368,14 @@ var _ = Describe("Task Handlers", func() { It("returns a list of tasks downgraded to convert image layers to cached dependencies and download actions", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.TaskResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskResponse + var protoResponse models.ProtoTaskResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) - Expect(response.Task.ImageLayers).To(BeNil()) + Expect(response.Task.TaskDefinition.ImageLayers).To(BeNil()) Expect(response.Task).To(Equal(downgradedTask)) }) }) @@ -372,8 +387,10 @@ var _ = Describe("Task Handlers", func() { It("returns a resource not found error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.TaskResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskResponse + var protoResponse models.ProtoTaskResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrResourceNotFound)) @@ -399,8 +416,10 @@ var _ = Describe("Task Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.TaskResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskResponse + var protoResponse models.ProtoTaskResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -412,7 +431,7 @@ var _ = Describe("Task Handlers", func() { var taskGuid = "task-guid" BeforeEach(func() { - requestBody = &models.TaskByGuidRequest{ + requestBody = &models.ProtoTaskByGuidRequest{ TaskGuid: taskGuid, } }) @@ -431,8 +450,8 @@ var _ = Describe("Task Handlers", func() { TaskGuid: taskGuid, TaskDefinition: &models.TaskDefinition{ ImageLayers: []*models.ImageLayer{ - {LayerType: models.LayerTypeExclusive}, - {LayerType: models.LayerTypeShared}, + {LayerType: models.ImageLayer_LayerTypeExclusive}, + {LayerType: models.ImageLayer_LayerTypeShared}, }, }, } @@ -447,8 +466,10 @@ var _ = Describe("Task Handlers", func() { It("returns the task", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.TaskResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskResponse + var protoResponse models.ProtoTaskResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -463,8 +484,10 @@ var _ = Describe("Task Handlers", func() { It("returns a resource not found error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.TaskResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskResponse + var protoResponse models.ProtoTaskResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrResourceNotFound)) @@ -490,8 +513,10 @@ var _ = Describe("Task Handlers", func() { It("provides relevant error information", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := models.TaskResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskResponse + var protoResponse models.ProtoTaskResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -508,10 +533,10 @@ var _ = Describe("Task Handlers", func() { BeforeEach(func() { taskDef = model_helpers.NewValidTaskDefinition() - requestBody = &models.DesireTaskRequest{ + requestBody = &models.ProtoDesireTaskRequest{ TaskGuid: taskGuid, Domain: domain, - TaskDefinition: taskDef, + TaskDefinition: taskDef.ToProto(), } }) @@ -530,8 +555,10 @@ var _ = Describe("Task Handlers", func() { Expect(actualDomain).To(Equal(domain)) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.TaskLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskLifecycleResponse + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -557,8 +584,10 @@ var _ = Describe("Task Handlers", func() { It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.TaskLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskLifecycleResponse + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -571,7 +600,7 @@ var _ = Describe("Task Handlers", func() { var ctx context.Context BeforeEach(func() { - requestBody = &models.StartTaskRequest{ + requestBody = &models.ProtoStartTaskRequest{ TaskGuid: "task-guid", CellId: "cell-id", } @@ -600,8 +629,10 @@ var _ = Describe("Task Handlers", func() { It("responds with true", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.StartTaskResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.StartTaskResponse + var protoResponse models.ProtoStartTaskResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -616,8 +647,10 @@ var _ = Describe("Task Handlers", func() { It("responds with false", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.StartTaskResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.StartTaskResponse + var protoResponse models.ProtoStartTaskResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -644,8 +677,10 @@ var _ = Describe("Task Handlers", func() { It("bubbles up the underlying model error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.StartTaskResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.StartTaskResponse + var protoResponse models.ProtoStartTaskResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrResourceExists)) @@ -660,7 +695,7 @@ var _ = Describe("Task Handlers", func() { ) BeforeEach(func() { - requestBody = &models.TaskGuidRequest{ + requestBody = &models.ProtoTaskGuidRequest{ TaskGuid: "task-guid", } @@ -689,8 +724,10 @@ var _ = Describe("Task Handlers", func() { Expect(taskLogger.SessionName()).To(ContainSubstring("cancel-task")) Expect(taskGuid).To(Equal("task-guid")) - response := &models.TaskLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskLifecycleResponse + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -703,8 +740,10 @@ var _ = Describe("Task Handlers", func() { }) It("responds with an error", func() { - response := &models.TaskLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskLifecycleResponse + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -729,8 +768,10 @@ var _ = Describe("Task Handlers", func() { }) It("returns an BadRequest error", func() { - response := &models.TaskLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskLifecycleResponse + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrBadRequest)) @@ -751,7 +792,7 @@ var _ = Describe("Task Handlers", func() { controller.FailTaskReturns(nil) //lint:ignore SA1019 - testing deprecated code - requestBody = &models.FailTaskRequest{ + requestBody = &models.ProtoFailTaskRequest{ TaskGuid: taskGuid, FailureReason: failureReason, } @@ -770,8 +811,10 @@ var _ = Describe("Task Handlers", func() { Expect(actualFailureReason).To(Equal(failureReason)) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.TaskLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskLifecycleResponse + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -797,8 +840,10 @@ var _ = Describe("Task Handlers", func() { It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.TaskLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskLifecycleResponse + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -812,7 +857,7 @@ var _ = Describe("Task Handlers", func() { BeforeEach(func() { controller.RejectTaskReturns(nil) - requestBody = &models.RejectTaskRequest{ + requestBody = &models.ProtoRejectTaskRequest{ TaskGuid: taskGuid, RejectionReason: rejectionReason, } @@ -833,7 +878,10 @@ var _ = Describe("Task Handlers", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.TaskLifecycleResponse - Expect(response.Unmarshal(responseRecorder.Body.Bytes())).To(Succeed()) + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() + Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) }) }) @@ -859,7 +907,10 @@ var _ = Describe("Task Handlers", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) var response models.TaskLifecycleResponse - Expect(response.Unmarshal(responseRecorder.Body.Bytes())).To(Succeed()) + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() + Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) }) }) @@ -883,7 +934,7 @@ var _ = Describe("Task Handlers", func() { controller.CompleteTaskReturns(nil) - requestBody = &models.CompleteTaskRequest{ + requestBody = &models.ProtoCompleteTaskRequest{ TaskGuid: taskGuid, CellId: cellId, Failed: failed, @@ -909,8 +960,10 @@ var _ = Describe("Task Handlers", func() { Expect(actualResult).To(Equal(result)) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.TaskLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskLifecycleResponse + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -936,8 +989,10 @@ var _ = Describe("Task Handlers", func() { It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.TaskLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskLifecycleResponse + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -948,7 +1003,7 @@ var _ = Describe("Task Handlers", func() { Describe("ResolvingTask", func() { Context("when the resolving request is normal", func() { BeforeEach(func() { - requestBody = &models.TaskGuidRequest{ + requestBody = &models.ProtoTaskGuidRequest{ TaskGuid: "task-guid", } }) @@ -966,8 +1021,10 @@ var _ = Describe("Task Handlers", func() { Expect(taskGuid).To(Equal("task-guid")) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.TaskLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskLifecycleResponse + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -993,8 +1050,10 @@ var _ = Describe("Task Handlers", func() { It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.TaskLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskLifecycleResponse + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) @@ -1006,7 +1065,7 @@ var _ = Describe("Task Handlers", func() { Describe("DeleteTask", func() { Context("when the delete request is normal", func() { BeforeEach(func() { - requestBody = &models.TaskGuidRequest{ + requestBody = &models.ProtoTaskGuidRequest{ TaskGuid: "task-guid", } }) @@ -1023,8 +1082,10 @@ var _ = Describe("Task Handlers", func() { Expect(taskGuid).To(Equal("task-guid")) Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.TaskLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskLifecycleResponse + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) @@ -1050,8 +1111,10 @@ var _ = Describe("Task Handlers", func() { It("responds with an error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) - response := &models.TaskLifecycleResponse{} - err := response.Unmarshal(responseRecorder.Body.Bytes()) + var response models.TaskLifecycleResponse + var protoResponse models.ProtoTaskLifecycleResponse + err := proto.Unmarshal(responseRecorder.Body.Bytes(), &protoResponse) + response = *protoResponse.FromProto() Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(Equal(models.ErrUnknownError)) diff --git a/models/actions.go b/models/actions.go index 1c2a13c8..0a7e5d30 100644 --- a/models/actions.go +++ b/models/actions.go @@ -8,7 +8,7 @@ import ( "time" "code.cloudfoundry.org/bbs/format" - proto "github.com/gogo/protobuf/proto" + "google.golang.org/protobuf/proto" ) const ( @@ -28,7 +28,7 @@ var ErrInvalidActionType = errors.New("invalid action type") type ActionInterface interface { ActionType() string Validate() error - proto.Message + GetProto() proto.Message } func (a *Action) GetValue() interface{} { @@ -62,6 +62,37 @@ func (a *Action) GetValue() interface{} { return nil } +func (a *Action) GetProto() proto.Message { + if a.DownloadAction != nil { + return a.DownloadAction.ToProto() + } + if a.UploadAction != nil { + return a.UploadAction.ToProto() + } + if a.RunAction != nil { + return a.RunAction.ToProto() + } + if a.TimeoutAction != nil { + return a.TimeoutAction.ToProto() + } + if a.EmitProgressAction != nil { + return a.EmitProgressAction.ToProto() + } + if a.TryAction != nil { + return a.TryAction.ToProto() + } + if a.ParallelAction != nil { + return a.ParallelAction.ToProto() + } + if a.SerialAction != nil { + return a.SerialAction.ToProto() + } + if a.CodependentAction != nil { + return a.CodependentAction.ToProto() + } + return nil +} + func (a *Action) SetValue(value interface{}) bool { switch vt := value.(type) { case *DownloadAction: @@ -144,6 +175,10 @@ func (a DownloadAction) Validate() error { return nil } +func (a *DownloadAction) GetProto() proto.Message { + return a.ToProto() +} + func contains(array []string, element string) bool { for _, item := range array { if item == element { @@ -179,6 +214,10 @@ func (a UploadAction) Validate() error { return nil } +func (a *UploadAction) GetProto() proto.Message { + return a.ToProto() +} + func (a *RunAction) ActionType() string { return ActionTypeRun } @@ -201,6 +240,10 @@ func (a RunAction) Validate() error { return nil } +func (a *RunAction) GetProto() proto.Message { + return a.ToProto() +} + func (a *TimeoutAction) ActionType() string { return ActionTypeTimeout } @@ -228,6 +271,10 @@ func (a TimeoutAction) Validate() error { return nil } +func (a *TimeoutAction) GetProto() proto.Message { + return a.ToProto() +} + func (a *TryAction) ActionType() string { return ActionTypeTry } @@ -251,6 +298,10 @@ func (a TryAction) Validate() error { return nil } +func (a *TryAction) GetProto() proto.Message { + return a.ToProto() +} + func (*ParallelAction) Version() format.Version { return format.V0 } @@ -262,7 +313,8 @@ func (a *ParallelAction) ActionType() string { func (a ParallelAction) Validate() error { var validationError ValidationError - if len(a.Actions) == 0 { + //lint:ignore S1009 - preserve nil check + if a.Actions == nil || len(a.Actions) == 0 { validationError = validationError.Append(ErrInvalidField{"actions"}) } else { for index, action := range a.Actions { @@ -285,6 +337,10 @@ func (a ParallelAction) Validate() error { return nil } +func (a *ParallelAction) GetProto() proto.Message { + return a.ToProto() +} + func (a *CodependentAction) ActionType() string { return ActionTypeCodependent } @@ -292,7 +348,8 @@ func (a *CodependentAction) ActionType() string { func (a CodependentAction) Validate() error { var validationError ValidationError - if len(a.Actions) == 0 { + //lint:ignore S1009 - preserve nil check + if a.Actions == nil || len(a.Actions) == 0 { validationError = validationError.Append(ErrInvalidField{"actions"}) } else { for index, action := range a.Actions { @@ -315,13 +372,9 @@ func (a CodependentAction) Validate() error { return nil } -// func (*SerialAction) Version() format.Version { -// return format.V0 -// } - -// func (*SerialAction) MigrateFromVersion(v format.Version) error { -// return nil -// } +func (a *CodependentAction) GetProto() proto.Message { + return a.ToProto() +} func (a *SerialAction) ActionType() string { return ActionTypeSerial @@ -330,7 +383,8 @@ func (a *SerialAction) ActionType() string { func (a SerialAction) Validate() error { var validationError ValidationError - if len(a.Actions) == 0 { + //lint:ignore S1009 - preserve nil check + if a.Actions == nil || len(a.Actions) == 0 { validationError = validationError.Append(ErrInvalidField{"actions"}) } else { for index, action := range a.Actions { @@ -353,6 +407,10 @@ func (a SerialAction) Validate() error { return nil } +func (a *SerialAction) GetProto() proto.Message { + return a.ToProto() +} + func (a *EmitProgressAction) ActionType() string { return ActionTypeEmitProgress } @@ -376,6 +434,10 @@ func (a EmitProgressAction) Validate() error { return nil } +func (a *EmitProgressAction) GetProto() proto.Message { + return a.ToProto() +} + func EmitProgressFor(action ActionInterface, startMessage string, successMessage string, failureMessagePrefix string) *EmitProgressAction { return &EmitProgressAction{ Action: WrapAction(action), @@ -540,10 +602,10 @@ func (l *ResourceLimits) UnmarshalJSON(data []byte) error { } if limit.Nofile != nil { - l.SetNofile(*limit.Nofile) + l.SetNofile(limit.Nofile) } if limit.Nproc != nil { - l.SetNproc(*limit.Nproc) + l.SetNproc(limit.Nproc) } return nil @@ -553,40 +615,12 @@ func (l ResourceLimits) MarshalJSON() ([]byte, error) { var limit internalResourceLimits if l.NofileExists() { n := l.GetNofile() - limit.Nofile = &n + limit.Nofile = n } if l.NprocExists() { + n := l.GetNproc() - limit.Nproc = &n + limit.Nproc = n } return json.Marshal(limit) } - -func (l *ResourceLimits) SetNofile(nofile uint64) { - l.OptionalNofile = &ResourceLimits_Nofile{ - Nofile: nofile, - } -} - -func (m *ResourceLimits) GetNofilePtr() *uint64 { - if x, ok := m.GetOptionalNofile().(*ResourceLimits_Nofile); ok { - return &x.Nofile - } - return nil -} - -func (l *ResourceLimits) NofileExists() bool { - _, ok := l.GetOptionalNofile().(*ResourceLimits_Nofile) - return ok -} - -func (l *ResourceLimits) SetNproc(nproc uint64) { - l.OptionalNproc = &ResourceLimits_Nproc{ - Nproc: nproc, - } -} - -func (l *ResourceLimits) NprocExists() bool { - _, ok := l.GetOptionalNproc().(*ResourceLimits_Nproc) - return ok -} diff --git a/models/actions.pb.go b/models/actions.pb.go index 21ae6c5a..0a49fae7 100644 --- a/models/actions.pb.go +++ b/models/actions.pb.go @@ -1,5157 +1,1007 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: actions.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -type Action struct { +type ProtoAction struct { + state protoimpl.MessageState `protogen:"open.v1"` // Note: we only expect one of the following set of fields to be // set. Previously we used `option (gogoproto.onlyone) = true' but since this // is now deprecated and oneof introduces a lot of structural changes, we // deferred on switching to oneof for now until there is a good reason for it. // disadvantages of using multiple optionals as opposed to oneof are: // - less memory usage + // // disadvantages of using multiple optionals without onlyone: // - writing our own GetAction/SetAction methods + // // action oneof { - DownloadAction *DownloadAction `protobuf:"bytes,1,opt,name=download_action,json=downloadAction,proto3" json:"download,omitempty"` - UploadAction *UploadAction `protobuf:"bytes,2,opt,name=upload_action,json=uploadAction,proto3" json:"upload,omitempty"` - RunAction *RunAction `protobuf:"bytes,3,opt,name=run_action,json=runAction,proto3" json:"run,omitempty"` - TimeoutAction *TimeoutAction `protobuf:"bytes,4,opt,name=timeout_action,json=timeoutAction,proto3" json:"timeout,omitempty"` - EmitProgressAction *EmitProgressAction `protobuf:"bytes,5,opt,name=emit_progress_action,json=emitProgressAction,proto3" json:"emit_progress,omitempty"` - TryAction *TryAction `protobuf:"bytes,6,opt,name=try_action,json=tryAction,proto3" json:"try,omitempty"` - ParallelAction *ParallelAction `protobuf:"bytes,7,opt,name=parallel_action,json=parallelAction,proto3" json:"parallel,omitempty"` - SerialAction *SerialAction `protobuf:"bytes,8,opt,name=serial_action,json=serialAction,proto3" json:"serial,omitempty"` - CodependentAction *CodependentAction `protobuf:"bytes,9,opt,name=codependent_action,json=codependentAction,proto3" json:"codependent,omitempty"` + DownloadAction *ProtoDownloadAction `protobuf:"bytes,1,opt,name=download_action,json=download,proto3" json:"download_action,omitempty"` + UploadAction *ProtoUploadAction `protobuf:"bytes,2,opt,name=upload_action,json=upload,proto3" json:"upload_action,omitempty"` + RunAction *ProtoRunAction `protobuf:"bytes,3,opt,name=run_action,json=run,proto3" json:"run_action,omitempty"` + TimeoutAction *ProtoTimeoutAction `protobuf:"bytes,4,opt,name=timeout_action,json=timeout,proto3" json:"timeout_action,omitempty"` + EmitProgressAction *ProtoEmitProgressAction `protobuf:"bytes,5,opt,name=emit_progress_action,json=emit_progress,proto3" json:"emit_progress_action,omitempty"` + TryAction *ProtoTryAction `protobuf:"bytes,6,opt,name=try_action,json=try,proto3" json:"try_action,omitempty"` + ParallelAction *ProtoParallelAction `protobuf:"bytes,7,opt,name=parallel_action,json=parallel,proto3" json:"parallel_action,omitempty"` + SerialAction *ProtoSerialAction `protobuf:"bytes,8,opt,name=serial_action,json=serial,proto3" json:"serial_action,omitempty"` + CodependentAction *ProtoCodependentAction `protobuf:"bytes,9,opt,name=codependent_action,json=codependent,proto3" json:"codependent_action,omitempty"` // } + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *Action) Reset() { *m = Action{} } -func (*Action) ProtoMessage() {} -func (*Action) Descriptor() ([]byte, []int) { - return fileDescriptor_eeb49063df94c2b8, []int{0} +func (x *ProtoAction) Reset() { + *x = ProtoAction{} + mi := &file_actions_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Action) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoAction) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Action) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Action.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoAction) ProtoMessage() {} + +func (x *ProtoAction) ProtoReflect() protoreflect.Message { + mi := &file_actions_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *Action) XXX_Merge(src proto.Message) { - xxx_messageInfo_Action.Merge(m, src) -} -func (m *Action) XXX_Size() int { - return m.Size() -} -func (m *Action) XXX_DiscardUnknown() { - xxx_messageInfo_Action.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_Action proto.InternalMessageInfo +// Deprecated: Use ProtoAction.ProtoReflect.Descriptor instead. +func (*ProtoAction) Descriptor() ([]byte, []int) { + return file_actions_proto_rawDescGZIP(), []int{0} +} -func (m *Action) GetDownloadAction() *DownloadAction { - if m != nil { - return m.DownloadAction +func (x *ProtoAction) GetDownloadAction() *ProtoDownloadAction { + if x != nil { + return x.DownloadAction } return nil } -func (m *Action) GetUploadAction() *UploadAction { - if m != nil { - return m.UploadAction +func (x *ProtoAction) GetUploadAction() *ProtoUploadAction { + if x != nil { + return x.UploadAction } return nil } -func (m *Action) GetRunAction() *RunAction { - if m != nil { - return m.RunAction +func (x *ProtoAction) GetRunAction() *ProtoRunAction { + if x != nil { + return x.RunAction } return nil } -func (m *Action) GetTimeoutAction() *TimeoutAction { - if m != nil { - return m.TimeoutAction +func (x *ProtoAction) GetTimeoutAction() *ProtoTimeoutAction { + if x != nil { + return x.TimeoutAction } return nil } -func (m *Action) GetEmitProgressAction() *EmitProgressAction { - if m != nil { - return m.EmitProgressAction +func (x *ProtoAction) GetEmitProgressAction() *ProtoEmitProgressAction { + if x != nil { + return x.EmitProgressAction } return nil } -func (m *Action) GetTryAction() *TryAction { - if m != nil { - return m.TryAction +func (x *ProtoAction) GetTryAction() *ProtoTryAction { + if x != nil { + return x.TryAction } return nil } -func (m *Action) GetParallelAction() *ParallelAction { - if m != nil { - return m.ParallelAction +func (x *ProtoAction) GetParallelAction() *ProtoParallelAction { + if x != nil { + return x.ParallelAction } return nil } -func (m *Action) GetSerialAction() *SerialAction { - if m != nil { - return m.SerialAction +func (x *ProtoAction) GetSerialAction() *ProtoSerialAction { + if x != nil { + return x.SerialAction } return nil } -func (m *Action) GetCodependentAction() *CodependentAction { - if m != nil { - return m.CodependentAction +func (x *ProtoAction) GetCodependentAction() *ProtoCodependentAction { + if x != nil { + return x.CodependentAction } return nil } -type DownloadAction struct { - Artifact string `protobuf:"bytes,1,opt,name=artifact,proto3" json:"artifact,omitempty"` - From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from"` - To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to"` - CacheKey string `protobuf:"bytes,4,opt,name=cache_key,json=cacheKey,proto3" json:"cache_key"` - LogSource string `protobuf:"bytes,5,opt,name=log_source,json=logSource,proto3" json:"log_source,omitempty"` - User string `protobuf:"bytes,6,opt,name=user,proto3" json:"user"` - ChecksumAlgorithm string `protobuf:"bytes,7,opt,name=checksum_algorithm,json=checksumAlgorithm,proto3" json:"checksum_algorithm,omitempty"` - ChecksumValue string `protobuf:"bytes,8,opt,name=checksum_value,json=checksumValue,proto3" json:"checksum_value,omitempty"` +type ProtoDownloadAction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Artifact string `protobuf:"bytes,1,opt,name=artifact,proto3" json:"artifact,omitempty"` + From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` + To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` + CacheKey string `protobuf:"bytes,4,opt,name=cache_key,proto3" json:"cache_key,omitempty"` + LogSource string `protobuf:"bytes,5,opt,name=log_source,proto3" json:"log_source,omitempty"` + User string `protobuf:"bytes,6,opt,name=user,proto3" json:"user,omitempty"` + ChecksumAlgorithm string `protobuf:"bytes,7,opt,name=checksum_algorithm,proto3" json:"checksum_algorithm,omitempty"` + ChecksumValue string `protobuf:"bytes,8,opt,name=checksum_value,proto3" json:"checksum_value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DownloadAction) Reset() { *m = DownloadAction{} } -func (*DownloadAction) ProtoMessage() {} -func (*DownloadAction) Descriptor() ([]byte, []int) { - return fileDescriptor_eeb49063df94c2b8, []int{1} +func (x *ProtoDownloadAction) Reset() { + *x = ProtoDownloadAction{} + mi := &file_actions_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DownloadAction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoDownloadAction) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DownloadAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DownloadAction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoDownloadAction) ProtoMessage() {} + +func (x *ProtoDownloadAction) ProtoReflect() protoreflect.Message { + mi := &file_actions_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *DownloadAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_DownloadAction.Merge(m, src) -} -func (m *DownloadAction) XXX_Size() int { - return m.Size() -} -func (m *DownloadAction) XXX_DiscardUnknown() { - xxx_messageInfo_DownloadAction.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_DownloadAction proto.InternalMessageInfo +// Deprecated: Use ProtoDownloadAction.ProtoReflect.Descriptor instead. +func (*ProtoDownloadAction) Descriptor() ([]byte, []int) { + return file_actions_proto_rawDescGZIP(), []int{1} +} -func (m *DownloadAction) GetArtifact() string { - if m != nil { - return m.Artifact +func (x *ProtoDownloadAction) GetArtifact() string { + if x != nil { + return x.Artifact } return "" } -func (m *DownloadAction) GetFrom() string { - if m != nil { - return m.From +func (x *ProtoDownloadAction) GetFrom() string { + if x != nil { + return x.From } return "" } -func (m *DownloadAction) GetTo() string { - if m != nil { - return m.To +func (x *ProtoDownloadAction) GetTo() string { + if x != nil { + return x.To } return "" } -func (m *DownloadAction) GetCacheKey() string { - if m != nil { - return m.CacheKey +func (x *ProtoDownloadAction) GetCacheKey() string { + if x != nil { + return x.CacheKey } return "" } -func (m *DownloadAction) GetLogSource() string { - if m != nil { - return m.LogSource +func (x *ProtoDownloadAction) GetLogSource() string { + if x != nil { + return x.LogSource } return "" } -func (m *DownloadAction) GetUser() string { - if m != nil { - return m.User +func (x *ProtoDownloadAction) GetUser() string { + if x != nil { + return x.User } return "" } -func (m *DownloadAction) GetChecksumAlgorithm() string { - if m != nil { - return m.ChecksumAlgorithm +func (x *ProtoDownloadAction) GetChecksumAlgorithm() string { + if x != nil { + return x.ChecksumAlgorithm } return "" } -func (m *DownloadAction) GetChecksumValue() string { - if m != nil { - return m.ChecksumValue +func (x *ProtoDownloadAction) GetChecksumValue() string { + if x != nil { + return x.ChecksumValue } return "" } -type UploadAction struct { - Artifact string `protobuf:"bytes,1,opt,name=artifact,proto3" json:"artifact,omitempty"` - From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from"` - To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to"` - LogSource string `protobuf:"bytes,4,opt,name=log_source,json=logSource,proto3" json:"log_source,omitempty"` - User string `protobuf:"bytes,5,opt,name=user,proto3" json:"user"` +type ProtoUploadAction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Artifact string `protobuf:"bytes,1,opt,name=artifact,proto3" json:"artifact,omitempty"` + From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` + To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` + LogSource string `protobuf:"bytes,4,opt,name=log_source,proto3" json:"log_source,omitempty"` + User string `protobuf:"bytes,5,opt,name=user,proto3" json:"user,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *UploadAction) Reset() { *m = UploadAction{} } -func (*UploadAction) ProtoMessage() {} -func (*UploadAction) Descriptor() ([]byte, []int) { - return fileDescriptor_eeb49063df94c2b8, []int{2} +func (x *ProtoUploadAction) Reset() { + *x = ProtoUploadAction{} + mi := &file_actions_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *UploadAction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoUploadAction) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *UploadAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UploadAction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoUploadAction) ProtoMessage() {} + +func (x *ProtoUploadAction) ProtoReflect() protoreflect.Message { + mi := &file_actions_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *UploadAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_UploadAction.Merge(m, src) -} -func (m *UploadAction) XXX_Size() int { - return m.Size() -} -func (m *UploadAction) XXX_DiscardUnknown() { - xxx_messageInfo_UploadAction.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_UploadAction proto.InternalMessageInfo +// Deprecated: Use ProtoUploadAction.ProtoReflect.Descriptor instead. +func (*ProtoUploadAction) Descriptor() ([]byte, []int) { + return file_actions_proto_rawDescGZIP(), []int{2} +} -func (m *UploadAction) GetArtifact() string { - if m != nil { - return m.Artifact +func (x *ProtoUploadAction) GetArtifact() string { + if x != nil { + return x.Artifact } return "" } -func (m *UploadAction) GetFrom() string { - if m != nil { - return m.From +func (x *ProtoUploadAction) GetFrom() string { + if x != nil { + return x.From } return "" } -func (m *UploadAction) GetTo() string { - if m != nil { - return m.To +func (x *ProtoUploadAction) GetTo() string { + if x != nil { + return x.To } return "" } -func (m *UploadAction) GetLogSource() string { - if m != nil { - return m.LogSource +func (x *ProtoUploadAction) GetLogSource() string { + if x != nil { + return x.LogSource } return "" } -func (m *UploadAction) GetUser() string { - if m != nil { - return m.User +func (x *ProtoUploadAction) GetUser() string { + if x != nil { + return x.User } return "" } -type RunAction struct { - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path"` - Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"` - Dir string `protobuf:"bytes,3,opt,name=dir,proto3" json:"dir,omitempty"` - Env []*EnvironmentVariable `protobuf:"bytes,4,rep,name=env,proto3" json:"env,omitempty"` - ResourceLimits *ResourceLimits `protobuf:"bytes,5,opt,name=resource_limits,json=resourceLimits,proto3" json:"resource_limits,omitempty"` - User string `protobuf:"bytes,6,opt,name=user,proto3" json:"user"` - LogSource string `protobuf:"bytes,7,opt,name=log_source,json=logSource,proto3" json:"log_source,omitempty"` - SuppressLogOutput bool `protobuf:"varint,8,opt,name=suppress_log_output,json=suppressLogOutput,proto3" json:"suppress_log_output"` - VolumeMountedFiles []*File `protobuf:"bytes,9,rep,name=volume_mounted_files,json=volumeMountedFiles,proto3" json:"volume_mounted_files"` +type ProtoRunAction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"` + Dir string `protobuf:"bytes,3,opt,name=dir,proto3" json:"dir,omitempty"` + Env []*ProtoEnvironmentVariable `protobuf:"bytes,4,rep,name=env,proto3" json:"env,omitempty"` + ResourceLimits *ProtoResourceLimits `protobuf:"bytes,5,opt,name=resource_limits,proto3" json:"resource_limits,omitempty"` + User string `protobuf:"bytes,6,opt,name=user,proto3" json:"user,omitempty"` + LogSource string `protobuf:"bytes,7,opt,name=log_source,proto3" json:"log_source,omitempty"` + SuppressLogOutput bool `protobuf:"varint,8,opt,name=suppress_log_output,proto3" json:"suppress_log_output,omitempty"` + VolumeMountedFiles []*ProtoFile `protobuf:"bytes,9,rep,name=volume_mounted_files,proto3" json:"volume_mounted_files,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *RunAction) Reset() { *m = RunAction{} } -func (*RunAction) ProtoMessage() {} -func (*RunAction) Descriptor() ([]byte, []int) { - return fileDescriptor_eeb49063df94c2b8, []int{3} +func (x *ProtoRunAction) Reset() { + *x = ProtoRunAction{} + mi := &file_actions_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *RunAction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoRunAction) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *RunAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RunAction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoRunAction) ProtoMessage() {} + +func (x *ProtoRunAction) ProtoReflect() protoreflect.Message { + mi := &file_actions_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *RunAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_RunAction.Merge(m, src) -} -func (m *RunAction) XXX_Size() int { - return m.Size() -} -func (m *RunAction) XXX_DiscardUnknown() { - xxx_messageInfo_RunAction.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_RunAction proto.InternalMessageInfo +// Deprecated: Use ProtoRunAction.ProtoReflect.Descriptor instead. +func (*ProtoRunAction) Descriptor() ([]byte, []int) { + return file_actions_proto_rawDescGZIP(), []int{3} +} -func (m *RunAction) GetPath() string { - if m != nil { - return m.Path +func (x *ProtoRunAction) GetPath() string { + if x != nil { + return x.Path } return "" } -func (m *RunAction) GetArgs() []string { - if m != nil { - return m.Args +func (x *ProtoRunAction) GetArgs() []string { + if x != nil { + return x.Args } return nil } -func (m *RunAction) GetDir() string { - if m != nil { - return m.Dir +func (x *ProtoRunAction) GetDir() string { + if x != nil { + return x.Dir } return "" } -func (m *RunAction) GetEnv() []*EnvironmentVariable { - if m != nil { - return m.Env +func (x *ProtoRunAction) GetEnv() []*ProtoEnvironmentVariable { + if x != nil { + return x.Env } return nil } -func (m *RunAction) GetResourceLimits() *ResourceLimits { - if m != nil { - return m.ResourceLimits +func (x *ProtoRunAction) GetResourceLimits() *ProtoResourceLimits { + if x != nil { + return x.ResourceLimits } return nil } -func (m *RunAction) GetUser() string { - if m != nil { - return m.User +func (x *ProtoRunAction) GetUser() string { + if x != nil { + return x.User } return "" } -func (m *RunAction) GetLogSource() string { - if m != nil { - return m.LogSource +func (x *ProtoRunAction) GetLogSource() string { + if x != nil { + return x.LogSource } return "" } -func (m *RunAction) GetSuppressLogOutput() bool { - if m != nil { - return m.SuppressLogOutput +func (x *ProtoRunAction) GetSuppressLogOutput() bool { + if x != nil { + return x.SuppressLogOutput } return false } -func (m *RunAction) GetVolumeMountedFiles() []*File { - if m != nil { - return m.VolumeMountedFiles +func (x *ProtoRunAction) GetVolumeMountedFiles() []*ProtoFile { + if x != nil { + return x.VolumeMountedFiles } return nil } -type TimeoutAction struct { - Action *Action `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` - DeprecatedTimeoutNs int64 `protobuf:"varint,2,opt,name=deprecated_timeout_ns,json=deprecatedTimeoutNs,proto3" json:"timeout,omitempty"` // Deprecated: Do not use. - LogSource string `protobuf:"bytes,3,opt,name=log_source,json=logSource,proto3" json:"log_source,omitempty"` - TimeoutMs int64 `protobuf:"varint,4,opt,name=timeout_ms,json=timeoutMs,proto3" json:"timeout_ms"` +type ProtoTimeoutAction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Action *ProtoAction `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` + // Deprecated: Marked as deprecated in actions.proto. + DeprecatedTimeoutNs int64 `protobuf:"varint,2,opt,name=deprecated_timeout_ns,json=timeout,proto3" json:"deprecated_timeout_ns,omitempty"` + LogSource string `protobuf:"bytes,3,opt,name=log_source,proto3" json:"log_source,omitempty"` + TimeoutMs int64 `protobuf:"varint,4,opt,name=timeout_ms,proto3" json:"timeout_ms,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *TimeoutAction) Reset() { *m = TimeoutAction{} } -func (*TimeoutAction) ProtoMessage() {} -func (*TimeoutAction) Descriptor() ([]byte, []int) { - return fileDescriptor_eeb49063df94c2b8, []int{4} +func (x *ProtoTimeoutAction) Reset() { + *x = ProtoTimeoutAction{} + mi := &file_actions_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TimeoutAction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoTimeoutAction) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TimeoutAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TimeoutAction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoTimeoutAction) ProtoMessage() {} + +func (x *ProtoTimeoutAction) ProtoReflect() protoreflect.Message { + mi := &file_actions_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *TimeoutAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimeoutAction.Merge(m, src) -} -func (m *TimeoutAction) XXX_Size() int { - return m.Size() -} -func (m *TimeoutAction) XXX_DiscardUnknown() { - xxx_messageInfo_TimeoutAction.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_TimeoutAction proto.InternalMessageInfo +// Deprecated: Use ProtoTimeoutAction.ProtoReflect.Descriptor instead. +func (*ProtoTimeoutAction) Descriptor() ([]byte, []int) { + return file_actions_proto_rawDescGZIP(), []int{4} +} -func (m *TimeoutAction) GetAction() *Action { - if m != nil { - return m.Action +func (x *ProtoTimeoutAction) GetAction() *ProtoAction { + if x != nil { + return x.Action } return nil } -// Deprecated: Do not use. -func (m *TimeoutAction) GetDeprecatedTimeoutNs() int64 { - if m != nil { - return m.DeprecatedTimeoutNs +// Deprecated: Marked as deprecated in actions.proto. +func (x *ProtoTimeoutAction) GetDeprecatedTimeoutNs() int64 { + if x != nil { + return x.DeprecatedTimeoutNs } return 0 } -func (m *TimeoutAction) GetLogSource() string { - if m != nil { - return m.LogSource +func (x *ProtoTimeoutAction) GetLogSource() string { + if x != nil { + return x.LogSource } return "" } -func (m *TimeoutAction) GetTimeoutMs() int64 { - if m != nil { - return m.TimeoutMs +func (x *ProtoTimeoutAction) GetTimeoutMs() int64 { + if x != nil { + return x.TimeoutMs } return 0 } -type EmitProgressAction struct { - Action *Action `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` - StartMessage string `protobuf:"bytes,2,opt,name=start_message,json=startMessage,proto3" json:"start_message"` - SuccessMessage string `protobuf:"bytes,3,opt,name=success_message,json=successMessage,proto3" json:"success_message"` - FailureMessagePrefix string `protobuf:"bytes,4,opt,name=failure_message_prefix,json=failureMessagePrefix,proto3" json:"failure_message_prefix"` - LogSource string `protobuf:"bytes,5,opt,name=log_source,json=logSource,proto3" json:"log_source,omitempty"` +type ProtoEmitProgressAction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Action *ProtoAction `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` + StartMessage string `protobuf:"bytes,2,opt,name=start_message,proto3" json:"start_message,omitempty"` + SuccessMessage string `protobuf:"bytes,3,opt,name=success_message,proto3" json:"success_message,omitempty"` + FailureMessagePrefix string `protobuf:"bytes,4,opt,name=failure_message_prefix,proto3" json:"failure_message_prefix,omitempty"` + LogSource string `protobuf:"bytes,5,opt,name=log_source,proto3" json:"log_source,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *EmitProgressAction) Reset() { *m = EmitProgressAction{} } -func (*EmitProgressAction) ProtoMessage() {} -func (*EmitProgressAction) Descriptor() ([]byte, []int) { - return fileDescriptor_eeb49063df94c2b8, []int{5} +func (x *ProtoEmitProgressAction) Reset() { + *x = ProtoEmitProgressAction{} + mi := &file_actions_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *EmitProgressAction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoEmitProgressAction) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *EmitProgressAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EmitProgressAction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoEmitProgressAction) ProtoMessage() {} + +func (x *ProtoEmitProgressAction) ProtoReflect() protoreflect.Message { + mi := &file_actions_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *EmitProgressAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_EmitProgressAction.Merge(m, src) -} -func (m *EmitProgressAction) XXX_Size() int { - return m.Size() -} -func (m *EmitProgressAction) XXX_DiscardUnknown() { - xxx_messageInfo_EmitProgressAction.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_EmitProgressAction proto.InternalMessageInfo +// Deprecated: Use ProtoEmitProgressAction.ProtoReflect.Descriptor instead. +func (*ProtoEmitProgressAction) Descriptor() ([]byte, []int) { + return file_actions_proto_rawDescGZIP(), []int{5} +} -func (m *EmitProgressAction) GetAction() *Action { - if m != nil { - return m.Action +func (x *ProtoEmitProgressAction) GetAction() *ProtoAction { + if x != nil { + return x.Action } return nil } -func (m *EmitProgressAction) GetStartMessage() string { - if m != nil { - return m.StartMessage +func (x *ProtoEmitProgressAction) GetStartMessage() string { + if x != nil { + return x.StartMessage } return "" } -func (m *EmitProgressAction) GetSuccessMessage() string { - if m != nil { - return m.SuccessMessage +func (x *ProtoEmitProgressAction) GetSuccessMessage() string { + if x != nil { + return x.SuccessMessage } return "" } -func (m *EmitProgressAction) GetFailureMessagePrefix() string { - if m != nil { - return m.FailureMessagePrefix +func (x *ProtoEmitProgressAction) GetFailureMessagePrefix() string { + if x != nil { + return x.FailureMessagePrefix } return "" } -func (m *EmitProgressAction) GetLogSource() string { - if m != nil { - return m.LogSource +func (x *ProtoEmitProgressAction) GetLogSource() string { + if x != nil { + return x.LogSource } return "" } -type TryAction struct { - Action *Action `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` - LogSource string `protobuf:"bytes,2,opt,name=log_source,json=logSource,proto3" json:"log_source,omitempty"` -} - -func (m *TryAction) Reset() { *m = TryAction{} } -func (*TryAction) ProtoMessage() {} -func (*TryAction) Descriptor() ([]byte, []int) { - return fileDescriptor_eeb49063df94c2b8, []int{6} +type ProtoTryAction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Action *ProtoAction `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` + LogSource string `protobuf:"bytes,2,opt,name=log_source,proto3" json:"log_source,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *TryAction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TryAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TryAction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TryAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_TryAction.Merge(m, src) -} -func (m *TryAction) XXX_Size() int { - return m.Size() -} -func (m *TryAction) XXX_DiscardUnknown() { - xxx_messageInfo_TryAction.DiscardUnknown(m) -} - -var xxx_messageInfo_TryAction proto.InternalMessageInfo -func (m *TryAction) GetAction() *Action { - if m != nil { - return m.Action - } - return nil +func (x *ProtoTryAction) Reset() { + *x = ProtoTryAction{} + mi := &file_actions_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TryAction) GetLogSource() string { - if m != nil { - return m.LogSource - } - return "" +func (x *ProtoTryAction) String() string { + return protoimpl.X.MessageStringOf(x) } -type ParallelAction struct { - Actions []*Action `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` - LogSource string `protobuf:"bytes,2,opt,name=log_source,json=logSource,proto3" json:"log_source,omitempty"` -} +func (*ProtoTryAction) ProtoMessage() {} -func (m *ParallelAction) Reset() { *m = ParallelAction{} } -func (*ParallelAction) ProtoMessage() {} -func (*ParallelAction) Descriptor() ([]byte, []int) { - return fileDescriptor_eeb49063df94c2b8, []int{7} -} -func (m *ParallelAction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ParallelAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ParallelAction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoTryAction) ProtoReflect() protoreflect.Message { + mi := &file_actions_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ParallelAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParallelAction.Merge(m, src) -} -func (m *ParallelAction) XXX_Size() int { - return m.Size() -} -func (m *ParallelAction) XXX_DiscardUnknown() { - xxx_messageInfo_ParallelAction.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ParallelAction proto.InternalMessageInfo +// Deprecated: Use ProtoTryAction.ProtoReflect.Descriptor instead. +func (*ProtoTryAction) Descriptor() ([]byte, []int) { + return file_actions_proto_rawDescGZIP(), []int{6} +} -func (m *ParallelAction) GetActions() []*Action { - if m != nil { - return m.Actions +func (x *ProtoTryAction) GetAction() *ProtoAction { + if x != nil { + return x.Action } return nil } -func (m *ParallelAction) GetLogSource() string { - if m != nil { - return m.LogSource +func (x *ProtoTryAction) GetLogSource() string { + if x != nil { + return x.LogSource } return "" } -type SerialAction struct { - Actions []*Action `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` - LogSource string `protobuf:"bytes,2,opt,name=log_source,json=logSource,proto3" json:"log_source,omitempty"` -} - -func (m *SerialAction) Reset() { *m = SerialAction{} } -func (*SerialAction) ProtoMessage() {} -func (*SerialAction) Descriptor() ([]byte, []int) { - return fileDescriptor_eeb49063df94c2b8, []int{8} -} -func (m *SerialAction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SerialAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SerialAction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SerialAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_SerialAction.Merge(m, src) -} -func (m *SerialAction) XXX_Size() int { - return m.Size() -} -func (m *SerialAction) XXX_DiscardUnknown() { - xxx_messageInfo_SerialAction.DiscardUnknown(m) +type ProtoParallelAction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Actions []*ProtoAction `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` + LogSource string `protobuf:"bytes,2,opt,name=log_source,proto3" json:"log_source,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -var xxx_messageInfo_SerialAction proto.InternalMessageInfo - -func (m *SerialAction) GetActions() []*Action { - if m != nil { - return m.Actions - } - return nil +func (x *ProtoParallelAction) Reset() { + *x = ProtoParallelAction{} + mi := &file_actions_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *SerialAction) GetLogSource() string { - if m != nil { - return m.LogSource - } - return "" +func (x *ProtoParallelAction) String() string { + return protoimpl.X.MessageStringOf(x) } -type CodependentAction struct { - Actions []*Action `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` - LogSource string `protobuf:"bytes,2,opt,name=log_source,json=logSource,proto3" json:"log_source,omitempty"` -} +func (*ProtoParallelAction) ProtoMessage() {} -func (m *CodependentAction) Reset() { *m = CodependentAction{} } -func (*CodependentAction) ProtoMessage() {} -func (*CodependentAction) Descriptor() ([]byte, []int) { - return fileDescriptor_eeb49063df94c2b8, []int{9} -} -func (m *CodependentAction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CodependentAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CodependentAction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoParallelAction) ProtoReflect() protoreflect.Message { + mi := &file_actions_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *CodependentAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_CodependentAction.Merge(m, src) -} -func (m *CodependentAction) XXX_Size() int { - return m.Size() -} -func (m *CodependentAction) XXX_DiscardUnknown() { - xxx_messageInfo_CodependentAction.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_CodependentAction proto.InternalMessageInfo +// Deprecated: Use ProtoParallelAction.ProtoReflect.Descriptor instead. +func (*ProtoParallelAction) Descriptor() ([]byte, []int) { + return file_actions_proto_rawDescGZIP(), []int{7} +} -func (m *CodependentAction) GetActions() []*Action { - if m != nil { - return m.Actions +func (x *ProtoParallelAction) GetActions() []*ProtoAction { + if x != nil { + return x.Actions } return nil } -func (m *CodependentAction) GetLogSource() string { - if m != nil { - return m.LogSource +func (x *ProtoParallelAction) GetLogSource() string { + if x != nil { + return x.LogSource } return "" } -type ResourceLimits struct { - // Types that are valid to be assigned to OptionalNofile: - // - // *ResourceLimits_Nofile - OptionalNofile isResourceLimits_OptionalNofile `protobuf_oneof:"optional_nofile"` - // Types that are valid to be assigned to OptionalNproc: - // - // *ResourceLimits_Nproc - OptionalNproc isResourceLimits_OptionalNproc `protobuf_oneof:"optional_nproc"` -} - -func (m *ResourceLimits) Reset() { *m = ResourceLimits{} } -func (*ResourceLimits) ProtoMessage() {} -func (*ResourceLimits) Descriptor() ([]byte, []int) { - return fileDescriptor_eeb49063df94c2b8, []int{10} -} -func (m *ResourceLimits) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceLimits) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResourceLimits.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +type ProtoSerialAction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Actions []*ProtoAction `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` + LogSource string `protobuf:"bytes,2,opt,name=log_source,proto3" json:"log_source,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ResourceLimits) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceLimits.Merge(m, src) -} -func (m *ResourceLimits) XXX_Size() int { - return m.Size() -} -func (m *ResourceLimits) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceLimits.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceLimits proto.InternalMessageInfo -type isResourceLimits_OptionalNofile interface { - isResourceLimits_OptionalNofile() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int -} -type isResourceLimits_OptionalNproc interface { - isResourceLimits_OptionalNproc() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int +func (x *ProtoSerialAction) Reset() { + *x = ProtoSerialAction{} + mi := &file_actions_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -type ResourceLimits_Nofile struct { - Nofile uint64 `protobuf:"varint,1,opt,name=nofile,proto3,oneof" json:"nofile,omitempty"` -} -type ResourceLimits_Nproc struct { - Nproc uint64 `protobuf:"varint,2,opt,name=nproc,proto3,oneof" json:"nproc,omitempty"` +func (x *ProtoSerialAction) String() string { + return protoimpl.X.MessageStringOf(x) } -func (*ResourceLimits_Nofile) isResourceLimits_OptionalNofile() {} -func (*ResourceLimits_Nproc) isResourceLimits_OptionalNproc() {} +func (*ProtoSerialAction) ProtoMessage() {} -func (m *ResourceLimits) GetOptionalNofile() isResourceLimits_OptionalNofile { - if m != nil { - return m.OptionalNofile - } - return nil -} -func (m *ResourceLimits) GetOptionalNproc() isResourceLimits_OptionalNproc { - if m != nil { - return m.OptionalNproc +func (x *ProtoSerialAction) ProtoReflect() protoreflect.Message { + mi := &file_actions_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (m *ResourceLimits) GetNofile() uint64 { - if x, ok := m.GetOptionalNofile().(*ResourceLimits_Nofile); ok { - return x.Nofile - } - return 0 +// Deprecated: Use ProtoSerialAction.ProtoReflect.Descriptor instead. +func (*ProtoSerialAction) Descriptor() ([]byte, []int) { + return file_actions_proto_rawDescGZIP(), []int{8} } -// Deprecated: Do not use. -func (m *ResourceLimits) GetNproc() uint64 { - if x, ok := m.GetOptionalNproc().(*ResourceLimits_Nproc); ok { - return x.Nproc +func (x *ProtoSerialAction) GetActions() []*ProtoAction { + if x != nil { + return x.Actions } - return 0 + return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ResourceLimits) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ResourceLimits_Nofile)(nil), - (*ResourceLimits_Nproc)(nil), +func (x *ProtoSerialAction) GetLogSource() string { + if x != nil { + return x.LogSource } + return "" } -func init() { - proto.RegisterType((*Action)(nil), "models.Action") - proto.RegisterType((*DownloadAction)(nil), "models.DownloadAction") - proto.RegisterType((*UploadAction)(nil), "models.UploadAction") - proto.RegisterType((*RunAction)(nil), "models.RunAction") - proto.RegisterType((*TimeoutAction)(nil), "models.TimeoutAction") - proto.RegisterType((*EmitProgressAction)(nil), "models.EmitProgressAction") - proto.RegisterType((*TryAction)(nil), "models.TryAction") - proto.RegisterType((*ParallelAction)(nil), "models.ParallelAction") - proto.RegisterType((*SerialAction)(nil), "models.SerialAction") - proto.RegisterType((*CodependentAction)(nil), "models.CodependentAction") - proto.RegisterType((*ResourceLimits)(nil), "models.ResourceLimits") +type ProtoCodependentAction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Actions []*ProtoAction `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` + LogSource string `protobuf:"bytes,2,opt,name=log_source,proto3" json:"log_source,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { proto.RegisterFile("actions.proto", fileDescriptor_eeb49063df94c2b8) } +func (x *ProtoCodependentAction) Reset() { + *x = ProtoCodependentAction{} + mi := &file_actions_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -var fileDescriptor_eeb49063df94c2b8 = []byte{ - // 1119 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0xdb, 0x36, - 0x14, 0xb7, 0x6c, 0xd7, 0x8d, 0x5e, 0x63, 0xa7, 0x66, 0xfe, 0xd4, 0x75, 0x36, 0x29, 0x30, 0xb0, - 0x21, 0x18, 0x96, 0x14, 0xe8, 0x86, 0x9d, 0x06, 0x0c, 0x75, 0xf7, 0xa7, 0x40, 0x9b, 0x35, 0x60, - 0xba, 0x76, 0x03, 0x06, 0x08, 0x8a, 0x4c, 0x3b, 0x42, 0x24, 0x51, 0x20, 0xa9, 0x6c, 0xbe, 0xed, - 0xbe, 0xcb, 0xbe, 0xc0, 0x30, 0x0c, 0xbb, 0xec, 0xa3, 0xec, 0x18, 0xec, 0xd4, 0x93, 0xb0, 0x38, - 0x97, 0x41, 0xa7, 0x7e, 0x84, 0x41, 0x14, 0xe9, 0x48, 0x4e, 0x8a, 0xf4, 0xd0, 0x5d, 0x04, 0xbe, - 0xf7, 0xfb, 0xbd, 0x1f, 0xc9, 0xf7, 0xc8, 0x47, 0x41, 0xdb, 0xf5, 0x84, 0x4f, 0x23, 0xbe, 0x1b, - 0x33, 0x2a, 0x28, 0x6a, 0x85, 0x74, 0x44, 0x02, 0xde, 0xdf, 0x99, 0xf8, 0xe2, 0x28, 0x39, 0xdc, - 0xf5, 0x68, 0x78, 0x6f, 0x42, 0x27, 0xf4, 0x9e, 0x84, 0x0f, 0x93, 0xb1, 0xb4, 0xa4, 0x21, 0x47, - 0x45, 0x58, 0x7f, 0x93, 0x44, 0x27, 0x3e, 0xa3, 0x51, 0x48, 0x22, 0xe1, 0x9c, 0xb8, 0xcc, 0x77, - 0x0f, 0x03, 0xa2, 0x34, 0xfb, 0x30, 0xf6, 0x03, 0x52, 0x8c, 0x07, 0x3f, 0xb7, 0xa0, 0xf5, 0x40, - 0xce, 0x88, 0x5e, 0xc0, 0xca, 0x88, 0xfe, 0x10, 0x05, 0xd4, 0x1d, 0x39, 0xc5, 0x22, 0x7a, 0xc6, - 0x96, 0xb1, 0x7d, 0xeb, 0xfe, 0xc6, 0x6e, 0xb1, 0x88, 0xdd, 0xcf, 0x15, 0x5c, 0x04, 0x0c, 0x37, - 0xb2, 0xd4, 0x46, 0x3a, 0xe4, 0x43, 0x1a, 0xfa, 0x82, 0x84, 0xb1, 0x98, 0xe2, 0xce, 0xa8, 0xc2, - 0x43, 0x4f, 0xa1, 0x9d, 0xc4, 0x65, 0xd9, 0xba, 0x94, 0x5d, 0xd3, 0xb2, 0xdf, 0xc4, 0x25, 0xd1, - 0xb5, 0x2c, 0xb5, 0x6f, 0x17, 0xf4, 0x92, 0xe4, 0x72, 0x52, 0xe2, 0xa0, 0x87, 0x00, 0x2c, 0x89, - 0xb4, 0x5a, 0x43, 0xaa, 0x75, 0xb5, 0x1a, 0x4e, 0x22, 0x25, 0xd5, 0xcd, 0x52, 0xbb, 0xcd, 0x92, - 0xa8, 0xa4, 0x63, 0x32, 0x8d, 0xa2, 0x03, 0xe8, 0x08, 0x3f, 0x24, 0x34, 0x11, 0x5a, 0xa8, 0x29, - 0x85, 0xd6, 0xb5, 0xd0, 0xb3, 0x02, 0x55, 0x62, 0xeb, 0x59, 0x6a, 0x77, 0x55, 0x40, 0x49, 0xb0, - 0x2d, 0xca, 0x2c, 0xe4, 0xc3, 0x1a, 0x09, 0x7d, 0xe1, 0xc4, 0x8c, 0x4e, 0x18, 0xe1, 0x5c, 0x4b, - 0xdf, 0x90, 0xd2, 0x7d, 0x2d, 0xfd, 0x45, 0xe8, 0x8b, 0x7d, 0x45, 0x51, 0xfa, 0x9b, 0x59, 0x6a, - 0xdf, 0xa9, 0xc4, 0x96, 0x66, 0x41, 0xe4, 0x52, 0x40, 0x9e, 0x04, 0xc1, 0xa6, 0x7a, 0x82, 0x56, - 0x35, 0x09, 0xcf, 0xd8, 0xb4, 0x9c, 0x04, 0xc1, 0xa6, 0xe5, 0x24, 0x08, 0x8d, 0xe6, 0x35, 0x8f, - 0x5d, 0xe6, 0x06, 0x01, 0x09, 0xb4, 0xd2, 0xcd, 0x6a, 0xcd, 0xf7, 0x15, 0x5c, 0xae, 0xb9, 0x0e, - 0x29, 0xd7, 0x3c, 0xae, 0xf0, 0xf2, 0x9a, 0x73, 0xc2, 0x7c, 0x77, 0x2e, 0xbb, 0x54, 0xad, 0xf9, - 0x81, 0x04, 0xcb, 0x35, 0x2f, 0xe8, 0xe5, 0x9a, 0xf3, 0x12, 0x07, 0x79, 0x80, 0x3c, 0x3a, 0x22, - 0x31, 0x89, 0x46, 0xf9, 0x99, 0x56, 0xaa, 0xa6, 0x54, 0xbd, 0xab, 0x55, 0x1f, 0x5e, 0x30, 0x94, - 0xf4, 0xdd, 0x2c, 0xb5, 0xd7, 0x4b, 0x81, 0x25, 0xfd, 0xae, 0xb7, 0xc8, 0x1e, 0xfc, 0x5e, 0x87, - 0x4e, 0xf5, 0x90, 0xa3, 0x3e, 0x2c, 0xb9, 0x4c, 0xf8, 0x63, 0xd7, 0x13, 0xf2, 0x3a, 0x98, 0x78, - 0x6e, 0xa3, 0x77, 0xa0, 0x39, 0x66, 0x34, 0x94, 0xe7, 0xd9, 0x1c, 0x2e, 0x65, 0xa9, 0x2d, 0x6d, - 0x2c, 0xbf, 0x68, 0x03, 0xea, 0x82, 0xca, 0xd3, 0x69, 0x0e, 0x5b, 0x59, 0x6a, 0xd7, 0x05, 0xc5, - 0x75, 0x41, 0xd1, 0x07, 0x60, 0x7a, 0xae, 0x77, 0x44, 0x9c, 0x63, 0x32, 0x95, 0x67, 0xce, 0x1c, - 0xb6, 0xb3, 0xd4, 0xbe, 0x70, 0xe2, 0x25, 0x39, 0x7c, 0x4c, 0xa6, 0xe8, 0x5d, 0x80, 0x80, 0x4e, - 0x1c, 0x4e, 0x13, 0xe6, 0x11, 0x79, 0x8a, 0x4c, 0x6c, 0x06, 0x74, 0x72, 0x20, 0x1d, 0xf9, 0x02, - 0x12, 0x4e, 0x98, 0xac, 0xbe, 0x5a, 0x40, 0x6e, 0x63, 0xf9, 0x45, 0x3b, 0x80, 0xbc, 0x23, 0xe2, - 0x1d, 0xf3, 0x24, 0x74, 0xdc, 0x60, 0x42, 0x99, 0x2f, 0x8e, 0x42, 0x59, 0x5f, 0x13, 0x77, 0x35, - 0xf2, 0x40, 0x03, 0xe8, 0x3d, 0xe8, 0xcc, 0xe9, 0x27, 0x6e, 0x90, 0x10, 0x59, 0x33, 0x13, 0xb7, - 0xb5, 0xf7, 0x79, 0xee, 0x1c, 0xfc, 0x6a, 0xc0, 0x72, 0xf9, 0xc6, 0xfe, 0x0f, 0x19, 0xaa, 0xee, - 0xba, 0xf9, 0xba, 0x5d, 0xdf, 0xb8, 0x6a, 0xd7, 0x83, 0xdf, 0x1a, 0x60, 0xce, 0x7b, 0x40, 0xce, - 0x8d, 0x5d, 0x71, 0x54, 0x2c, 0xac, 0xe0, 0xe6, 0x36, 0x96, 0x5f, 0x84, 0xa0, 0xe9, 0xb2, 0x09, - 0xef, 0xd5, 0xb7, 0x1a, 0xdb, 0x26, 0x96, 0x63, 0x74, 0x1b, 0x1a, 0x23, 0x9f, 0x15, 0xab, 0xc2, - 0xf9, 0x10, 0xed, 0x40, 0x83, 0x44, 0x27, 0xbd, 0xe6, 0x56, 0x63, 0xfb, 0xd6, 0xfd, 0xcd, 0xf9, - 0x1d, 0xbe, 0xe8, 0xb0, 0xcf, 0x55, 0x83, 0xc5, 0x39, 0x0f, 0x7d, 0x06, 0x2b, 0x8c, 0x14, 0x6b, - 0x77, 0x02, 0x3f, 0xf4, 0x05, 0x57, 0xd7, 0x7f, 0x7e, 0xa7, 0xb0, 0x82, 0x9f, 0x48, 0x14, 0x77, - 0x58, 0xc5, 0xbe, 0xa6, 0xaa, 0xd5, 0xe4, 0xdc, 0x5c, 0x4c, 0xce, 0x57, 0xb0, 0xca, 0x93, 0x38, - 0x96, 0xcd, 0x27, 0xe7, 0xd1, 0x44, 0xc4, 0x89, 0x90, 0xa5, 0x5c, 0x1a, 0xde, 0xc9, 0x52, 0xfb, - 0x2a, 0x18, 0x77, 0xb5, 0xf3, 0x09, 0x9d, 0x3c, 0x95, 0x2e, 0xf4, 0x2d, 0xac, 0x9d, 0xd0, 0x20, - 0x09, 0x89, 0x13, 0xd2, 0x24, 0x12, 0x64, 0xe4, 0xe4, 0xcf, 0x06, 0xef, 0x99, 0x32, 0x0d, 0xcb, - 0x7a, 0x2f, 0x5f, 0xfa, 0x01, 0x19, 0xf6, 0xb2, 0xd4, 0xbe, 0x92, 0x8d, 0x51, 0xe1, 0xdd, 0x2b, - 0x9c, 0x39, 0x99, 0x0f, 0xfe, 0x36, 0xa0, 0x5d, 0x69, 0xae, 0xe8, 0x7d, 0x68, 0x55, 0x5e, 0x9c, - 0x8e, 0x56, 0x2f, 0x70, 0xac, 0x50, 0xf4, 0x18, 0xd6, 0x47, 0x24, 0x66, 0xc4, 0x73, 0xf3, 0x19, - 0x74, 0xfb, 0x8e, 0xb8, 0x3c, 0x5f, 0x0d, 0xb9, 0xbd, 0xcb, 0x3d, 0xba, 0x67, 0xe0, 0xd5, 0x8b, - 0x28, 0x35, 0xf1, 0xd7, 0x7c, 0x21, 0x91, 0x8d, 0xc5, 0x44, 0xee, 0x00, 0xe8, 0x09, 0x42, 0x2e, - 0x0f, 0x61, 0x63, 0xd8, 0xc9, 0x52, 0xbb, 0xe4, 0xc5, 0xa6, 0x1a, 0xef, 0xf1, 0xc1, 0x1f, 0x75, - 0x40, 0x97, 0xdb, 0xfa, 0x1b, 0xef, 0xec, 0x13, 0x68, 0x73, 0xe1, 0x32, 0xe1, 0x84, 0x84, 0x73, - 0x77, 0x42, 0xd4, 0x8d, 0x91, 0xdd, 0xbb, 0x02, 0xe0, 0x65, 0x69, 0xee, 0x15, 0x16, 0xfa, 0x14, - 0x56, 0x78, 0xe2, 0x79, 0x79, 0x39, 0x75, 0x64, 0x71, 0x9f, 0x56, 0xb3, 0xd4, 0x5e, 0x84, 0x70, - 0x47, 0x39, 0x74, 0xf4, 0x3e, 0x6c, 0x8c, 0x5d, 0x3f, 0x48, 0x18, 0xd1, 0x14, 0x27, 0x66, 0x64, - 0xec, 0xff, 0xa8, 0xfa, 0x52, 0x3f, 0x4b, 0xed, 0xd7, 0x30, 0xf0, 0x9a, 0xf2, 0x2b, 0xad, 0x7d, - 0xe9, 0xbd, 0xa6, 0x61, 0x0d, 0x30, 0x98, 0xf3, 0xa7, 0xe9, 0x8d, 0x73, 0x53, 0xd5, 0xac, 0x2f, - 0x6a, 0x7e, 0x07, 0x9d, 0xea, 0x23, 0x85, 0xb6, 0xe1, 0xa6, 0xfa, 0x8b, 0xea, 0x19, 0xf2, 0xb4, - 0x2e, 0x2a, 0x6b, 0xf8, 0x3a, 0xe9, 0x17, 0xb0, 0x5c, 0x7e, 0xa8, 0xde, 0x9e, 0xf0, 0xf7, 0xd0, - 0xbd, 0xf4, 0x56, 0xbd, 0x3d, 0xf5, 0x63, 0xe8, 0x54, 0x5b, 0x0c, 0xea, 0x41, 0x2b, 0xa2, 0xf9, - 0x8d, 0x94, 0xa9, 0x6e, 0x3e, 0xaa, 0x61, 0x65, 0xa3, 0x3e, 0xdc, 0x88, 0x62, 0x46, 0x3d, 0xa9, - 0xd2, 0x1c, 0xd6, 0x7b, 0xc6, 0x23, 0x03, 0x17, 0xae, 0x61, 0x17, 0x56, 0x68, 0x9c, 0xcf, 0xe8, - 0x06, 0x4e, 0x41, 0x1f, 0xde, 0x86, 0xce, 0x85, 0x4b, 0x92, 0x3e, 0x3e, 0x3d, 0xb3, 0x6a, 0x2f, - 0xcf, 0xac, 0xda, 0xab, 0x33, 0xcb, 0xf8, 0x69, 0x66, 0x19, 0x7f, 0xce, 0x2c, 0xe3, 0xaf, 0x99, - 0x65, 0x9c, 0xce, 0x2c, 0xe3, 0x9f, 0x99, 0x65, 0xfc, 0x3b, 0xb3, 0x6a, 0xaf, 0x66, 0x96, 0xf1, - 0xcb, 0xb9, 0x55, 0x3b, 0x3d, 0xb7, 0x6a, 0x2f, 0xcf, 0xad, 0xda, 0x61, 0x4b, 0xfe, 0x7e, 0x7e, - 0xf4, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa7, 0x06, 0xa4, 0xbb, 0xef, 0x0a, 0x00, 0x00, +func (x *ProtoCodependentAction) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *Action) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoCodependentAction) ProtoMessage() {} - that1, ok := that.(*Action) - if !ok { - that2, ok := that.(Action) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoCodependentAction) ProtoReflect() protoreflect.Message { + mi := &file_actions_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.DownloadAction.Equal(that1.DownloadAction) { - return false - } - if !this.UploadAction.Equal(that1.UploadAction) { - return false - } - if !this.RunAction.Equal(that1.RunAction) { - return false - } - if !this.TimeoutAction.Equal(that1.TimeoutAction) { - return false - } - if !this.EmitProgressAction.Equal(that1.EmitProgressAction) { - return false - } - if !this.TryAction.Equal(that1.TryAction) { - return false - } - if !this.ParallelAction.Equal(that1.ParallelAction) { - return false - } - if !this.SerialAction.Equal(that1.SerialAction) { - return false - } - if !this.CodependentAction.Equal(that1.CodependentAction) { - return false - } - return true + return mi.MessageOf(x) } -func (this *DownloadAction) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*DownloadAction) - if !ok { - that2, ok := that.(DownloadAction) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Artifact != that1.Artifact { - return false - } - if this.From != that1.From { - return false - } - if this.To != that1.To { - return false - } - if this.CacheKey != that1.CacheKey { - return false - } - if this.LogSource != that1.LogSource { - return false - } - if this.User != that1.User { - return false - } - if this.ChecksumAlgorithm != that1.ChecksumAlgorithm { - return false - } - if this.ChecksumValue != that1.ChecksumValue { - return false - } - return true +// Deprecated: Use ProtoCodependentAction.ProtoReflect.Descriptor instead. +func (*ProtoCodependentAction) Descriptor() ([]byte, []int) { + return file_actions_proto_rawDescGZIP(), []int{9} } -func (this *UploadAction) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*UploadAction) - if !ok { - that2, ok := that.(UploadAction) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Artifact != that1.Artifact { - return false - } - if this.From != that1.From { - return false - } - if this.To != that1.To { - return false - } - if this.LogSource != that1.LogSource { - return false - } - if this.User != that1.User { - return false +func (x *ProtoCodependentAction) GetActions() []*ProtoAction { + if x != nil { + return x.Actions } - return true + return nil } -func (this *RunAction) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*RunAction) - if !ok { - that2, ok := that.(RunAction) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Path != that1.Path { - return false - } - if len(this.Args) != len(that1.Args) { - return false - } - for i := range this.Args { - if this.Args[i] != that1.Args[i] { - return false - } - } - if this.Dir != that1.Dir { - return false - } - if len(this.Env) != len(that1.Env) { - return false - } - for i := range this.Env { - if !this.Env[i].Equal(that1.Env[i]) { - return false - } - } - if !this.ResourceLimits.Equal(that1.ResourceLimits) { - return false - } - if this.User != that1.User { - return false - } - if this.LogSource != that1.LogSource { - return false - } - if this.SuppressLogOutput != that1.SuppressLogOutput { - return false +func (x *ProtoCodependentAction) GetLogSource() string { + if x != nil { + return x.LogSource } - if len(this.VolumeMountedFiles) != len(that1.VolumeMountedFiles) { - return false - } - for i := range this.VolumeMountedFiles { - if !this.VolumeMountedFiles[i].Equal(that1.VolumeMountedFiles[i]) { - return false - } - } - return true + return "" } -func (this *TimeoutAction) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*TimeoutAction) - if !ok { - that2, ok := that.(TimeoutAction) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Action.Equal(that1.Action) { - return false - } - if this.DeprecatedTimeoutNs != that1.DeprecatedTimeoutNs { - return false - } - if this.LogSource != that1.LogSource { - return false - } - if this.TimeoutMs != that1.TimeoutMs { - return false - } - return true +type ProtoResourceLimits struct { + state protoimpl.MessageState `protogen:"open.v1"` + Nofile *uint64 `protobuf:"varint,1,opt,name=nofile,proto3,oneof" json:"nofile,omitempty"` + // Deprecated: Marked as deprecated in actions.proto. + Nproc *uint64 `protobuf:"varint,2,opt,name=nproc,proto3,oneof" json:"nproc,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (this *EmitProgressAction) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*EmitProgressAction) - if !ok { - that2, ok := that.(EmitProgressAction) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Action.Equal(that1.Action) { - return false - } - if this.StartMessage != that1.StartMessage { - return false - } - if this.SuccessMessage != that1.SuccessMessage { - return false - } - if this.FailureMessagePrefix != that1.FailureMessagePrefix { - return false - } - if this.LogSource != that1.LogSource { - return false - } - return true +func (x *ProtoResourceLimits) Reset() { + *x = ProtoResourceLimits{} + mi := &file_actions_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (this *TryAction) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*TryAction) - if !ok { - that2, ok := that.(TryAction) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Action.Equal(that1.Action) { - return false - } - if this.LogSource != that1.LogSource { - return false - } - return true +func (x *ProtoResourceLimits) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *ParallelAction) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ParallelAction) - if !ok { - that2, ok := that.(ParallelAction) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Actions) != len(that1.Actions) { - return false - } - for i := range this.Actions { - if !this.Actions[i].Equal(that1.Actions[i]) { - return false - } - } - if this.LogSource != that1.LogSource { - return false - } - return true -} -func (this *SerialAction) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoResourceLimits) ProtoMessage() {} - that1, ok := that.(*SerialAction) - if !ok { - that2, ok := that.(SerialAction) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Actions) != len(that1.Actions) { - return false - } - for i := range this.Actions { - if !this.Actions[i].Equal(that1.Actions[i]) { - return false +func (x *ProtoResourceLimits) ProtoReflect() protoreflect.Message { + mi := &file_actions_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if this.LogSource != that1.LogSource { - return false - } - return true + return mi.MessageOf(x) } -func (this *CodependentAction) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*CodependentAction) - if !ok { - that2, ok := that.(CodependentAction) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Actions) != len(that1.Actions) { - return false - } - for i := range this.Actions { - if !this.Actions[i].Equal(that1.Actions[i]) { - return false - } - } - if this.LogSource != that1.LogSource { - return false - } - return true +// Deprecated: Use ProtoResourceLimits.ProtoReflect.Descriptor instead. +func (*ProtoResourceLimits) Descriptor() ([]byte, []int) { + return file_actions_proto_rawDescGZIP(), []int{10} } -func (this *ResourceLimits) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ResourceLimits) - if !ok { - that2, ok := that.(ResourceLimits) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if that1.OptionalNofile == nil { - if this.OptionalNofile != nil { - return false - } - } else if this.OptionalNofile == nil { - return false - } else if !this.OptionalNofile.Equal(that1.OptionalNofile) { - return false - } - if that1.OptionalNproc == nil { - if this.OptionalNproc != nil { - return false - } - } else if this.OptionalNproc == nil { - return false - } else if !this.OptionalNproc.Equal(that1.OptionalNproc) { - return false +func (x *ProtoResourceLimits) GetNofile() uint64 { + if x != nil && x.Nofile != nil { + return *x.Nofile } - return true + return 0 } -func (this *ResourceLimits_Nofile) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ResourceLimits_Nofile) - if !ok { - that2, ok := that.(ResourceLimits_Nofile) - if ok { - that1 = &that2 - } else { - return false - } +// Deprecated: Marked as deprecated in actions.proto. +func (x *ProtoResourceLimits) GetNproc() uint64 { + if x != nil && x.Nproc != nil { + return *x.Nproc } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Nofile != that1.Nofile { - return false - } - return true + return 0 } -func (this *ResourceLimits_Nproc) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ResourceLimits_Nproc) - if !ok { - that2, ok := that.(ResourceLimits_Nproc) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Nproc != that1.Nproc { - return false - } - return true -} -func (this *Action) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 13) - s = append(s, "&models.Action{") - if this.DownloadAction != nil { - s = append(s, "DownloadAction: "+fmt.Sprintf("%#v", this.DownloadAction)+",\n") - } - if this.UploadAction != nil { - s = append(s, "UploadAction: "+fmt.Sprintf("%#v", this.UploadAction)+",\n") - } - if this.RunAction != nil { - s = append(s, "RunAction: "+fmt.Sprintf("%#v", this.RunAction)+",\n") - } - if this.TimeoutAction != nil { - s = append(s, "TimeoutAction: "+fmt.Sprintf("%#v", this.TimeoutAction)+",\n") - } - if this.EmitProgressAction != nil { - s = append(s, "EmitProgressAction: "+fmt.Sprintf("%#v", this.EmitProgressAction)+",\n") - } - if this.TryAction != nil { - s = append(s, "TryAction: "+fmt.Sprintf("%#v", this.TryAction)+",\n") - } - if this.ParallelAction != nil { - s = append(s, "ParallelAction: "+fmt.Sprintf("%#v", this.ParallelAction)+",\n") - } - if this.SerialAction != nil { - s = append(s, "SerialAction: "+fmt.Sprintf("%#v", this.SerialAction)+",\n") - } - if this.CodependentAction != nil { - s = append(s, "CodependentAction: "+fmt.Sprintf("%#v", this.CodependentAction)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DownloadAction) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 12) - s = append(s, "&models.DownloadAction{") - s = append(s, "Artifact: "+fmt.Sprintf("%#v", this.Artifact)+",\n") - s = append(s, "From: "+fmt.Sprintf("%#v", this.From)+",\n") - s = append(s, "To: "+fmt.Sprintf("%#v", this.To)+",\n") - s = append(s, "CacheKey: "+fmt.Sprintf("%#v", this.CacheKey)+",\n") - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - s = append(s, "User: "+fmt.Sprintf("%#v", this.User)+",\n") - s = append(s, "ChecksumAlgorithm: "+fmt.Sprintf("%#v", this.ChecksumAlgorithm)+",\n") - s = append(s, "ChecksumValue: "+fmt.Sprintf("%#v", this.ChecksumValue)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UploadAction) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&models.UploadAction{") - s = append(s, "Artifact: "+fmt.Sprintf("%#v", this.Artifact)+",\n") - s = append(s, "From: "+fmt.Sprintf("%#v", this.From)+",\n") - s = append(s, "To: "+fmt.Sprintf("%#v", this.To)+",\n") - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - s = append(s, "User: "+fmt.Sprintf("%#v", this.User)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RunAction) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 13) - s = append(s, "&models.RunAction{") - s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") - s = append(s, "Args: "+fmt.Sprintf("%#v", this.Args)+",\n") - s = append(s, "Dir: "+fmt.Sprintf("%#v", this.Dir)+",\n") - if this.Env != nil { - s = append(s, "Env: "+fmt.Sprintf("%#v", this.Env)+",\n") - } - if this.ResourceLimits != nil { - s = append(s, "ResourceLimits: "+fmt.Sprintf("%#v", this.ResourceLimits)+",\n") - } - s = append(s, "User: "+fmt.Sprintf("%#v", this.User)+",\n") - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - s = append(s, "SuppressLogOutput: "+fmt.Sprintf("%#v", this.SuppressLogOutput)+",\n") - if this.VolumeMountedFiles != nil { - s = append(s, "VolumeMountedFiles: "+fmt.Sprintf("%#v", this.VolumeMountedFiles)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TimeoutAction) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&models.TimeoutAction{") - if this.Action != nil { - s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") - } - s = append(s, "DeprecatedTimeoutNs: "+fmt.Sprintf("%#v", this.DeprecatedTimeoutNs)+",\n") - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - s = append(s, "TimeoutMs: "+fmt.Sprintf("%#v", this.TimeoutMs)+",\n") - s = append(s, "}") - return strings.Join(s, "") +var File_actions_proto protoreflect.FileDescriptor + +const file_actions_proto_rawDesc = "" + + "\n" + + "\ractions.proto\x12\x06models\x1a\tbbs.proto\x1a\x1benvironment_variables.proto\x1a\n" + + "file.proto\"\xb7\x04\n" + + "\vProtoAction\x12>\n" + + "\x0fdownload_action\x18\x01 \x01(\v2\x1b.models.ProtoDownloadActionR\bdownload\x128\n" + + "\rupload_action\x18\x02 \x01(\v2\x19.models.ProtoUploadActionR\x06upload\x12/\n" + + "\n" + + "run_action\x18\x03 \x01(\v2\x16.models.ProtoRunActionR\x03run\x12;\n" + + "\x0etimeout_action\x18\x04 \x01(\v2\x1a.models.ProtoTimeoutActionR\atimeout\x12L\n" + + "\x14emit_progress_action\x18\x05 \x01(\v2\x1f.models.ProtoEmitProgressActionR\remit_progress\x12/\n" + + "\n" + + "try_action\x18\x06 \x01(\v2\x16.models.ProtoTryActionR\x03try\x12>\n" + + "\x0fparallel_action\x18\a \x01(\v2\x1b.models.ProtoParallelActionR\bparallel\x128\n" + + "\rserial_action\x18\b \x01(\v2\x19.models.ProtoSerialActionR\x06serial\x12G\n" + + "\x12codependent_action\x18\t \x01(\v2\x1e.models.ProtoCodependentActionR\vcodependent\"\x93\x02\n" + + "\x13ProtoDownloadAction\x12\x1a\n" + + "\bartifact\x18\x01 \x01(\tR\bartifact\x12\x17\n" + + "\x04from\x18\x02 \x01(\tB\x03\xc0>\x01R\x04from\x12\x13\n" + + "\x02to\x18\x03 \x01(\tB\x03\xc0>\x01R\x02to\x12!\n" + + "\tcache_key\x18\x04 \x01(\tB\x03\xc0>\x01R\tcache_key\x12\x1e\n" + + "\n" + + "log_source\x18\x05 \x01(\tR\n" + + "log_source\x12\x17\n" + + "\x04user\x18\x06 \x01(\tB\x03\xc0>\x01R\x04user\x12.\n" + + "\x12checksum_algorithm\x18\a \x01(\tR\x12checksum_algorithm\x12&\n" + + "\x0echecksum_value\x18\b \x01(\tR\x0echecksum_value\"\x96\x01\n" + + "\x11ProtoUploadAction\x12\x1a\n" + + "\bartifact\x18\x01 \x01(\tR\bartifact\x12\x17\n" + + "\x04from\x18\x02 \x01(\tB\x03\xc0>\x01R\x04from\x12\x13\n" + + "\x02to\x18\x03 \x01(\tB\x03\xc0>\x01R\x02to\x12\x1e\n" + + "\n" + + "log_source\x18\x04 \x01(\tR\n" + + "log_source\x12\x17\n" + + "\x04user\x18\x05 \x01(\tB\x03\xc0>\x01R\x04user\"\x86\x03\n" + + "\x0eProtoRunAction\x12\x17\n" + + "\x04path\x18\x01 \x01(\tB\x03\xc0>\x01R\x04path\x12\x12\n" + + "\x04args\x18\x02 \x03(\tR\x04args\x12\x10\n" + + "\x03dir\x18\x03 \x01(\tR\x03dir\x122\n" + + "\x03env\x18\x04 \x03(\v2 .models.ProtoEnvironmentVariableR\x03env\x12E\n" + + "\x0fresource_limits\x18\x05 \x01(\v2\x1b.models.ProtoResourceLimitsR\x0fresource_limits\x12\x17\n" + + "\x04user\x18\x06 \x01(\tB\x03\xc0>\x01R\x04user\x12\x1e\n" + + "\n" + + "log_source\x18\a \x01(\tR\n" + + "log_source\x125\n" + + "\x13suppress_log_output\x18\b \x01(\bB\x03\xc0>\x01R\x13suppress_log_output\x12J\n" + + "\x14volume_mounted_files\x18\t \x03(\v2\x11.models.ProtoFileB\x03\xc0>\x01R\x14volume_mounted_files\"\xb2\x01\n" + + "\x12ProtoTimeoutAction\x12+\n" + + "\x06action\x18\x01 \x01(\v2\x13.models.ProtoActionR\x06action\x12*\n" + + "\x15deprecated_timeout_ns\x18\x02 \x01(\x03B\x02\x18\x01R\atimeout\x12\x1e\n" + + "\n" + + "log_source\x18\x03 \x01(\tR\n" + + "log_source\x12#\n" + + "\n" + + "timeout_ms\x18\x04 \x01(\x03B\x03\xc0>\x01R\n" + + "timeout_ms\"\xfd\x01\n" + + "\x17ProtoEmitProgressAction\x12+\n" + + "\x06action\x18\x01 \x01(\v2\x13.models.ProtoActionR\x06action\x12)\n" + + "\rstart_message\x18\x02 \x01(\tB\x03\xc0>\x01R\rstart_message\x12-\n" + + "\x0fsuccess_message\x18\x03 \x01(\tB\x03\xc0>\x01R\x0fsuccess_message\x12;\n" + + "\x16failure_message_prefix\x18\x04 \x01(\tB\x03\xc0>\x01R\x16failure_message_prefix\x12\x1e\n" + + "\n" + + "log_source\x18\x05 \x01(\tR\n" + + "log_source\"]\n" + + "\x0eProtoTryAction\x12+\n" + + "\x06action\x18\x01 \x01(\v2\x13.models.ProtoActionR\x06action\x12\x1e\n" + + "\n" + + "log_source\x18\x02 \x01(\tR\n" + + "log_source\"d\n" + + "\x13ProtoParallelAction\x12-\n" + + "\aactions\x18\x01 \x03(\v2\x13.models.ProtoActionR\aactions\x12\x1e\n" + + "\n" + + "log_source\x18\x02 \x01(\tR\n" + + "log_source\"b\n" + + "\x11ProtoSerialAction\x12-\n" + + "\aactions\x18\x01 \x03(\v2\x13.models.ProtoActionR\aactions\x12\x1e\n" + + "\n" + + "log_source\x18\x02 \x01(\tR\n" + + "log_source\"g\n" + + "\x16ProtoCodependentAction\x12-\n" + + "\aactions\x18\x01 \x03(\v2\x13.models.ProtoActionR\aactions\x12\x1e\n" + + "\n" + + "log_source\x18\x02 \x01(\tR\n" + + "log_source\"t\n" + + "\x13ProtoResourceLimits\x12#\n" + + "\x06nofile\x18\x01 \x01(\x04B\x06\x82A\x03nilH\x00R\x06nofile\x88\x01\x01\x12#\n" + + "\x05nproc\x18\x02 \x01(\x04B\b\x82A\x03nil\x18\x01H\x01R\x05nproc\x88\x01\x01B\t\n" + + "\a_nofileB\b\n" + + "\x06_nprocB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" + +var ( + file_actions_proto_rawDescOnce sync.Once + file_actions_proto_rawDescData []byte +) + +func file_actions_proto_rawDescGZIP() []byte { + file_actions_proto_rawDescOnce.Do(func() { + file_actions_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_actions_proto_rawDesc), len(file_actions_proto_rawDesc))) + }) + return file_actions_proto_rawDescData +} + +var file_actions_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_actions_proto_goTypes = []any{ + (*ProtoAction)(nil), // 0: models.ProtoAction + (*ProtoDownloadAction)(nil), // 1: models.ProtoDownloadAction + (*ProtoUploadAction)(nil), // 2: models.ProtoUploadAction + (*ProtoRunAction)(nil), // 3: models.ProtoRunAction + (*ProtoTimeoutAction)(nil), // 4: models.ProtoTimeoutAction + (*ProtoEmitProgressAction)(nil), // 5: models.ProtoEmitProgressAction + (*ProtoTryAction)(nil), // 6: models.ProtoTryAction + (*ProtoParallelAction)(nil), // 7: models.ProtoParallelAction + (*ProtoSerialAction)(nil), // 8: models.ProtoSerialAction + (*ProtoCodependentAction)(nil), // 9: models.ProtoCodependentAction + (*ProtoResourceLimits)(nil), // 10: models.ProtoResourceLimits + (*ProtoEnvironmentVariable)(nil), // 11: models.ProtoEnvironmentVariable + (*ProtoFile)(nil), // 12: models.ProtoFile +} +var file_actions_proto_depIdxs = []int32{ + 1, // 0: models.ProtoAction.download_action:type_name -> models.ProtoDownloadAction + 2, // 1: models.ProtoAction.upload_action:type_name -> models.ProtoUploadAction + 3, // 2: models.ProtoAction.run_action:type_name -> models.ProtoRunAction + 4, // 3: models.ProtoAction.timeout_action:type_name -> models.ProtoTimeoutAction + 5, // 4: models.ProtoAction.emit_progress_action:type_name -> models.ProtoEmitProgressAction + 6, // 5: models.ProtoAction.try_action:type_name -> models.ProtoTryAction + 7, // 6: models.ProtoAction.parallel_action:type_name -> models.ProtoParallelAction + 8, // 7: models.ProtoAction.serial_action:type_name -> models.ProtoSerialAction + 9, // 8: models.ProtoAction.codependent_action:type_name -> models.ProtoCodependentAction + 11, // 9: models.ProtoRunAction.env:type_name -> models.ProtoEnvironmentVariable + 10, // 10: models.ProtoRunAction.resource_limits:type_name -> models.ProtoResourceLimits + 12, // 11: models.ProtoRunAction.volume_mounted_files:type_name -> models.ProtoFile + 0, // 12: models.ProtoTimeoutAction.action:type_name -> models.ProtoAction + 0, // 13: models.ProtoEmitProgressAction.action:type_name -> models.ProtoAction + 0, // 14: models.ProtoTryAction.action:type_name -> models.ProtoAction + 0, // 15: models.ProtoParallelAction.actions:type_name -> models.ProtoAction + 0, // 16: models.ProtoSerialAction.actions:type_name -> models.ProtoAction + 0, // 17: models.ProtoCodependentAction.actions:type_name -> models.ProtoAction + 18, // [18:18] is the sub-list for method output_type + 18, // [18:18] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name +} + +func init() { file_actions_proto_init() } +func file_actions_proto_init() { + if File_actions_proto != nil { + return + } + file_bbs_proto_init() + file_environment_variables_proto_init() + file_file_proto_init() + file_actions_proto_msgTypes[10].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_actions_proto_rawDesc), len(file_actions_proto_rawDesc)), + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_actions_proto_goTypes, + DependencyIndexes: file_actions_proto_depIdxs, + MessageInfos: file_actions_proto_msgTypes, + }.Build() + File_actions_proto = out.File + file_actions_proto_goTypes = nil + file_actions_proto_depIdxs = nil } -func (this *EmitProgressAction) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&models.EmitProgressAction{") - if this.Action != nil { - s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") - } - s = append(s, "StartMessage: "+fmt.Sprintf("%#v", this.StartMessage)+",\n") - s = append(s, "SuccessMessage: "+fmt.Sprintf("%#v", this.SuccessMessage)+",\n") - s = append(s, "FailureMessagePrefix: "+fmt.Sprintf("%#v", this.FailureMessagePrefix)+",\n") - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TryAction) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.TryAction{") - if this.Action != nil { - s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") - } - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ParallelAction) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ParallelAction{") - if this.Actions != nil { - s = append(s, "Actions: "+fmt.Sprintf("%#v", this.Actions)+",\n") - } - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SerialAction) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.SerialAction{") - if this.Actions != nil { - s = append(s, "Actions: "+fmt.Sprintf("%#v", this.Actions)+",\n") - } - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *CodependentAction) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.CodependentAction{") - if this.Actions != nil { - s = append(s, "Actions: "+fmt.Sprintf("%#v", this.Actions)+",\n") - } - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ResourceLimits) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ResourceLimits{") - if this.OptionalNofile != nil { - s = append(s, "OptionalNofile: "+fmt.Sprintf("%#v", this.OptionalNofile)+",\n") - } - if this.OptionalNproc != nil { - s = append(s, "OptionalNproc: "+fmt.Sprintf("%#v", this.OptionalNproc)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ResourceLimits_Nofile) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&models.ResourceLimits_Nofile{` + - `Nofile:` + fmt.Sprintf("%#v", this.Nofile) + `}`}, ", ") - return s -} -func (this *ResourceLimits_Nproc) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&models.ResourceLimits_Nproc{` + - `Nproc:` + fmt.Sprintf("%#v", this.Nproc) + `}`}, ", ") - return s -} -func valueToGoStringActions(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *Action) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Action) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Action) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CodependentAction != nil { - { - size, err := m.CodependentAction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - if m.SerialAction != nil { - { - size, err := m.SerialAction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.ParallelAction != nil { - { - size, err := m.ParallelAction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.TryAction != nil { - { - size, err := m.TryAction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.EmitProgressAction != nil { - { - size, err := m.EmitProgressAction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.TimeoutAction != nil { - { - size, err := m.TimeoutAction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.RunAction != nil { - { - size, err := m.RunAction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.UploadAction != nil { - { - size, err := m.UploadAction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.DownloadAction != nil { - { - size, err := m.DownloadAction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DownloadAction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DownloadAction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DownloadAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChecksumValue) > 0 { - i -= len(m.ChecksumValue) - copy(dAtA[i:], m.ChecksumValue) - i = encodeVarintActions(dAtA, i, uint64(len(m.ChecksumValue))) - i-- - dAtA[i] = 0x42 - } - if len(m.ChecksumAlgorithm) > 0 { - i -= len(m.ChecksumAlgorithm) - copy(dAtA[i:], m.ChecksumAlgorithm) - i = encodeVarintActions(dAtA, i, uint64(len(m.ChecksumAlgorithm))) - i-- - dAtA[i] = 0x3a - } - if len(m.User) > 0 { - i -= len(m.User) - copy(dAtA[i:], m.User) - i = encodeVarintActions(dAtA, i, uint64(len(m.User))) - i-- - dAtA[i] = 0x32 - } - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintActions(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x2a - } - if len(m.CacheKey) > 0 { - i -= len(m.CacheKey) - copy(dAtA[i:], m.CacheKey) - i = encodeVarintActions(dAtA, i, uint64(len(m.CacheKey))) - i-- - dAtA[i] = 0x22 - } - if len(m.To) > 0 { - i -= len(m.To) - copy(dAtA[i:], m.To) - i = encodeVarintActions(dAtA, i, uint64(len(m.To))) - i-- - dAtA[i] = 0x1a - } - if len(m.From) > 0 { - i -= len(m.From) - copy(dAtA[i:], m.From) - i = encodeVarintActions(dAtA, i, uint64(len(m.From))) - i-- - dAtA[i] = 0x12 - } - if len(m.Artifact) > 0 { - i -= len(m.Artifact) - copy(dAtA[i:], m.Artifact) - i = encodeVarintActions(dAtA, i, uint64(len(m.Artifact))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UploadAction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UploadAction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UploadAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.User) > 0 { - i -= len(m.User) - copy(dAtA[i:], m.User) - i = encodeVarintActions(dAtA, i, uint64(len(m.User))) - i-- - dAtA[i] = 0x2a - } - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintActions(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x22 - } - if len(m.To) > 0 { - i -= len(m.To) - copy(dAtA[i:], m.To) - i = encodeVarintActions(dAtA, i, uint64(len(m.To))) - i-- - dAtA[i] = 0x1a - } - if len(m.From) > 0 { - i -= len(m.From) - copy(dAtA[i:], m.From) - i = encodeVarintActions(dAtA, i, uint64(len(m.From))) - i-- - dAtA[i] = 0x12 - } - if len(m.Artifact) > 0 { - i -= len(m.Artifact) - copy(dAtA[i:], m.Artifact) - i = encodeVarintActions(dAtA, i, uint64(len(m.Artifact))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RunAction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RunAction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RunAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.VolumeMountedFiles) > 0 { - for iNdEx := len(m.VolumeMountedFiles) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.VolumeMountedFiles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if m.SuppressLogOutput { - i-- - if m.SuppressLogOutput { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintActions(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x3a - } - if len(m.User) > 0 { - i -= len(m.User) - copy(dAtA[i:], m.User) - i = encodeVarintActions(dAtA, i, uint64(len(m.User))) - i-- - dAtA[i] = 0x32 - } - if m.ResourceLimits != nil { - { - size, err := m.ResourceLimits.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.Env) > 0 { - for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Env[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Dir) > 0 { - i -= len(m.Dir) - copy(dAtA[i:], m.Dir) - i = encodeVarintActions(dAtA, i, uint64(len(m.Dir))) - i-- - dAtA[i] = 0x1a - } - if len(m.Args) > 0 { - for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Args[iNdEx]) - copy(dAtA[i:], m.Args[iNdEx]) - i = encodeVarintActions(dAtA, i, uint64(len(m.Args[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintActions(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TimeoutAction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TimeoutAction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TimeoutAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TimeoutMs != 0 { - i = encodeVarintActions(dAtA, i, uint64(m.TimeoutMs)) - i-- - dAtA[i] = 0x20 - } - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintActions(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x1a - } - if m.DeprecatedTimeoutNs != 0 { - i = encodeVarintActions(dAtA, i, uint64(m.DeprecatedTimeoutNs)) - i-- - dAtA[i] = 0x10 - } - if m.Action != nil { - { - size, err := m.Action.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EmitProgressAction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EmitProgressAction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EmitProgressAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintActions(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x2a - } - if len(m.FailureMessagePrefix) > 0 { - i -= len(m.FailureMessagePrefix) - copy(dAtA[i:], m.FailureMessagePrefix) - i = encodeVarintActions(dAtA, i, uint64(len(m.FailureMessagePrefix))) - i-- - dAtA[i] = 0x22 - } - if len(m.SuccessMessage) > 0 { - i -= len(m.SuccessMessage) - copy(dAtA[i:], m.SuccessMessage) - i = encodeVarintActions(dAtA, i, uint64(len(m.SuccessMessage))) - i-- - dAtA[i] = 0x1a - } - if len(m.StartMessage) > 0 { - i -= len(m.StartMessage) - copy(dAtA[i:], m.StartMessage) - i = encodeVarintActions(dAtA, i, uint64(len(m.StartMessage))) - i-- - dAtA[i] = 0x12 - } - if m.Action != nil { - { - size, err := m.Action.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TryAction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TryAction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TryAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintActions(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x12 - } - if m.Action != nil { - { - size, err := m.Action.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ParallelAction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ParallelAction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ParallelAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintActions(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x12 - } - if len(m.Actions) > 0 { - for iNdEx := len(m.Actions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Actions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *SerialAction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SerialAction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SerialAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintActions(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x12 - } - if len(m.Actions) > 0 { - for iNdEx := len(m.Actions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Actions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *CodependentAction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CodependentAction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CodependentAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintActions(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x12 - } - if len(m.Actions) > 0 { - for iNdEx := len(m.Actions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Actions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActions(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ResourceLimits) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResourceLimits) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResourceLimits) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.OptionalNproc != nil { - { - size := m.OptionalNproc.Size() - i -= size - if _, err := m.OptionalNproc.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.OptionalNofile != nil { - { - size := m.OptionalNofile.Size() - i -= size - if _, err := m.OptionalNofile.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *ResourceLimits_Nofile) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResourceLimits_Nofile) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintActions(dAtA, i, uint64(m.Nofile)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} -func (m *ResourceLimits_Nproc) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResourceLimits_Nproc) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintActions(dAtA, i, uint64(m.Nproc)) - i-- - dAtA[i] = 0x10 - return len(dAtA) - i, nil -} -func encodeVarintActions(dAtA []byte, offset int, v uint64) int { - offset -= sovActions(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Action) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DownloadAction != nil { - l = m.DownloadAction.Size() - n += 1 + l + sovActions(uint64(l)) - } - if m.UploadAction != nil { - l = m.UploadAction.Size() - n += 1 + l + sovActions(uint64(l)) - } - if m.RunAction != nil { - l = m.RunAction.Size() - n += 1 + l + sovActions(uint64(l)) - } - if m.TimeoutAction != nil { - l = m.TimeoutAction.Size() - n += 1 + l + sovActions(uint64(l)) - } - if m.EmitProgressAction != nil { - l = m.EmitProgressAction.Size() - n += 1 + l + sovActions(uint64(l)) - } - if m.TryAction != nil { - l = m.TryAction.Size() - n += 1 + l + sovActions(uint64(l)) - } - if m.ParallelAction != nil { - l = m.ParallelAction.Size() - n += 1 + l + sovActions(uint64(l)) - } - if m.SerialAction != nil { - l = m.SerialAction.Size() - n += 1 + l + sovActions(uint64(l)) - } - if m.CodependentAction != nil { - l = m.CodependentAction.Size() - n += 1 + l + sovActions(uint64(l)) - } - return n -} - -func (m *DownloadAction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Artifact) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.From) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.To) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.CacheKey) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.LogSource) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.User) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.ChecksumAlgorithm) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.ChecksumValue) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - return n -} - -func (m *UploadAction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Artifact) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.From) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.To) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.LogSource) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.User) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - return n -} - -func (m *RunAction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Path) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - if len(m.Args) > 0 { - for _, s := range m.Args { - l = len(s) - n += 1 + l + sovActions(uint64(l)) - } - } - l = len(m.Dir) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - if len(m.Env) > 0 { - for _, e := range m.Env { - l = e.Size() - n += 1 + l + sovActions(uint64(l)) - } - } - if m.ResourceLimits != nil { - l = m.ResourceLimits.Size() - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.User) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.LogSource) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - if m.SuppressLogOutput { - n += 2 - } - if len(m.VolumeMountedFiles) > 0 { - for _, e := range m.VolumeMountedFiles { - l = e.Size() - n += 1 + l + sovActions(uint64(l)) - } - } - return n -} - -func (m *TimeoutAction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovActions(uint64(l)) - } - if m.DeprecatedTimeoutNs != 0 { - n += 1 + sovActions(uint64(m.DeprecatedTimeoutNs)) - } - l = len(m.LogSource) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - if m.TimeoutMs != 0 { - n += 1 + sovActions(uint64(m.TimeoutMs)) - } - return n -} - -func (m *EmitProgressAction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.StartMessage) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.SuccessMessage) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.FailureMessagePrefix) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.LogSource) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - return n -} - -func (m *TryAction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovActions(uint64(l)) - } - l = len(m.LogSource) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - return n -} - -func (m *ParallelAction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Actions) > 0 { - for _, e := range m.Actions { - l = e.Size() - n += 1 + l + sovActions(uint64(l)) - } - } - l = len(m.LogSource) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - return n -} - -func (m *SerialAction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Actions) > 0 { - for _, e := range m.Actions { - l = e.Size() - n += 1 + l + sovActions(uint64(l)) - } - } - l = len(m.LogSource) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - return n -} - -func (m *CodependentAction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Actions) > 0 { - for _, e := range m.Actions { - l = e.Size() - n += 1 + l + sovActions(uint64(l)) - } - } - l = len(m.LogSource) - if l > 0 { - n += 1 + l + sovActions(uint64(l)) - } - return n -} - -func (m *ResourceLimits) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.OptionalNofile != nil { - n += m.OptionalNofile.Size() - } - if m.OptionalNproc != nil { - n += m.OptionalNproc.Size() - } - return n -} - -func (m *ResourceLimits_Nofile) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovActions(uint64(m.Nofile)) - return n -} -func (m *ResourceLimits_Nproc) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovActions(uint64(m.Nproc)) - return n -} - -func sovActions(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozActions(x uint64) (n int) { - return sovActions(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Action) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Action{`, - `DownloadAction:` + strings.Replace(this.DownloadAction.String(), "DownloadAction", "DownloadAction", 1) + `,`, - `UploadAction:` + strings.Replace(this.UploadAction.String(), "UploadAction", "UploadAction", 1) + `,`, - `RunAction:` + strings.Replace(this.RunAction.String(), "RunAction", "RunAction", 1) + `,`, - `TimeoutAction:` + strings.Replace(this.TimeoutAction.String(), "TimeoutAction", "TimeoutAction", 1) + `,`, - `EmitProgressAction:` + strings.Replace(this.EmitProgressAction.String(), "EmitProgressAction", "EmitProgressAction", 1) + `,`, - `TryAction:` + strings.Replace(this.TryAction.String(), "TryAction", "TryAction", 1) + `,`, - `ParallelAction:` + strings.Replace(this.ParallelAction.String(), "ParallelAction", "ParallelAction", 1) + `,`, - `SerialAction:` + strings.Replace(this.SerialAction.String(), "SerialAction", "SerialAction", 1) + `,`, - `CodependentAction:` + strings.Replace(this.CodependentAction.String(), "CodependentAction", "CodependentAction", 1) + `,`, - `}`, - }, "") - return s -} -func (this *DownloadAction) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DownloadAction{`, - `Artifact:` + fmt.Sprintf("%v", this.Artifact) + `,`, - `From:` + fmt.Sprintf("%v", this.From) + `,`, - `To:` + fmt.Sprintf("%v", this.To) + `,`, - `CacheKey:` + fmt.Sprintf("%v", this.CacheKey) + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `User:` + fmt.Sprintf("%v", this.User) + `,`, - `ChecksumAlgorithm:` + fmt.Sprintf("%v", this.ChecksumAlgorithm) + `,`, - `ChecksumValue:` + fmt.Sprintf("%v", this.ChecksumValue) + `,`, - `}`, - }, "") - return s -} -func (this *UploadAction) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UploadAction{`, - `Artifact:` + fmt.Sprintf("%v", this.Artifact) + `,`, - `From:` + fmt.Sprintf("%v", this.From) + `,`, - `To:` + fmt.Sprintf("%v", this.To) + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `User:` + fmt.Sprintf("%v", this.User) + `,`, - `}`, - }, "") - return s -} -func (this *RunAction) String() string { - if this == nil { - return "nil" - } - repeatedStringForEnv := "[]*EnvironmentVariable{" - for _, f := range this.Env { - repeatedStringForEnv += strings.Replace(fmt.Sprintf("%v", f), "EnvironmentVariable", "EnvironmentVariable", 1) + "," - } - repeatedStringForEnv += "}" - repeatedStringForVolumeMountedFiles := "[]*File{" - for _, f := range this.VolumeMountedFiles { - repeatedStringForVolumeMountedFiles += strings.Replace(fmt.Sprintf("%v", f), "File", "File", 1) + "," - } - repeatedStringForVolumeMountedFiles += "}" - s := strings.Join([]string{`&RunAction{`, - `Path:` + fmt.Sprintf("%v", this.Path) + `,`, - `Args:` + fmt.Sprintf("%v", this.Args) + `,`, - `Dir:` + fmt.Sprintf("%v", this.Dir) + `,`, - `Env:` + repeatedStringForEnv + `,`, - `ResourceLimits:` + strings.Replace(this.ResourceLimits.String(), "ResourceLimits", "ResourceLimits", 1) + `,`, - `User:` + fmt.Sprintf("%v", this.User) + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `SuppressLogOutput:` + fmt.Sprintf("%v", this.SuppressLogOutput) + `,`, - `VolumeMountedFiles:` + repeatedStringForVolumeMountedFiles + `,`, - `}`, - }, "") - return s -} -func (this *TimeoutAction) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TimeoutAction{`, - `Action:` + strings.Replace(this.Action.String(), "Action", "Action", 1) + `,`, - `DeprecatedTimeoutNs:` + fmt.Sprintf("%v", this.DeprecatedTimeoutNs) + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `TimeoutMs:` + fmt.Sprintf("%v", this.TimeoutMs) + `,`, - `}`, - }, "") - return s -} -func (this *EmitProgressAction) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&EmitProgressAction{`, - `Action:` + strings.Replace(this.Action.String(), "Action", "Action", 1) + `,`, - `StartMessage:` + fmt.Sprintf("%v", this.StartMessage) + `,`, - `SuccessMessage:` + fmt.Sprintf("%v", this.SuccessMessage) + `,`, - `FailureMessagePrefix:` + fmt.Sprintf("%v", this.FailureMessagePrefix) + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `}`, - }, "") - return s -} -func (this *TryAction) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TryAction{`, - `Action:` + strings.Replace(this.Action.String(), "Action", "Action", 1) + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `}`, - }, "") - return s -} -func (this *ParallelAction) String() string { - if this == nil { - return "nil" - } - repeatedStringForActions := "[]*Action{" - for _, f := range this.Actions { - repeatedStringForActions += strings.Replace(f.String(), "Action", "Action", 1) + "," - } - repeatedStringForActions += "}" - s := strings.Join([]string{`&ParallelAction{`, - `Actions:` + repeatedStringForActions + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `}`, - }, "") - return s -} -func (this *SerialAction) String() string { - if this == nil { - return "nil" - } - repeatedStringForActions := "[]*Action{" - for _, f := range this.Actions { - repeatedStringForActions += strings.Replace(f.String(), "Action", "Action", 1) + "," - } - repeatedStringForActions += "}" - s := strings.Join([]string{`&SerialAction{`, - `Actions:` + repeatedStringForActions + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `}`, - }, "") - return s -} -func (this *CodependentAction) String() string { - if this == nil { - return "nil" - } - repeatedStringForActions := "[]*Action{" - for _, f := range this.Actions { - repeatedStringForActions += strings.Replace(f.String(), "Action", "Action", 1) + "," - } - repeatedStringForActions += "}" - s := strings.Join([]string{`&CodependentAction{`, - `Actions:` + repeatedStringForActions + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceLimits) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceLimits{`, - `OptionalNofile:` + fmt.Sprintf("%v", this.OptionalNofile) + `,`, - `OptionalNproc:` + fmt.Sprintf("%v", this.OptionalNproc) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceLimits_Nofile) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceLimits_Nofile{`, - `Nofile:` + fmt.Sprintf("%v", this.Nofile) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceLimits_Nproc) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceLimits_Nproc{`, - `Nproc:` + fmt.Sprintf("%v", this.Nproc) + `,`, - `}`, - }, "") - return s -} -func valueToStringActions(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Action) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Action: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Action: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DownloadAction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DownloadAction == nil { - m.DownloadAction = &DownloadAction{} - } - if err := m.DownloadAction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UploadAction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.UploadAction == nil { - m.UploadAction = &UploadAction{} - } - if err := m.UploadAction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RunAction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RunAction == nil { - m.RunAction = &RunAction{} - } - if err := m.RunAction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutAction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TimeoutAction == nil { - m.TimeoutAction = &TimeoutAction{} - } - if err := m.TimeoutAction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EmitProgressAction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.EmitProgressAction == nil { - m.EmitProgressAction = &EmitProgressAction{} - } - if err := m.EmitProgressAction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TryAction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TryAction == nil { - m.TryAction = &TryAction{} - } - if err := m.TryAction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParallelAction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ParallelAction == nil { - m.ParallelAction = &ParallelAction{} - } - if err := m.ParallelAction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SerialAction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SerialAction == nil { - m.SerialAction = &SerialAction{} - } - if err := m.SerialAction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CodependentAction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CodependentAction == nil { - m.CodependentAction = &CodependentAction{} - } - if err := m.CodependentAction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActions(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DownloadAction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DownloadAction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DownloadAction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Artifact", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Artifact = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.From = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.To = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CacheKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CacheKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.User = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChecksumAlgorithm", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChecksumAlgorithm = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChecksumValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChecksumValue = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActions(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UploadAction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UploadAction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UploadAction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Artifact", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Artifact = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.From = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.To = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.User = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActions(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RunAction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RunAction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RunAction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dir", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Dir = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Env = append(m.Env, &EnvironmentVariable{}) - if err := m.Env[len(m.Env)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceLimits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ResourceLimits == nil { - m.ResourceLimits = &ResourceLimits{} - } - if err := m.ResourceLimits.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.User = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SuppressLogOutput", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SuppressLogOutput = bool(v != 0) - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeMountedFiles", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VolumeMountedFiles = append(m.VolumeMountedFiles, &File{}) - if err := m.VolumeMountedFiles[len(m.VolumeMountedFiles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActions(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TimeoutAction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TimeoutAction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TimeoutAction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedTimeoutNs", wireType) - } - m.DeprecatedTimeoutNs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DeprecatedTimeoutNs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutMs", wireType) - } - m.TimeoutMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeoutMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipActions(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EmitProgressAction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EmitProgressAction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EmitProgressAction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartMessage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StartMessage = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SuccessMessage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SuccessMessage = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FailureMessagePrefix", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FailureMessagePrefix = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActions(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TryAction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TryAction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TryAction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActions(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ParallelAction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ParallelAction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ParallelAction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Actions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Actions = append(m.Actions, &Action{}) - if err := m.Actions[len(m.Actions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActions(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SerialAction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SerialAction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SerialAction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Actions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Actions = append(m.Actions, &Action{}) - if err := m.Actions[len(m.Actions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActions(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CodependentAction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CodependentAction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CodependentAction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Actions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Actions = append(m.Actions, &Action{}) - if err := m.Actions[len(m.Actions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActions(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResourceLimits) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResourceLimits: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceLimits: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Nofile", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.OptionalNofile = &ResourceLimits_Nofile{v} - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Nproc", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.OptionalNproc = &ResourceLimits_Nproc{v} - default: - iNdEx = preIndex - skippy, err := skipActions(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipActions(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowActions - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowActions - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowActions - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthActions - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupActions - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthActions - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthActions = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowActions = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupActions = fmt.Errorf("proto: unexpected end of group") -) diff --git a/models/actions.proto b/models/actions.proto index ab462358..12ccb2f4 100644 --- a/models/actions.proto +++ b/models/actions.proto @@ -1,12 +1,13 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; import "environment_variables.proto"; import "file.proto"; -message Action { +message ProtoAction { // Note: we only expect one of the following set of fields to be // set. Previously we used `option (gogoproto.onlyone) = true' but since this // is now deprecated and oneof introduces a lot of structural changes, we @@ -16,89 +17,85 @@ message Action { // disadvantages of using multiple optionals without onlyone: // - writing our own GetAction/SetAction methods // action oneof { - DownloadAction download_action = 1 [(gogoproto.jsontag) = "download,omitempty"]; - UploadAction upload_action = 2 [(gogoproto.jsontag) = "upload,omitempty"]; - RunAction run_action = 3 [(gogoproto.jsontag) = "run,omitempty"]; - TimeoutAction timeout_action = 4 [(gogoproto.jsontag) = "timeout,omitempty"]; - EmitProgressAction emit_progress_action = 5 [(gogoproto.jsontag) = "emit_progress,omitempty"]; - TryAction try_action = 6 [(gogoproto.jsontag) = "try,omitempty"]; - ParallelAction parallel_action = 7 [(gogoproto.jsontag) = "parallel,omitempty"]; - SerialAction serial_action = 8 [(gogoproto.jsontag) = "serial,omitempty"]; - CodependentAction codependent_action = 9 [(gogoproto.jsontag) = "codependent,omitempty"]; + ProtoDownloadAction download_action = 1 [json_name="download"]; + ProtoUploadAction upload_action = 2 [json_name = "upload"]; + ProtoRunAction run_action = 3 [json_name = "run"]; + ProtoTimeoutAction timeout_action = 4 [json_name = "timeout"]; + ProtoEmitProgressAction emit_progress_action = 5 [json_name = "emit_progress"]; + ProtoTryAction try_action = 6 [json_name = "try"]; + ProtoParallelAction parallel_action = 7 [json_name = "parallel"]; + ProtoSerialAction serial_action = 8 [json_name = "serial"]; + ProtoCodependentAction codependent_action = 9 [json_name = "codependent"]; // } } -message DownloadAction { +message ProtoDownloadAction { string artifact = 1; - string from = 2 [(gogoproto.jsontag) = "from"]; - string to = 3 [(gogoproto.jsontag) = "to"]; - string cache_key = 4 [(gogoproto.jsontag) = "cache_key"]; - string log_source = 5; - string user = 6 [(gogoproto.jsontag) = "user"] ; - string checksum_algorithm = 7; - string checksum_value = 8; + string from = 2 [json_name = "from", (bbs.bbs_json_always_emit) = true]; + string to = 3 [json_name = "to", (bbs.bbs_json_always_emit) = true]; + string cache_key = 4 [json_name = "cache_key", (bbs.bbs_json_always_emit) = true]; + string log_source = 5 [json_name = "log_source"]; + string user = 6 [json_name = "user", (bbs.bbs_json_always_emit) = true]; + string checksum_algorithm = 7 [json_name = "checksum_algorithm"]; + string checksum_value = 8 [json_name = "checksum_value"]; } -message UploadAction { +message ProtoUploadAction { string artifact = 1; - string from = 2 [(gogoproto.jsontag) = "from"]; - string to = 3 [(gogoproto.jsontag) = "to"]; - string log_source = 4; - string user = 5 [(gogoproto.jsontag) = "user"]; + string from = 2 [json_name = "from", (bbs.bbs_json_always_emit) = true]; + string to = 3 [json_name = "to", (bbs.bbs_json_always_emit) = true]; + string log_source = 4 [json_name = "log_source"]; + string user = 5 [json_name = "user", (bbs.bbs_json_always_emit) = true]; } -message RunAction { - string path = 1 [(gogoproto.jsontag) = "path"]; +message ProtoRunAction { + string path = 1 [json_name = "path", (bbs.bbs_json_always_emit) = true]; repeated string args = 2; string dir = 3; - repeated EnvironmentVariable env = 4; - ResourceLimits resource_limits = 5; - string user = 6 [(gogoproto.jsontag) = "user"]; - string log_source = 7; - bool suppress_log_output = 8 [(gogoproto.jsontag) = "suppress_log_output"]; - repeated File volume_mounted_files = 9 [(gogoproto.jsontag) = "volume_mounted_files"]; + repeated ProtoEnvironmentVariable env = 4; + ProtoResourceLimits resource_limits = 5 [json_name = "resource_limits"]; + string user = 6 [json_name = "user", (bbs.bbs_json_always_emit) = true]; + string log_source = 7 [json_name = "log_source"]; + bool suppress_log_output = 8 [json_name = "suppress_log_output", (bbs.bbs_json_always_emit) = true]; + repeated ProtoFile volume_mounted_files = 9 [json_name = "volume_mounted_files", (bbs.bbs_json_always_emit) = true]; } -message TimeoutAction { - Action action = 1; - int64 deprecated_timeout_ns = 2 [(gogoproto.jsontag) = "timeout,omitempty", deprecated=true]; - string log_source = 3; - int64 timeout_ms = 4 [(gogoproto.jsontag) = "timeout_ms"]; +message ProtoTimeoutAction { + ProtoAction action = 1; + int64 deprecated_timeout_ns = 2 [json_name = "timeout", deprecated=true]; + string log_source = 3 [json_name = "log_source"]; + int64 timeout_ms = 4 [json_name = "timeout_ms", (bbs.bbs_json_always_emit) = true]; } -message EmitProgressAction { - Action action = 1; - string start_message = 2 [(gogoproto.jsontag) = "start_message"]; - string success_message = 3 [(gogoproto.jsontag) = "success_message"]; - string failure_message_prefix = 4 [(gogoproto.jsontag) = "failure_message_prefix"]; - string log_source = 5; +message ProtoEmitProgressAction { + ProtoAction action = 1; + string start_message = 2 [json_name = "start_message", (bbs.bbs_json_always_emit) = true]; + string success_message = 3 [json_name = "success_message", (bbs.bbs_json_always_emit) = true]; + string failure_message_prefix = 4 [json_name = "failure_message_prefix", (bbs.bbs_json_always_emit) = true]; + string log_source = 5 [json_name = "log_source"]; } -message TryAction { - Action action = 1; - string log_source = 2; +message ProtoTryAction { + ProtoAction action = 1; + string log_source = 2 [json_name = "log_source"]; } -message ParallelAction { - repeated Action actions = 1; - string log_source = 2; +message ProtoParallelAction { + repeated ProtoAction actions = 1; + string log_source = 2 [json_name = "log_source"]; } -message SerialAction { - repeated Action actions = 1; - string log_source = 2; +message ProtoSerialAction { + repeated ProtoAction actions = 1; + string log_source = 2 [json_name = "log_source"]; } -message CodependentAction { - repeated Action actions = 1; - string log_source = 2; +message ProtoCodependentAction { + repeated ProtoAction actions = 1; + string log_source = 2 [json_name = "log_source"]; } -message ResourceLimits { - oneof optional_nofile { - uint64 nofile = 1; - } - oneof optional_nproc { - uint64 nproc = 2 [deprecated=true]; - } +message ProtoResourceLimits { + optional uint64 nofile = 1 [(bbs.bbs_default_value) = "nil"]; + optional uint64 nproc = 2 [deprecated = true, (bbs.bbs_default_value) = "nil"]; } diff --git a/models/actions_bbs.pb.go b/models/actions_bbs.pb.go new file mode 100644 index 00000000..7c451576 --- /dev/null +++ b/models/actions_bbs.pb.go @@ -0,0 +1,1815 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: actions.proto + +package models + +// Prevent copylock errors when using ProtoAction directly +type Action struct { + DownloadAction *DownloadAction `json:"download,omitempty"` + UploadAction *UploadAction `json:"upload,omitempty"` + RunAction *RunAction `json:"run,omitempty"` + TimeoutAction *TimeoutAction `json:"timeout,omitempty"` + EmitProgressAction *EmitProgressAction `json:"emit_progress,omitempty"` + TryAction *TryAction `json:"try,omitempty"` + ParallelAction *ParallelAction `json:"parallel,omitempty"` + SerialAction *SerialAction `json:"serial,omitempty"` + CodependentAction *CodependentAction `json:"codependent,omitempty"` +} + +func (this *Action) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*Action) + if !ok { + that2, ok := that.(Action) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.DownloadAction == nil { + if that1.DownloadAction != nil { + return false + } + } else if !this.DownloadAction.Equal(*that1.DownloadAction) { + return false + } + if this.UploadAction == nil { + if that1.UploadAction != nil { + return false + } + } else if !this.UploadAction.Equal(*that1.UploadAction) { + return false + } + if this.RunAction == nil { + if that1.RunAction != nil { + return false + } + } else if !this.RunAction.Equal(*that1.RunAction) { + return false + } + if this.TimeoutAction == nil { + if that1.TimeoutAction != nil { + return false + } + } else if !this.TimeoutAction.Equal(*that1.TimeoutAction) { + return false + } + if this.EmitProgressAction == nil { + if that1.EmitProgressAction != nil { + return false + } + } else if !this.EmitProgressAction.Equal(*that1.EmitProgressAction) { + return false + } + if this.TryAction == nil { + if that1.TryAction != nil { + return false + } + } else if !this.TryAction.Equal(*that1.TryAction) { + return false + } + if this.ParallelAction == nil { + if that1.ParallelAction != nil { + return false + } + } else if !this.ParallelAction.Equal(*that1.ParallelAction) { + return false + } + if this.SerialAction == nil { + if that1.SerialAction != nil { + return false + } + } else if !this.SerialAction.Equal(*that1.SerialAction) { + return false + } + if this.CodependentAction == nil { + if that1.CodependentAction != nil { + return false + } + } else if !this.CodependentAction.Equal(*that1.CodependentAction) { + return false + } + return true +} +func (m *Action) GetDownloadAction() *DownloadAction { + if m != nil { + return m.DownloadAction + } + return nil +} +func (m *Action) SetDownloadAction(value *DownloadAction) { + if m != nil { + m.DownloadAction = value + } +} +func (m *Action) GetUploadAction() *UploadAction { + if m != nil { + return m.UploadAction + } + return nil +} +func (m *Action) SetUploadAction(value *UploadAction) { + if m != nil { + m.UploadAction = value + } +} +func (m *Action) GetRunAction() *RunAction { + if m != nil { + return m.RunAction + } + return nil +} +func (m *Action) SetRunAction(value *RunAction) { + if m != nil { + m.RunAction = value + } +} +func (m *Action) GetTimeoutAction() *TimeoutAction { + if m != nil { + return m.TimeoutAction + } + return nil +} +func (m *Action) SetTimeoutAction(value *TimeoutAction) { + if m != nil { + m.TimeoutAction = value + } +} +func (m *Action) GetEmitProgressAction() *EmitProgressAction { + if m != nil { + return m.EmitProgressAction + } + return nil +} +func (m *Action) SetEmitProgressAction(value *EmitProgressAction) { + if m != nil { + m.EmitProgressAction = value + } +} +func (m *Action) GetTryAction() *TryAction { + if m != nil { + return m.TryAction + } + return nil +} +func (m *Action) SetTryAction(value *TryAction) { + if m != nil { + m.TryAction = value + } +} +func (m *Action) GetParallelAction() *ParallelAction { + if m != nil { + return m.ParallelAction + } + return nil +} +func (m *Action) SetParallelAction(value *ParallelAction) { + if m != nil { + m.ParallelAction = value + } +} +func (m *Action) GetSerialAction() *SerialAction { + if m != nil { + return m.SerialAction + } + return nil +} +func (m *Action) SetSerialAction(value *SerialAction) { + if m != nil { + m.SerialAction = value + } +} +func (m *Action) GetCodependentAction() *CodependentAction { + if m != nil { + return m.CodependentAction + } + return nil +} +func (m *Action) SetCodependentAction(value *CodependentAction) { + if m != nil { + m.CodependentAction = value + } +} +func (x *Action) ToProto() *ProtoAction { + if x == nil { + return nil + } + + proto := &ProtoAction{ + DownloadAction: x.DownloadAction.ToProto(), + UploadAction: x.UploadAction.ToProto(), + RunAction: x.RunAction.ToProto(), + TimeoutAction: x.TimeoutAction.ToProto(), + EmitProgressAction: x.EmitProgressAction.ToProto(), + TryAction: x.TryAction.ToProto(), + ParallelAction: x.ParallelAction.ToProto(), + SerialAction: x.SerialAction.ToProto(), + CodependentAction: x.CodependentAction.ToProto(), + } + return proto +} + +func (x *ProtoAction) FromProto() *Action { + if x == nil { + return nil + } + + copysafe := &Action{ + DownloadAction: x.DownloadAction.FromProto(), + UploadAction: x.UploadAction.FromProto(), + RunAction: x.RunAction.FromProto(), + TimeoutAction: x.TimeoutAction.FromProto(), + EmitProgressAction: x.EmitProgressAction.FromProto(), + TryAction: x.TryAction.FromProto(), + ParallelAction: x.ParallelAction.FromProto(), + SerialAction: x.SerialAction.FromProto(), + CodependentAction: x.CodependentAction.FromProto(), + } + return copysafe +} + +func ActionToProtoSlice(values []*Action) []*ProtoAction { + if values == nil { + return nil + } + result := make([]*ProtoAction, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActionFromProtoSlice(values []*ProtoAction) []*Action { + if values == nil { + return nil + } + result := make([]*Action, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDownloadAction directly +type DownloadAction struct { + Artifact string `json:"artifact,omitempty"` + From string `json:"from"` + To string `json:"to"` + CacheKey string `json:"cache_key"` + LogSource string `json:"log_source,omitempty"` + User string `json:"user"` + ChecksumAlgorithm string `json:"checksum_algorithm,omitempty"` + ChecksumValue string `json:"checksum_value,omitempty"` +} + +func (this *DownloadAction) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DownloadAction) + if !ok { + that2, ok := that.(DownloadAction) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Artifact != that1.Artifact { + return false + } + if this.From != that1.From { + return false + } + if this.To != that1.To { + return false + } + if this.CacheKey != that1.CacheKey { + return false + } + if this.LogSource != that1.LogSource { + return false + } + if this.User != that1.User { + return false + } + if this.ChecksumAlgorithm != that1.ChecksumAlgorithm { + return false + } + if this.ChecksumValue != that1.ChecksumValue { + return false + } + return true +} +func (m *DownloadAction) GetArtifact() string { + if m != nil { + return m.Artifact + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DownloadAction) SetArtifact(value string) { + if m != nil { + m.Artifact = value + } +} +func (m *DownloadAction) GetFrom() string { + if m != nil { + return m.From + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DownloadAction) SetFrom(value string) { + if m != nil { + m.From = value + } +} +func (m *DownloadAction) GetTo() string { + if m != nil { + return m.To + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DownloadAction) SetTo(value string) { + if m != nil { + m.To = value + } +} +func (m *DownloadAction) GetCacheKey() string { + if m != nil { + return m.CacheKey + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DownloadAction) SetCacheKey(value string) { + if m != nil { + m.CacheKey = value + } +} +func (m *DownloadAction) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DownloadAction) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} +func (m *DownloadAction) GetUser() string { + if m != nil { + return m.User + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DownloadAction) SetUser(value string) { + if m != nil { + m.User = value + } +} +func (m *DownloadAction) GetChecksumAlgorithm() string { + if m != nil { + return m.ChecksumAlgorithm + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DownloadAction) SetChecksumAlgorithm(value string) { + if m != nil { + m.ChecksumAlgorithm = value + } +} +func (m *DownloadAction) GetChecksumValue() string { + if m != nil { + return m.ChecksumValue + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DownloadAction) SetChecksumValue(value string) { + if m != nil { + m.ChecksumValue = value + } +} +func (x *DownloadAction) ToProto() *ProtoDownloadAction { + if x == nil { + return nil + } + + proto := &ProtoDownloadAction{ + Artifact: x.Artifact, + From: x.From, + To: x.To, + CacheKey: x.CacheKey, + LogSource: x.LogSource, + User: x.User, + ChecksumAlgorithm: x.ChecksumAlgorithm, + ChecksumValue: x.ChecksumValue, + } + return proto +} + +func (x *ProtoDownloadAction) FromProto() *DownloadAction { + if x == nil { + return nil + } + + copysafe := &DownloadAction{ + Artifact: x.Artifact, + From: x.From, + To: x.To, + CacheKey: x.CacheKey, + LogSource: x.LogSource, + User: x.User, + ChecksumAlgorithm: x.ChecksumAlgorithm, + ChecksumValue: x.ChecksumValue, + } + return copysafe +} + +func DownloadActionToProtoSlice(values []*DownloadAction) []*ProtoDownloadAction { + if values == nil { + return nil + } + result := make([]*ProtoDownloadAction, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DownloadActionFromProtoSlice(values []*ProtoDownloadAction) []*DownloadAction { + if values == nil { + return nil + } + result := make([]*DownloadAction, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoUploadAction directly +type UploadAction struct { + Artifact string `json:"artifact,omitempty"` + From string `json:"from"` + To string `json:"to"` + LogSource string `json:"log_source,omitempty"` + User string `json:"user"` +} + +func (this *UploadAction) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*UploadAction) + if !ok { + that2, ok := that.(UploadAction) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Artifact != that1.Artifact { + return false + } + if this.From != that1.From { + return false + } + if this.To != that1.To { + return false + } + if this.LogSource != that1.LogSource { + return false + } + if this.User != that1.User { + return false + } + return true +} +func (m *UploadAction) GetArtifact() string { + if m != nil { + return m.Artifact + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *UploadAction) SetArtifact(value string) { + if m != nil { + m.Artifact = value + } +} +func (m *UploadAction) GetFrom() string { + if m != nil { + return m.From + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *UploadAction) SetFrom(value string) { + if m != nil { + m.From = value + } +} +func (m *UploadAction) GetTo() string { + if m != nil { + return m.To + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *UploadAction) SetTo(value string) { + if m != nil { + m.To = value + } +} +func (m *UploadAction) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *UploadAction) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} +func (m *UploadAction) GetUser() string { + if m != nil { + return m.User + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *UploadAction) SetUser(value string) { + if m != nil { + m.User = value + } +} +func (x *UploadAction) ToProto() *ProtoUploadAction { + if x == nil { + return nil + } + + proto := &ProtoUploadAction{ + Artifact: x.Artifact, + From: x.From, + To: x.To, + LogSource: x.LogSource, + User: x.User, + } + return proto +} + +func (x *ProtoUploadAction) FromProto() *UploadAction { + if x == nil { + return nil + } + + copysafe := &UploadAction{ + Artifact: x.Artifact, + From: x.From, + To: x.To, + LogSource: x.LogSource, + User: x.User, + } + return copysafe +} + +func UploadActionToProtoSlice(values []*UploadAction) []*ProtoUploadAction { + if values == nil { + return nil + } + result := make([]*ProtoUploadAction, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func UploadActionFromProtoSlice(values []*ProtoUploadAction) []*UploadAction { + if values == nil { + return nil + } + result := make([]*UploadAction, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoRunAction directly +type RunAction struct { + Path string `json:"path"` + Args []string `json:"args,omitempty"` + Dir string `json:"dir,omitempty"` + Env []*EnvironmentVariable `json:"env,omitempty"` + ResourceLimits *ResourceLimits `json:"resource_limits,omitempty"` + User string `json:"user"` + LogSource string `json:"log_source,omitempty"` + SuppressLogOutput bool `json:"suppress_log_output"` + VolumeMountedFiles []*File `json:"volume_mounted_files"` +} + +func (this *RunAction) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*RunAction) + if !ok { + that2, ok := that.(RunAction) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Path != that1.Path { + return false + } + if this.Args == nil { + if that1.Args != nil { + return false + } + } else if len(this.Args) != len(that1.Args) { + return false + } + for i := range this.Args { + if this.Args[i] != that1.Args[i] { + return false + } + } + if this.Dir != that1.Dir { + return false + } + if this.Env == nil { + if that1.Env != nil { + return false + } + } else if len(this.Env) != len(that1.Env) { + return false + } + for i := range this.Env { + if !this.Env[i].Equal(that1.Env[i]) { + return false + } + } + if this.ResourceLimits == nil { + if that1.ResourceLimits != nil { + return false + } + } else if !this.ResourceLimits.Equal(*that1.ResourceLimits) { + return false + } + if this.User != that1.User { + return false + } + if this.LogSource != that1.LogSource { + return false + } + if this.SuppressLogOutput != that1.SuppressLogOutput { + return false + } + if this.VolumeMountedFiles == nil { + if that1.VolumeMountedFiles != nil { + return false + } + } else if len(this.VolumeMountedFiles) != len(that1.VolumeMountedFiles) { + return false + } + for i := range this.VolumeMountedFiles { + if !this.VolumeMountedFiles[i].Equal(that1.VolumeMountedFiles[i]) { + return false + } + } + return true +} +func (m *RunAction) GetPath() string { + if m != nil { + return m.Path + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *RunAction) SetPath(value string) { + if m != nil { + m.Path = value + } +} +func (m *RunAction) GetArgs() []string { + if m != nil { + return m.Args + } + return nil +} +func (m *RunAction) SetArgs(value []string) { + if m != nil { + m.Args = value + } +} +func (m *RunAction) GetDir() string { + if m != nil { + return m.Dir + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *RunAction) SetDir(value string) { + if m != nil { + m.Dir = value + } +} +func (m *RunAction) GetEnv() []*EnvironmentVariable { + if m != nil { + return m.Env + } + return nil +} +func (m *RunAction) SetEnv(value []*EnvironmentVariable) { + if m != nil { + m.Env = value + } +} +func (m *RunAction) GetResourceLimits() *ResourceLimits { + if m != nil { + return m.ResourceLimits + } + return nil +} +func (m *RunAction) SetResourceLimits(value *ResourceLimits) { + if m != nil { + m.ResourceLimits = value + } +} +func (m *RunAction) GetUser() string { + if m != nil { + return m.User + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *RunAction) SetUser(value string) { + if m != nil { + m.User = value + } +} +func (m *RunAction) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *RunAction) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} +func (m *RunAction) GetSuppressLogOutput() bool { + if m != nil { + return m.SuppressLogOutput + } + var defaultValue bool + defaultValue = false + return defaultValue +} +func (m *RunAction) SetSuppressLogOutput(value bool) { + if m != nil { + m.SuppressLogOutput = value + } +} +func (m *RunAction) GetVolumeMountedFiles() []*File { + if m != nil { + return m.VolumeMountedFiles + } + return nil +} +func (m *RunAction) SetVolumeMountedFiles(value []*File) { + if m != nil { + m.VolumeMountedFiles = value + } +} +func (x *RunAction) ToProto() *ProtoRunAction { + if x == nil { + return nil + } + + proto := &ProtoRunAction{ + Path: x.Path, + Args: x.Args, + Dir: x.Dir, + Env: EnvironmentVariableToProtoSlice(x.Env), + ResourceLimits: x.ResourceLimits.ToProto(), + User: x.User, + LogSource: x.LogSource, + SuppressLogOutput: x.SuppressLogOutput, + VolumeMountedFiles: FileToProtoSlice(x.VolumeMountedFiles), + } + return proto +} + +func (x *ProtoRunAction) FromProto() *RunAction { + if x == nil { + return nil + } + + copysafe := &RunAction{ + Path: x.Path, + Args: x.Args, + Dir: x.Dir, + Env: EnvironmentVariableFromProtoSlice(x.Env), + ResourceLimits: x.ResourceLimits.FromProto(), + User: x.User, + LogSource: x.LogSource, + SuppressLogOutput: x.SuppressLogOutput, + VolumeMountedFiles: FileFromProtoSlice(x.VolumeMountedFiles), + } + return copysafe +} + +func RunActionToProtoSlice(values []*RunAction) []*ProtoRunAction { + if values == nil { + return nil + } + result := make([]*ProtoRunAction, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func RunActionFromProtoSlice(values []*ProtoRunAction) []*RunAction { + if values == nil { + return nil + } + result := make([]*RunAction, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoTimeoutAction directly +type TimeoutAction struct { + Action *Action `json:"action,omitempty"` + // Deprecated: marked deprecated in actions.proto + DeprecatedTimeoutNs int64 `json:"timeout,omitempty"` + LogSource string `json:"log_source,omitempty"` + TimeoutMs int64 `json:"timeout_ms"` +} + +func (this *TimeoutAction) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TimeoutAction) + if !ok { + that2, ok := that.(TimeoutAction) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Action == nil { + if that1.Action != nil { + return false + } + } else if !this.Action.Equal(*that1.Action) { + return false + } + if this.DeprecatedTimeoutNs != that1.DeprecatedTimeoutNs { + return false + } + if this.LogSource != that1.LogSource { + return false + } + if this.TimeoutMs != that1.TimeoutMs { + return false + } + return true +} +func (m *TimeoutAction) GetAction() *Action { + if m != nil { + return m.Action + } + return nil +} +func (m *TimeoutAction) SetAction(value *Action) { + if m != nil { + m.Action = value + } +} + +// Deprecated: marked deprecated in actions.proto +func (m *TimeoutAction) GetDeprecatedTimeoutNs() int64 { + if m != nil { + return m.DeprecatedTimeoutNs + } + var defaultValue int64 + defaultValue = 0 + return defaultValue +} + +// Deprecated: marked deprecated in actions.proto +func (m *TimeoutAction) SetDeprecatedTimeoutNs(value int64) { + if m != nil { + m.DeprecatedTimeoutNs = value + } +} +func (m *TimeoutAction) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TimeoutAction) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} +func (m *TimeoutAction) GetTimeoutMs() int64 { + if m != nil { + return m.TimeoutMs + } + var defaultValue int64 + defaultValue = 0 + return defaultValue +} +func (m *TimeoutAction) SetTimeoutMs(value int64) { + if m != nil { + m.TimeoutMs = value + } +} +func (x *TimeoutAction) ToProto() *ProtoTimeoutAction { + if x == nil { + return nil + } + + proto := &ProtoTimeoutAction{ + Action: x.Action.ToProto(), + DeprecatedTimeoutNs: x.DeprecatedTimeoutNs, + LogSource: x.LogSource, + TimeoutMs: x.TimeoutMs, + } + return proto +} + +func (x *ProtoTimeoutAction) FromProto() *TimeoutAction { + if x == nil { + return nil + } + + copysafe := &TimeoutAction{ + Action: x.Action.FromProto(), + DeprecatedTimeoutNs: x.DeprecatedTimeoutNs, + LogSource: x.LogSource, + TimeoutMs: x.TimeoutMs, + } + return copysafe +} + +func TimeoutActionToProtoSlice(values []*TimeoutAction) []*ProtoTimeoutAction { + if values == nil { + return nil + } + result := make([]*ProtoTimeoutAction, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TimeoutActionFromProtoSlice(values []*ProtoTimeoutAction) []*TimeoutAction { + if values == nil { + return nil + } + result := make([]*TimeoutAction, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoEmitProgressAction directly +type EmitProgressAction struct { + Action *Action `json:"action,omitempty"` + StartMessage string `json:"start_message"` + SuccessMessage string `json:"success_message"` + FailureMessagePrefix string `json:"failure_message_prefix"` + LogSource string `json:"log_source,omitempty"` +} + +func (this *EmitProgressAction) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*EmitProgressAction) + if !ok { + that2, ok := that.(EmitProgressAction) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Action == nil { + if that1.Action != nil { + return false + } + } else if !this.Action.Equal(*that1.Action) { + return false + } + if this.StartMessage != that1.StartMessage { + return false + } + if this.SuccessMessage != that1.SuccessMessage { + return false + } + if this.FailureMessagePrefix != that1.FailureMessagePrefix { + return false + } + if this.LogSource != that1.LogSource { + return false + } + return true +} +func (m *EmitProgressAction) GetAction() *Action { + if m != nil { + return m.Action + } + return nil +} +func (m *EmitProgressAction) SetAction(value *Action) { + if m != nil { + m.Action = value + } +} +func (m *EmitProgressAction) GetStartMessage() string { + if m != nil { + return m.StartMessage + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *EmitProgressAction) SetStartMessage(value string) { + if m != nil { + m.StartMessage = value + } +} +func (m *EmitProgressAction) GetSuccessMessage() string { + if m != nil { + return m.SuccessMessage + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *EmitProgressAction) SetSuccessMessage(value string) { + if m != nil { + m.SuccessMessage = value + } +} +func (m *EmitProgressAction) GetFailureMessagePrefix() string { + if m != nil { + return m.FailureMessagePrefix + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *EmitProgressAction) SetFailureMessagePrefix(value string) { + if m != nil { + m.FailureMessagePrefix = value + } +} +func (m *EmitProgressAction) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *EmitProgressAction) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} +func (x *EmitProgressAction) ToProto() *ProtoEmitProgressAction { + if x == nil { + return nil + } + + proto := &ProtoEmitProgressAction{ + Action: x.Action.ToProto(), + StartMessage: x.StartMessage, + SuccessMessage: x.SuccessMessage, + FailureMessagePrefix: x.FailureMessagePrefix, + LogSource: x.LogSource, + } + return proto +} + +func (x *ProtoEmitProgressAction) FromProto() *EmitProgressAction { + if x == nil { + return nil + } + + copysafe := &EmitProgressAction{ + Action: x.Action.FromProto(), + StartMessage: x.StartMessage, + SuccessMessage: x.SuccessMessage, + FailureMessagePrefix: x.FailureMessagePrefix, + LogSource: x.LogSource, + } + return copysafe +} + +func EmitProgressActionToProtoSlice(values []*EmitProgressAction) []*ProtoEmitProgressAction { + if values == nil { + return nil + } + result := make([]*ProtoEmitProgressAction, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func EmitProgressActionFromProtoSlice(values []*ProtoEmitProgressAction) []*EmitProgressAction { + if values == nil { + return nil + } + result := make([]*EmitProgressAction, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoTryAction directly +type TryAction struct { + Action *Action `json:"action,omitempty"` + LogSource string `json:"log_source,omitempty"` +} + +func (this *TryAction) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TryAction) + if !ok { + that2, ok := that.(TryAction) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Action == nil { + if that1.Action != nil { + return false + } + } else if !this.Action.Equal(*that1.Action) { + return false + } + if this.LogSource != that1.LogSource { + return false + } + return true +} +func (m *TryAction) GetAction() *Action { + if m != nil { + return m.Action + } + return nil +} +func (m *TryAction) SetAction(value *Action) { + if m != nil { + m.Action = value + } +} +func (m *TryAction) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TryAction) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} +func (x *TryAction) ToProto() *ProtoTryAction { + if x == nil { + return nil + } + + proto := &ProtoTryAction{ + Action: x.Action.ToProto(), + LogSource: x.LogSource, + } + return proto +} + +func (x *ProtoTryAction) FromProto() *TryAction { + if x == nil { + return nil + } + + copysafe := &TryAction{ + Action: x.Action.FromProto(), + LogSource: x.LogSource, + } + return copysafe +} + +func TryActionToProtoSlice(values []*TryAction) []*ProtoTryAction { + if values == nil { + return nil + } + result := make([]*ProtoTryAction, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TryActionFromProtoSlice(values []*ProtoTryAction) []*TryAction { + if values == nil { + return nil + } + result := make([]*TryAction, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoParallelAction directly +type ParallelAction struct { + Actions []*Action `json:"actions,omitempty"` + LogSource string `json:"log_source,omitempty"` +} + +func (this *ParallelAction) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ParallelAction) + if !ok { + that2, ok := that.(ParallelAction) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Actions == nil { + if that1.Actions != nil { + return false + } + } else if len(this.Actions) != len(that1.Actions) { + return false + } + for i := range this.Actions { + if !this.Actions[i].Equal(that1.Actions[i]) { + return false + } + } + if this.LogSource != that1.LogSource { + return false + } + return true +} +func (m *ParallelAction) GetActions() []*Action { + if m != nil { + return m.Actions + } + return nil +} +func (m *ParallelAction) SetActions(value []*Action) { + if m != nil { + m.Actions = value + } +} +func (m *ParallelAction) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ParallelAction) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} +func (x *ParallelAction) ToProto() *ProtoParallelAction { + if x == nil { + return nil + } + + proto := &ProtoParallelAction{ + Actions: ActionToProtoSlice(x.Actions), + LogSource: x.LogSource, + } + return proto +} + +func (x *ProtoParallelAction) FromProto() *ParallelAction { + if x == nil { + return nil + } + + copysafe := &ParallelAction{ + Actions: ActionFromProtoSlice(x.Actions), + LogSource: x.LogSource, + } + return copysafe +} + +func ParallelActionToProtoSlice(values []*ParallelAction) []*ProtoParallelAction { + if values == nil { + return nil + } + result := make([]*ProtoParallelAction, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ParallelActionFromProtoSlice(values []*ProtoParallelAction) []*ParallelAction { + if values == nil { + return nil + } + result := make([]*ParallelAction, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoSerialAction directly +type SerialAction struct { + Actions []*Action `json:"actions,omitempty"` + LogSource string `json:"log_source,omitempty"` +} + +func (this *SerialAction) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*SerialAction) + if !ok { + that2, ok := that.(SerialAction) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Actions == nil { + if that1.Actions != nil { + return false + } + } else if len(this.Actions) != len(that1.Actions) { + return false + } + for i := range this.Actions { + if !this.Actions[i].Equal(that1.Actions[i]) { + return false + } + } + if this.LogSource != that1.LogSource { + return false + } + return true +} +func (m *SerialAction) GetActions() []*Action { + if m != nil { + return m.Actions + } + return nil +} +func (m *SerialAction) SetActions(value []*Action) { + if m != nil { + m.Actions = value + } +} +func (m *SerialAction) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *SerialAction) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} +func (x *SerialAction) ToProto() *ProtoSerialAction { + if x == nil { + return nil + } + + proto := &ProtoSerialAction{ + Actions: ActionToProtoSlice(x.Actions), + LogSource: x.LogSource, + } + return proto +} + +func (x *ProtoSerialAction) FromProto() *SerialAction { + if x == nil { + return nil + } + + copysafe := &SerialAction{ + Actions: ActionFromProtoSlice(x.Actions), + LogSource: x.LogSource, + } + return copysafe +} + +func SerialActionToProtoSlice(values []*SerialAction) []*ProtoSerialAction { + if values == nil { + return nil + } + result := make([]*ProtoSerialAction, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func SerialActionFromProtoSlice(values []*ProtoSerialAction) []*SerialAction { + if values == nil { + return nil + } + result := make([]*SerialAction, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoCodependentAction directly +type CodependentAction struct { + Actions []*Action `json:"actions,omitempty"` + LogSource string `json:"log_source,omitempty"` +} + +func (this *CodependentAction) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*CodependentAction) + if !ok { + that2, ok := that.(CodependentAction) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Actions == nil { + if that1.Actions != nil { + return false + } + } else if len(this.Actions) != len(that1.Actions) { + return false + } + for i := range this.Actions { + if !this.Actions[i].Equal(that1.Actions[i]) { + return false + } + } + if this.LogSource != that1.LogSource { + return false + } + return true +} +func (m *CodependentAction) GetActions() []*Action { + if m != nil { + return m.Actions + } + return nil +} +func (m *CodependentAction) SetActions(value []*Action) { + if m != nil { + m.Actions = value + } +} +func (m *CodependentAction) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CodependentAction) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} +func (x *CodependentAction) ToProto() *ProtoCodependentAction { + if x == nil { + return nil + } + + proto := &ProtoCodependentAction{ + Actions: ActionToProtoSlice(x.Actions), + LogSource: x.LogSource, + } + return proto +} + +func (x *ProtoCodependentAction) FromProto() *CodependentAction { + if x == nil { + return nil + } + + copysafe := &CodependentAction{ + Actions: ActionFromProtoSlice(x.Actions), + LogSource: x.LogSource, + } + return copysafe +} + +func CodependentActionToProtoSlice(values []*CodependentAction) []*ProtoCodependentAction { + if values == nil { + return nil + } + result := make([]*ProtoCodependentAction, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func CodependentActionFromProtoSlice(values []*ProtoCodependentAction) []*CodependentAction { + if values == nil { + return nil + } + result := make([]*CodependentAction, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoResourceLimits directly +type ResourceLimits struct { + Nofile *uint64 `json:"nofile,omitempty"` + // Deprecated: marked deprecated in actions.proto + Nproc *uint64 `json:"nproc,omitempty"` +} + +func (this *ResourceLimits) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ResourceLimits) + if !ok { + that2, ok := that.(ResourceLimits) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Nofile == nil { + if that1.Nofile != nil { + return false + } + } else if *this.Nofile != *that1.Nofile { + return false + } + if this.Nproc == nil { + if that1.Nproc != nil { + return false + } + } else if *this.Nproc != *that1.Nproc { + return false + } + return true +} +func (m *ResourceLimits) NofileExists() bool { + return m != nil && m.Nofile != nil +} +func (m *ResourceLimits) GetNofile() *uint64 { + if m != nil && m.Nofile != nil { + return m.Nofile + } + return nil +} +func (m *ResourceLimits) SetNofile(value *uint64) { + if m != nil { + m.Nofile = value + } +} + +// Deprecated: marked deprecated in actions.proto +func (m *ResourceLimits) NprocExists() bool { + return m != nil && m.Nproc != nil +} +func (m *ResourceLimits) GetNproc() *uint64 { + if m != nil && m.Nproc != nil { + return m.Nproc + } + return nil +} + +// Deprecated: marked deprecated in actions.proto +func (m *ResourceLimits) SetNproc(value *uint64) { + if m != nil { + m.Nproc = value + } +} +func (x *ResourceLimits) ToProto() *ProtoResourceLimits { + if x == nil { + return nil + } + + proto := &ProtoResourceLimits{ + Nofile: x.Nofile, + Nproc: x.Nproc, + } + return proto +} + +func (x *ProtoResourceLimits) FromProto() *ResourceLimits { + if x == nil { + return nil + } + + copysafe := &ResourceLimits{ + Nofile: x.Nofile, + Nproc: x.Nproc, + } + return copysafe +} + +func ResourceLimitsToProtoSlice(values []*ResourceLimits) []*ProtoResourceLimits { + if values == nil { + return nil + } + result := make([]*ProtoResourceLimits, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ResourceLimitsFromProtoSlice(values []*ProtoResourceLimits) []*ResourceLimits { + if values == nil { + return nil + } + result := make([]*ResourceLimits, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/actions_test.go b/models/actions_test.go index 29768188..13975c26 100644 --- a/models/actions_test.go +++ b/models/actions_test.go @@ -14,9 +14,9 @@ var _ = Describe("Actions", func() { itSerializes := func(actionPayload string, a *models.Action) { action := models.UnwrapAction(a) It("Action -> JSON for "+string(action.ActionType()), func() { - json, err := json.Marshal(action) + marshalJson, err := json.Marshal(a.GetValue()) Expect(err).NotTo(HaveOccurred()) - Expect(json).To(MatchJSON(actionPayload)) + Expect(marshalJson).To(MatchJSON(actionPayload)) }) } @@ -58,7 +58,7 @@ var _ = Describe("Actions", func() { Describe("Nil Actions", func() { It("Action -> JSON for a Nil action", func() { - var action *models.Action = nil + var action *models.ProtoAction = nil By("marshalling to JSON", func() { json, err := json.Marshal(action) Expect(err).NotTo(HaveOccurred()) @@ -191,7 +191,7 @@ var _ = Describe("Actions", func() { Context("with checksum", func() { for _, testCase := range []ValidatorErrorCase{ - ValidatorErrorCase{ + { "checksum value", &models.DownloadAction{ From: "web_location", @@ -201,7 +201,7 @@ var _ = Describe("Actions", func() { ChecksumValue: "", }, }, - ValidatorErrorCase{ + { "checksum algorithm", &models.DownloadAction{ From: "web_location", @@ -211,7 +211,7 @@ var _ = Describe("Actions", func() { ChecksumValue: "some checksum", }, }, - ValidatorErrorCase{ + { "invalid algorithm", &models.DownloadAction{ From: "web_location", @@ -293,8 +293,8 @@ var _ = Describe("Actions", func() { nproc uint64 = 20 ) resourceLimits := &models.ResourceLimits{} - resourceLimits.SetNofile(nofile) - resourceLimits.SetNproc(nproc) + resourceLimits.SetNofile(&nofile) + resourceLimits.SetNproc(&nproc) itSerializesAndDeserializes( `{ "user": "me", @@ -320,7 +320,8 @@ var _ = Describe("Actions", func() { {"FOO", "1"}, {"BAR", "2"}, }, - ResourceLimits: resourceLimits, + ResourceLimits: resourceLimits, + SuppressLogOutput: false, VolumeMountedFiles: []*models.File{ {Path: "/redis/username", Content: "username"}, }, @@ -365,17 +366,17 @@ var _ = Describe("Actions", func() { var nofile uint64 = 10 resourceLimits := &models.ResourceLimits{} - resourceLimits.SetNofile(nofile) + resourceLimits.SetNofile(&nofile) itSerializesAndDeserializes( `{ "action": { "run": { "path": "echo", - "user": "someone", "resource_limits":{ "nofile": 10 }, + "user": "someone", "suppress_log_output": false, "volume_mounted_files": null } @@ -557,7 +558,7 @@ var _ = Describe("Actions", func() { It("is valid", func() { parallelAction = &models.ParallelAction{ Actions: []*models.Action{ - &models.Action{ + { UploadAction: &models.UploadAction{ From: "local_location", To: "web_location", @@ -593,7 +594,7 @@ var _ = Describe("Actions", func() { "from", &models.ParallelAction{ Actions: []*models.Action{ - &models.Action{ + { UploadAction: &models.UploadAction{ To: "web_location", }, @@ -779,7 +780,7 @@ var _ = Describe("Actions", func() { "volume_mounted_files": null } } - ] + ] }`, models.WrapAction(models.Codependent( &models.DownloadAction{ diff --git a/models/actual_lrp.go b/models/actual_lrp.go index 9ad655b5..f2de904f 100644 --- a/models/actual_lrp.go +++ b/models/actual_lrp.go @@ -125,7 +125,7 @@ func (actual ActualLRP) CellIsMissing(cellSet CellSet) bool { return false } - return !cellSet.HasCellID(actual.CellId) + return !cellSet.HasCellID(actual.ActualLrpInstanceKey.CellId) } func (actual ActualLRP) ShouldRestartImmediately(calc RestartCalculator) bool { @@ -144,19 +144,8 @@ func (actual ActualLRP) ShouldRestartCrash(now time.Time, calc RestartCalculator return calc.ShouldRestart(now.UnixNano(), actual.Since, actual.CrashCount) } -func (actual *ActualLRP) SetRoutable(routable bool) { - actual.OptionalRoutable = &ActualLRP_Routable{ - Routable: routable, - } -} - -func (actual *ActualLRP) RoutableExists() bool { - _, ok := actual.GetOptionalRoutable().(*ActualLRP_Routable) - return ok -} - func (before ActualLRP) AllowsTransitionTo(lrpKey *ActualLRPKey, instanceKey *ActualLRPInstanceKey, newState string) bool { - if !before.ActualLRPKey.Equal(lrpKey) { + if !before.ActualLrpKey.Equal(lrpKey) { return false } @@ -168,18 +157,18 @@ func (before ActualLRP) AllowsTransitionTo(lrpKey *ActualLRPKey, instanceKey *Ac newState == ActualLRPStateRunning case ActualLRPStateClaimed: valid = newState == ActualLRPStateUnclaimed && instanceKey.Empty() || - newState == ActualLRPStateClaimed && before.ActualLRPInstanceKey.Equal(instanceKey) || + newState == ActualLRPStateClaimed && before.ActualLrpInstanceKey.Equal(instanceKey) || newState == ActualLRPStateRunning || - newState == ActualLRPStateCrashed && before.ActualLRPInstanceKey.Equal(instanceKey) + newState == ActualLRPStateCrashed && before.ActualLrpInstanceKey.Equal(instanceKey) case ActualLRPStateRunning: valid = newState == ActualLRPStateUnclaimed && instanceKey.Empty() || - newState == ActualLRPStateClaimed && before.ActualLRPInstanceKey.Equal(instanceKey) || - newState == ActualLRPStateRunning && before.ActualLRPInstanceKey.Equal(instanceKey) || - newState == ActualLRPStateCrashed && before.ActualLRPInstanceKey.Equal(instanceKey) + newState == ActualLRPStateClaimed && before.ActualLrpInstanceKey.Equal(instanceKey) || + newState == ActualLRPStateRunning && before.ActualLrpInstanceKey.Equal(instanceKey) || + newState == ActualLRPStateCrashed && before.ActualLrpInstanceKey.Equal(instanceKey) case ActualLRPStateCrashed: valid = newState == ActualLRPStateUnclaimed && instanceKey.Empty() || - newState == ActualLRPStateClaimed && before.ActualLRPInstanceKey.Equal(instanceKey) || - newState == ActualLRPStateRunning && before.ActualLRPInstanceKey.Equal(instanceKey) + newState == ActualLRPStateClaimed && before.ActualLrpInstanceKey.Equal(instanceKey) || + newState == ActualLRPStateRunning && before.ActualLrpInstanceKey.Equal(instanceKey) } return valid @@ -238,7 +227,7 @@ func (group ActualLRPGroup) Resolve() (*ActualLRP, bool, error) { func NewUnclaimedActualLRP(lrpKey ActualLRPKey, since int64) *ActualLRP { return &ActualLRP{ - ActualLRPKey: lrpKey, + ActualLrpKey: lrpKey, State: ActualLRPStateUnclaimed, Since: since, } @@ -246,8 +235,8 @@ func NewUnclaimedActualLRP(lrpKey ActualLRPKey, since int64) *ActualLRP { func NewClaimedActualLRP(lrpKey ActualLRPKey, instanceKey ActualLRPInstanceKey, since int64) *ActualLRP { return &ActualLRP{ - ActualLRPKey: lrpKey, - ActualLRPInstanceKey: instanceKey, + ActualLrpKey: lrpKey, + ActualLrpInstanceKey: instanceKey, State: ActualLRPStateClaimed, Since: since, } @@ -255,9 +244,9 @@ func NewClaimedActualLRP(lrpKey ActualLRPKey, instanceKey ActualLRPInstanceKey, func NewRunningActualLRP(lrpKey ActualLRPKey, instanceKey ActualLRPInstanceKey, netInfo ActualLRPNetInfo, since int64) *ActualLRP { return &ActualLRP{ - ActualLRPKey: lrpKey, - ActualLRPInstanceKey: instanceKey, - ActualLRPNetInfo: netInfo, + ActualLrpKey: lrpKey, + ActualLrpInstanceKey: instanceKey, + ActualLrpNetInfo: netInfo, State: ActualLRPStateRunning, Since: since, } @@ -272,9 +261,9 @@ func (actualLRPInfo *ActualLRPInfo) ToActualLRP(lrpKey ActualLRPKey, lrpInstance return nil } lrp := ActualLRP{ - ActualLRPKey: lrpKey, - ActualLRPInstanceKey: lrpInstanceKey, - ActualLRPNetInfo: actualLRPInfo.ActualLRPNetInfo, + ActualLrpKey: lrpKey, + ActualLrpInstanceKey: lrpInstanceKey, + ActualLrpNetInfo: actualLRPInfo.ActualLrpNetInfo, AvailabilityZone: actualLRPInfo.AvailabilityZone, CrashCount: actualLRPInfo.CrashCount, CrashReason: actualLRPInfo.CrashReason, @@ -297,7 +286,7 @@ func (actual *ActualLRP) ToActualLRPInfo() *ActualLRPInfo { return nil } info := ActualLRPInfo{ - ActualLRPNetInfo: actual.ActualLRPNetInfo, + ActualLrpNetInfo: actual.ActualLrpNetInfo, AvailabilityZone: actual.AvailabilityZone, CrashCount: actual.CrashCount, CrashReason: actual.CrashReason, @@ -331,7 +320,7 @@ func (actual *ActualLRP) ToActualLRPGroup() *ActualLRPGroup { func (actual ActualLRP) Validate() error { var validationError ValidationError - err := actual.ActualLRPKey.Validate() + err := actual.ActualLrpKey.Validate() if err != nil { validationError = validationError.Append(err) } @@ -342,10 +331,10 @@ func (actual ActualLRP) Validate() error { switch actual.State { case ActualLRPStateUnclaimed: - if !actual.ActualLRPInstanceKey.Empty() { + if !actual.ActualLrpInstanceKey.Empty() { validationError = validationError.Append(errors.New("instance key cannot be set when state is unclaimed")) } - if !actual.ActualLRPNetInfo.Empty() { + if !actual.ActualLrpNetInfo.Empty() { validationError = validationError.Append(errors.New("net info cannot be set when state is unclaimed")) } if actual.Presence != ActualLRP_Ordinary { @@ -353,10 +342,10 @@ func (actual ActualLRP) Validate() error { } case ActualLRPStateClaimed: - if err := actual.ActualLRPInstanceKey.Validate(); err != nil { + if err := actual.ActualLrpInstanceKey.Validate(); err != nil { validationError = validationError.Append(err) } - if !actual.ActualLRPNetInfo.Empty() { + if !actual.ActualLrpNetInfo.Empty() { validationError = validationError.Append(errors.New("net info cannot be set when state is claimed")) } if strings.TrimSpace(actual.PlacementError) != "" { @@ -364,10 +353,10 @@ func (actual ActualLRP) Validate() error { } case ActualLRPStateRunning: - if err := actual.ActualLRPInstanceKey.Validate(); err != nil { + if err := actual.ActualLrpInstanceKey.Validate(); err != nil { validationError = validationError.Append(err) } - if err := actual.ActualLRPNetInfo.Validate(); err != nil { + if err := actual.ActualLrpNetInfo.Validate(); err != nil { validationError = validationError.Append(err) } if strings.TrimSpace(actual.PlacementError) != "" { @@ -375,10 +364,10 @@ func (actual ActualLRP) Validate() error { } case ActualLRPStateCrashed: - if !actual.ActualLRPInstanceKey.Empty() { + if !actual.ActualLrpInstanceKey.Empty() { validationError = validationError.Append(errors.New("instance key cannot be set when state is crashed")) } - if !actual.ActualLRPNetInfo.Empty() { + if !actual.ActualLrpNetInfo.Empty() { validationError = validationError.Append(errors.New("net info cannot be set when state is crashed")) } if strings.TrimSpace(actual.PlacementError) != "" { @@ -489,14 +478,14 @@ func ResolveActualLRPGroups(lrps []*ActualLRP) []*ActualLRPGroup { // one for the evacuating. When building the list of actual LRP groups (where // a group is the instance and corresponding evacuating), make sure we don't add the same // actual lrp twice. - if mapOfGroups[actualLRP.ActualLRPKey] == nil { - mapOfGroups[actualLRP.ActualLRPKey] = &ActualLRPGroup{} - result = append(result, mapOfGroups[actualLRP.ActualLRPKey]) + if mapOfGroups[actualLRP.ActualLrpKey] == nil { + mapOfGroups[actualLRP.ActualLrpKey] = &ActualLRPGroup{} + result = append(result, mapOfGroups[actualLRP.ActualLrpKey]) } if actualLRP.Presence == ActualLRP_Evacuating { - mapOfGroups[actualLRP.ActualLRPKey].Evacuating = actualLRP - } else if hasHigherPriority(actualLRP, mapOfGroups[actualLRP.ActualLRPKey].Instance) { - mapOfGroups[actualLRP.ActualLRPKey].Instance = actualLRP + mapOfGroups[actualLRP.ActualLrpKey].Evacuating = actualLRP + } else if hasHigherPriority(actualLRP, mapOfGroups[actualLRP.ActualLrpKey].Instance) { + mapOfGroups[actualLRP.ActualLrpKey].Instance = actualLRP } } diff --git a/models/actual_lrp.pb.go b/models/actual_lrp.pb.go index e9c46897..602e5cd1 100644 --- a/models/actual_lrp.pb.go +++ b/models/actual_lrp.pb.go @@ -1,3220 +1,748 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: actual_lrp.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strconv "strconv" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ActualLRPNetInfo_PreferredAddress int32 - const ( - ActualLRPNetInfo_PreferredAddressUnknown ActualLRPNetInfo_PreferredAddress = 0 - ActualLRPNetInfo_PreferredAddressInstance ActualLRPNetInfo_PreferredAddress = 1 - ActualLRPNetInfo_PreferredAddressHost ActualLRPNetInfo_PreferredAddress = 2 + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -var ActualLRPNetInfo_PreferredAddress_name = map[int32]string{ - 0: "UNKNOWN", - 1: "INSTANCE", - 2: "HOST", -} - -var ActualLRPNetInfo_PreferredAddress_value = map[string]int32{ - "UNKNOWN": 0, - "INSTANCE": 1, - "HOST": 2, -} - -func (ActualLRPNetInfo_PreferredAddress) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_25e5e77bfca46c1a, []int{4, 0} -} - -type ActualLRP_Presence int32 +type ProtoActualLRPNetInfo_PreferredAddress int32 const ( - ActualLRP_Ordinary ActualLRP_Presence = 0 - ActualLRP_Evacuating ActualLRP_Presence = 1 - ActualLRP_Suspect ActualLRP_Presence = 2 + ProtoActualLRPNetInfo_UNKNOWN ProtoActualLRPNetInfo_PreferredAddress = 0 + ProtoActualLRPNetInfo_INSTANCE ProtoActualLRPNetInfo_PreferredAddress = 1 + ProtoActualLRPNetInfo_HOST ProtoActualLRPNetInfo_PreferredAddress = 2 ) -var ActualLRP_Presence_name = map[int32]string{ - 0: "ORDINARY", - 1: "EVACUATING", - 2: "SUSPECT", -} - -var ActualLRP_Presence_value = map[string]int32{ - "ORDINARY": 0, - "EVACUATING": 1, - "SUSPECT": 2, -} - -func (ActualLRP_Presence) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_25e5e77bfca46c1a, []int{6, 0} -} +// Enum value maps for ProtoActualLRPNetInfo_PreferredAddress. +var ( + ProtoActualLRPNetInfo_PreferredAddress_name = map[int32]string{ + 0: "UNKNOWN", + 1: "INSTANCE", + 2: "HOST", + } + ProtoActualLRPNetInfo_PreferredAddress_value = map[string]int32{ + "UNKNOWN": 0, + "INSTANCE": 1, + "HOST": 2, + } +) -// Deprecated: Do not use. -type ActualLRPGroup struct { - Instance *ActualLRP `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` - Evacuating *ActualLRP `protobuf:"bytes,2,opt,name=evacuating,proto3" json:"evacuating,omitempty"` +func (x ProtoActualLRPNetInfo_PreferredAddress) Enum() *ProtoActualLRPNetInfo_PreferredAddress { + p := new(ProtoActualLRPNetInfo_PreferredAddress) + *p = x + return p } -func (m *ActualLRPGroup) Reset() { *m = ActualLRPGroup{} } -func (*ActualLRPGroup) ProtoMessage() {} -func (*ActualLRPGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_25e5e77bfca46c1a, []int{0} -} -func (m *ActualLRPGroup) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActualLRPGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPGroup.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ActualLRPGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPGroup.Merge(m, src) -} -func (m *ActualLRPGroup) XXX_Size() int { - return m.Size() +func (x ProtoActualLRPNetInfo_PreferredAddress) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (m *ActualLRPGroup) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_ActualLRPGroup proto.InternalMessageInfo -func (m *ActualLRPGroup) GetInstance() *ActualLRP { - if m != nil { - return m.Instance - } - return nil +func (ProtoActualLRPNetInfo_PreferredAddress) Descriptor() protoreflect.EnumDescriptor { + return file_actual_lrp_proto_enumTypes[0].Descriptor() } -func (m *ActualLRPGroup) GetEvacuating() *ActualLRP { - if m != nil { - return m.Evacuating - } - return nil +func (ProtoActualLRPNetInfo_PreferredAddress) Type() protoreflect.EnumType { + return &file_actual_lrp_proto_enumTypes[0] } -type PortMapping struct { - ContainerPort uint32 `protobuf:"varint,1,opt,name=container_port,json=containerPort,proto3" json:"container_port"` - HostPort uint32 `protobuf:"varint,2,opt,name=host_port,json=hostPort,proto3" json:"host_port"` - ContainerTlsProxyPort uint32 `protobuf:"varint,3,opt,name=container_tls_proxy_port,json=containerTlsProxyPort,proto3" json:"container_tls_proxy_port"` - HostTlsProxyPort uint32 `protobuf:"varint,4,opt,name=host_tls_proxy_port,json=hostTlsProxyPort,proto3" json:"host_tls_proxy_port"` +func (x ProtoActualLRPNetInfo_PreferredAddress) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *PortMapping) Reset() { *m = PortMapping{} } -func (*PortMapping) ProtoMessage() {} -func (*PortMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_25e5e77bfca46c1a, []int{1} -} -func (m *PortMapping) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PortMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PortMapping.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PortMapping) XXX_Merge(src proto.Message) { - xxx_messageInfo_PortMapping.Merge(m, src) -} -func (m *PortMapping) XXX_Size() int { - return m.Size() -} -func (m *PortMapping) XXX_DiscardUnknown() { - xxx_messageInfo_PortMapping.DiscardUnknown(m) +// Deprecated: Use ProtoActualLRPNetInfo_PreferredAddress.Descriptor instead. +func (ProtoActualLRPNetInfo_PreferredAddress) EnumDescriptor() ([]byte, []int) { + return file_actual_lrp_proto_rawDescGZIP(), []int{4, 0} } -var xxx_messageInfo_PortMapping proto.InternalMessageInfo +type ProtoActualLRP_Presence int32 -func (m *PortMapping) GetContainerPort() uint32 { - if m != nil { - return m.ContainerPort - } - return 0 -} +const ( + ProtoActualLRP_ORDINARY ProtoActualLRP_Presence = 0 + ProtoActualLRP_EVACUATING ProtoActualLRP_Presence = 1 + ProtoActualLRP_SUSPECT ProtoActualLRP_Presence = 2 +) -func (m *PortMapping) GetHostPort() uint32 { - if m != nil { - return m.HostPort +// Enum value maps for ProtoActualLRP_Presence. +var ( + ProtoActualLRP_Presence_name = map[int32]string{ + 0: "ORDINARY", + 1: "EVACUATING", + 2: "SUSPECT", } - return 0 -} - -func (m *PortMapping) GetContainerTlsProxyPort() uint32 { - if m != nil { - return m.ContainerTlsProxyPort + ProtoActualLRP_Presence_value = map[string]int32{ + "ORDINARY": 0, + "EVACUATING": 1, + "SUSPECT": 2, } - return 0 -} +) -func (m *PortMapping) GetHostTlsProxyPort() uint32 { - if m != nil { - return m.HostTlsProxyPort - } - return 0 +func (x ProtoActualLRP_Presence) Enum() *ProtoActualLRP_Presence { + p := new(ProtoActualLRP_Presence) + *p = x + return p } -type ActualLRPKey struct { - ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,json=processGuid,proto3" json:"process_guid"` - Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index"` - Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain"` +func (x ProtoActualLRP_Presence) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (m *ActualLRPKey) Reset() { *m = ActualLRPKey{} } -func (*ActualLRPKey) ProtoMessage() {} -func (*ActualLRPKey) Descriptor() ([]byte, []int) { - return fileDescriptor_25e5e77bfca46c1a, []int{2} -} -func (m *ActualLRPKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActualLRPKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPKey.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ActualLRPKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPKey.Merge(m, src) -} -func (m *ActualLRPKey) XXX_Size() int { - return m.Size() +func (ProtoActualLRP_Presence) Descriptor() protoreflect.EnumDescriptor { + return file_actual_lrp_proto_enumTypes[1].Descriptor() } -func (m *ActualLRPKey) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPKey.DiscardUnknown(m) -} - -var xxx_messageInfo_ActualLRPKey proto.InternalMessageInfo -func (m *ActualLRPKey) GetProcessGuid() string { - if m != nil { - return m.ProcessGuid - } - return "" +func (ProtoActualLRP_Presence) Type() protoreflect.EnumType { + return &file_actual_lrp_proto_enumTypes[1] } -func (m *ActualLRPKey) GetIndex() int32 { - if m != nil { - return m.Index - } - return 0 +func (x ProtoActualLRP_Presence) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *ActualLRPKey) GetDomain() string { - if m != nil { - return m.Domain - } - return "" +// Deprecated: Use ProtoActualLRP_Presence.Descriptor instead. +func (ProtoActualLRP_Presence) EnumDescriptor() ([]byte, []int) { + return file_actual_lrp_proto_rawDescGZIP(), []int{6, 0} } -type ActualLRPInstanceKey struct { - InstanceGuid string `protobuf:"bytes,1,opt,name=instance_guid,json=instanceGuid,proto3" json:"instance_guid"` - CellId string `protobuf:"bytes,2,opt,name=cell_id,json=cellId,proto3" json:"cell_id"` +// Deprecated: Marked as deprecated in actual_lrp.proto. +type ProtoActualLRPGroup struct { + state protoimpl.MessageState `protogen:"open.v1"` + Instance *ProtoActualLRP `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` + Evacuating *ProtoActualLRP `protobuf:"bytes,2,opt,name=evacuating,proto3" json:"evacuating,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPInstanceKey) Reset() { *m = ActualLRPInstanceKey{} } -func (*ActualLRPInstanceKey) ProtoMessage() {} -func (*ActualLRPInstanceKey) Descriptor() ([]byte, []int) { - return fileDescriptor_25e5e77bfca46c1a, []int{3} -} -func (m *ActualLRPInstanceKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActualLRPInstanceKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPInstanceKey.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ActualLRPInstanceKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPInstanceKey.Merge(m, src) -} -func (m *ActualLRPInstanceKey) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPInstanceKey) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPInstanceKey.DiscardUnknown(m) +func (x *ProtoActualLRPGroup) Reset() { + *x = ProtoActualLRPGroup{} + mi := &file_actual_lrp_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -var xxx_messageInfo_ActualLRPInstanceKey proto.InternalMessageInfo - -func (m *ActualLRPInstanceKey) GetInstanceGuid() string { - if m != nil { - return m.InstanceGuid - } - return "" -} - -func (m *ActualLRPInstanceKey) GetCellId() string { - if m != nil { - return m.CellId - } - return "" +func (x *ProtoActualLRPGroup) String() string { + return protoimpl.X.MessageStringOf(x) } -type ActualLRPNetInfo struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address"` - Ports []*PortMapping `protobuf:"bytes,2,rep,name=ports,proto3" json:"ports"` - InstanceAddress string `protobuf:"bytes,3,opt,name=instance_address,json=instanceAddress,proto3" json:"instance_address,omitempty"` - PreferredAddress ActualLRPNetInfo_PreferredAddress `protobuf:"varint,4,opt,name=preferred_address,json=preferredAddress,proto3,enum=models.ActualLRPNetInfo_PreferredAddress" json:"preferred_address"` -} +func (*ProtoActualLRPGroup) ProtoMessage() {} -func (m *ActualLRPNetInfo) Reset() { *m = ActualLRPNetInfo{} } -func (*ActualLRPNetInfo) ProtoMessage() {} -func (*ActualLRPNetInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_25e5e77bfca46c1a, []int{4} -} -func (m *ActualLRPNetInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActualLRPNetInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPNetInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoActualLRPGroup) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *ActualLRPNetInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPNetInfo.Merge(m, src) -} -func (m *ActualLRPNetInfo) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPNetInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPNetInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ActualLRPNetInfo proto.InternalMessageInfo -func (m *ActualLRPNetInfo) GetAddress() string { - if m != nil { - return m.Address - } - return "" +// Deprecated: Use ProtoActualLRPGroup.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPGroup) Descriptor() ([]byte, []int) { + return file_actual_lrp_proto_rawDescGZIP(), []int{0} } -func (m *ActualLRPNetInfo) GetPorts() []*PortMapping { - if m != nil { - return m.Ports +func (x *ProtoActualLRPGroup) GetInstance() *ProtoActualLRP { + if x != nil { + return x.Instance } return nil } -func (m *ActualLRPNetInfo) GetInstanceAddress() string { - if m != nil { - return m.InstanceAddress +func (x *ProtoActualLRPGroup) GetEvacuating() *ProtoActualLRP { + if x != nil { + return x.Evacuating } - return "" + return nil } -func (m *ActualLRPNetInfo) GetPreferredAddress() ActualLRPNetInfo_PreferredAddress { - if m != nil { - return m.PreferredAddress - } - return ActualLRPNetInfo_PreferredAddressUnknown +type ProtoPortMapping struct { + state protoimpl.MessageState `protogen:"open.v1"` + ContainerPort uint32 `protobuf:"varint,1,opt,name=container_port,proto3" json:"container_port,omitempty"` + HostPort uint32 `protobuf:"varint,2,opt,name=host_port,proto3" json:"host_port,omitempty"` + ContainerTlsProxyPort uint32 `protobuf:"varint,3,opt,name=container_tls_proxy_port,proto3" json:"container_tls_proxy_port,omitempty"` + HostTlsProxyPort uint32 `protobuf:"varint,4,opt,name=host_tls_proxy_port,proto3" json:"host_tls_proxy_port,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -type ActualLRPInternalRoute struct { - Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname"` +func (x *ProtoPortMapping) Reset() { + *x = ProtoPortMapping{} + mi := &file_actual_lrp_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPInternalRoute) Reset() { *m = ActualLRPInternalRoute{} } -func (*ActualLRPInternalRoute) ProtoMessage() {} -func (*ActualLRPInternalRoute) Descriptor() ([]byte, []int) { - return fileDescriptor_25e5e77bfca46c1a, []int{5} -} -func (m *ActualLRPInternalRoute) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActualLRPInternalRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPInternalRoute.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ActualLRPInternalRoute) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPInternalRoute.Merge(m, src) -} -func (m *ActualLRPInternalRoute) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPInternalRoute) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPInternalRoute.DiscardUnknown(m) +func (x *ProtoPortMapping) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_ActualLRPInternalRoute proto.InternalMessageInfo - -func (m *ActualLRPInternalRoute) GetHostname() string { - if m != nil { - return m.Hostname - } - return "" -} +func (*ProtoPortMapping) ProtoMessage() {} -type ActualLRP struct { - ActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,json=actualLrpKey,proto3,embedded=actual_lrp_key" json:""` - ActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,json=actualLrpInstanceKey,proto3,embedded=actual_lrp_instance_key" json:""` - ActualLRPNetInfo `protobuf:"bytes,3,opt,name=actual_lrp_net_info,json=actualLrpNetInfo,proto3,embedded=actual_lrp_net_info" json:""` - CrashCount int32 `protobuf:"varint,4,opt,name=crash_count,json=crashCount,proto3" json:"crash_count"` - CrashReason string `protobuf:"bytes,5,opt,name=crash_reason,json=crashReason,proto3" json:"crash_reason,omitempty"` - State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state"` - PlacementError string `protobuf:"bytes,7,opt,name=placement_error,json=placementError,proto3" json:"placement_error,omitempty"` - Since int64 `protobuf:"varint,8,opt,name=since,proto3" json:"since"` - ModificationTag ModificationTag `protobuf:"bytes,9,opt,name=modification_tag,json=modificationTag,proto3" json:"modification_tag"` - Presence ActualLRP_Presence `protobuf:"varint,10,opt,name=presence,proto3,enum=models.ActualLRP_Presence" json:"presence"` - ActualLrpInternalRoutes []*ActualLRPInternalRoute `protobuf:"bytes,11,rep,name=actual_lrp_internal_routes,json=actualLrpInternalRoutes,proto3" json:"actual_lrp_internal_routes,omitempty"` - MetricTags map[string]string `protobuf:"bytes,12,rep,name=metric_tags,json=metricTags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Types that are valid to be assigned to OptionalRoutable: - // *ActualLRP_Routable - OptionalRoutable isActualLRP_OptionalRoutable `protobuf_oneof:"optional_routable"` - AvailabilityZone string `protobuf:"bytes,14,opt,name=availability_zone,json=availabilityZone,proto3" json:"availability_zone"` -} - -func (m *ActualLRP) Reset() { *m = ActualLRP{} } -func (*ActualLRP) ProtoMessage() {} -func (*ActualLRP) Descriptor() ([]byte, []int) { - return fileDescriptor_25e5e77bfca46c1a, []int{6} -} -func (m *ActualLRP) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActualLRP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRP.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoPortMapping) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ActualLRP) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRP.Merge(m, src) -} -func (m *ActualLRP) XXX_Size() int { - return m.Size() -} -func (m *ActualLRP) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRP.DiscardUnknown(m) -} - -var xxx_messageInfo_ActualLRP proto.InternalMessageInfo - -type isActualLRP_OptionalRoutable interface { - isActualLRP_OptionalRoutable() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int + return mi.MessageOf(x) } -type ActualLRP_Routable struct { - Routable bool `protobuf:"varint,13,opt,name=routable,proto3,oneof" json:"routable"` +// Deprecated: Use ProtoPortMapping.ProtoReflect.Descriptor instead. +func (*ProtoPortMapping) Descriptor() ([]byte, []int) { + return file_actual_lrp_proto_rawDescGZIP(), []int{1} } -func (*ActualLRP_Routable) isActualLRP_OptionalRoutable() {} - -func (m *ActualLRP) GetOptionalRoutable() isActualLRP_OptionalRoutable { - if m != nil { - return m.OptionalRoutable +func (x *ProtoPortMapping) GetContainerPort() uint32 { + if x != nil { + return x.ContainerPort } - return nil + return 0 } -func (m *ActualLRP) GetCrashCount() int32 { - if m != nil { - return m.CrashCount +func (x *ProtoPortMapping) GetHostPort() uint32 { + if x != nil { + return x.HostPort } return 0 } -func (m *ActualLRP) GetCrashReason() string { - if m != nil { - return m.CrashReason +func (x *ProtoPortMapping) GetContainerTlsProxyPort() uint32 { + if x != nil { + return x.ContainerTlsProxyPort } - return "" + return 0 } -func (m *ActualLRP) GetState() string { - if m != nil { - return m.State +func (x *ProtoPortMapping) GetHostTlsProxyPort() uint32 { + if x != nil { + return x.HostTlsProxyPort } - return "" + return 0 } -func (m *ActualLRP) GetPlacementError() string { - if m != nil { - return m.PlacementError - } - return "" +type ProtoActualLRPKey struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,proto3" json:"process_guid,omitempty"` + Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRP) GetSince() int64 { - if m != nil { - return m.Since - } - return 0 +func (x *ProtoActualLRPKey) Reset() { + *x = ProtoActualLRPKey{} + mi := &file_actual_lrp_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRP) GetModificationTag() ModificationTag { - if m != nil { - return m.ModificationTag - } - return ModificationTag{} +func (x *ProtoActualLRPKey) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRP) GetPresence() ActualLRP_Presence { - if m != nil { - return m.Presence +func (*ProtoActualLRPKey) ProtoMessage() {} + +func (x *ProtoActualLRPKey) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return ActualLRP_Ordinary + return mi.MessageOf(x) } -func (m *ActualLRP) GetActualLrpInternalRoutes() []*ActualLRPInternalRoute { - if m != nil { - return m.ActualLrpInternalRoutes - } - return nil +// Deprecated: Use ProtoActualLRPKey.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPKey) Descriptor() ([]byte, []int) { + return file_actual_lrp_proto_rawDescGZIP(), []int{2} } -func (m *ActualLRP) GetMetricTags() map[string]string { - if m != nil { - return m.MetricTags +func (x *ProtoActualLRPKey) GetProcessGuid() string { + if x != nil { + return x.ProcessGuid } - return nil + return "" } -func (m *ActualLRP) GetRoutable() bool { - if x, ok := m.GetOptionalRoutable().(*ActualLRP_Routable); ok { - return x.Routable +func (x *ProtoActualLRPKey) GetIndex() int32 { + if x != nil { + return x.Index } - return false + return 0 } -func (m *ActualLRP) GetAvailabilityZone() string { - if m != nil { - return m.AvailabilityZone +func (x *ProtoActualLRPKey) GetDomain() string { + if x != nil { + return x.Domain } return "" } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ActualLRP) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ActualLRP_Routable)(nil), - } +type ProtoActualLRPInstanceKey struct { + state protoimpl.MessageState `protogen:"open.v1"` + InstanceGuid string `protobuf:"bytes,1,opt,name=instance_guid,proto3" json:"instance_guid,omitempty"` + CellId string `protobuf:"bytes,2,opt,name=cell_id,proto3" json:"cell_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { - proto.RegisterEnum("models.ActualLRPNetInfo_PreferredAddress", ActualLRPNetInfo_PreferredAddress_name, ActualLRPNetInfo_PreferredAddress_value) - proto.RegisterEnum("models.ActualLRP_Presence", ActualLRP_Presence_name, ActualLRP_Presence_value) - proto.RegisterType((*ActualLRPGroup)(nil), "models.ActualLRPGroup") - proto.RegisterType((*PortMapping)(nil), "models.PortMapping") - proto.RegisterType((*ActualLRPKey)(nil), "models.ActualLRPKey") - proto.RegisterType((*ActualLRPInstanceKey)(nil), "models.ActualLRPInstanceKey") - proto.RegisterType((*ActualLRPNetInfo)(nil), "models.ActualLRPNetInfo") - proto.RegisterType((*ActualLRPInternalRoute)(nil), "models.ActualLRPInternalRoute") - proto.RegisterType((*ActualLRP)(nil), "models.ActualLRP") - proto.RegisterMapType((map[string]string)(nil), "models.ActualLRP.MetricTagsEntry") -} - -func init() { proto.RegisterFile("actual_lrp.proto", fileDescriptor_25e5e77bfca46c1a) } - -var fileDescriptor_25e5e77bfca46c1a = []byte{ - // 1187 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x56, 0x4d, 0x6f, 0xdb, 0x46, - 0x13, 0x16, 0xe5, 0xd8, 0x96, 0x46, 0xb2, 0x4c, 0xaf, 0x9d, 0x98, 0xd0, 0x1b, 0x90, 0x8a, 0xf0, - 0x16, 0x75, 0x02, 0xc4, 0x69, 0x9d, 0xa0, 0x68, 0x03, 0xf4, 0x60, 0x3a, 0x6e, 0x6c, 0x24, 0x91, - 0x8d, 0xb5, 0xdd, 0xa2, 0x1f, 0x80, 0xba, 0xa6, 0xd6, 0x0a, 0x11, 0x8a, 0x4b, 0x2c, 0x57, 0x6e, - 0xd4, 0x53, 0x8f, 0x85, 0xd1, 0x43, 0x81, 0x5e, 0x7a, 0xf1, 0xbd, 0xbf, 0xa1, 0xbf, 0x20, 0x47, - 0x1f, 0x73, 0x22, 0x1a, 0xe5, 0x52, 0xf0, 0x94, 0x9f, 0x50, 0xec, 0xf2, 0x23, 0xb4, 0x14, 0x9f, - 0x76, 0xf7, 0xd9, 0x99, 0x67, 0x86, 0x33, 0xcf, 0x8e, 0x04, 0x3a, 0x71, 0xc4, 0x90, 0x78, 0x5d, - 0x8f, 0x07, 0xeb, 0x01, 0x67, 0x82, 0xa1, 0xb9, 0x01, 0xeb, 0x51, 0x2f, 0x6c, 0xde, 0xed, 0xbb, - 0xe2, 0xf9, 0xf0, 0x78, 0xdd, 0x61, 0x83, 0x7b, 0x7d, 0xd6, 0x67, 0xf7, 0xd4, 0xf5, 0xf1, 0xf0, - 0x44, 0x9d, 0xd4, 0x41, 0xed, 0x12, 0xb7, 0xe6, 0x8d, 0x01, 0xeb, 0xb9, 0x27, 0xae, 0x43, 0x84, - 0xcb, 0xfc, 0xae, 0x20, 0xfd, 0x04, 0x6f, 0x9f, 0x42, 0x63, 0x53, 0x85, 0x78, 0x8a, 0xf7, 0x1f, - 0x73, 0x36, 0x0c, 0xd0, 0x5d, 0xa8, 0xb8, 0x7e, 0x28, 0x88, 0xef, 0x50, 0x43, 0x6b, 0x69, 0x6b, - 0xb5, 0x8d, 0xa5, 0xf5, 0x24, 0xe6, 0x7a, 0x6e, 0x89, 0x73, 0x13, 0xf4, 0x29, 0x00, 0x3d, 0x25, - 0xce, 0x90, 0x08, 0xd7, 0xef, 0x1b, 0xe5, 0xab, 0x1c, 0x0a, 0x46, 0x0f, 0xcb, 0x86, 0xd6, 0xfe, - 0xa3, 0x0c, 0xb5, 0x7d, 0xc6, 0xc5, 0x33, 0x12, 0x04, 0xae, 0xdf, 0x47, 0x5f, 0x40, 0xc3, 0x61, - 0xbe, 0x20, 0xae, 0x4f, 0x79, 0x37, 0x60, 0x5c, 0xa8, 0xd8, 0x0b, 0x36, 0x8a, 0x23, 0x6b, 0xe2, - 0x06, 0x2f, 0xe4, 0x67, 0xc9, 0x80, 0xee, 0x40, 0xf5, 0x39, 0x0b, 0x45, 0xe2, 0x55, 0x56, 0x5e, - 0x0b, 0x71, 0x64, 0xbd, 0x07, 0x71, 0x45, 0x6e, 0x95, 0xed, 0x11, 0x18, 0xef, 0xc9, 0x84, 0x17, - 0x76, 0x03, 0xce, 0x5e, 0x8e, 0x12, 0xd7, 0x19, 0xe5, 0x7a, 0x33, 0x8e, 0xac, 0x2b, 0x6d, 0xf0, - 0xf5, 0xfc, 0xe6, 0xd0, 0x0b, 0xf7, 0x25, 0xae, 0x68, 0xbf, 0x82, 0x65, 0x15, 0x6d, 0x82, 0xf1, - 0x9a, 0x62, 0x5c, 0x8d, 0x23, 0xeb, 0x43, 0xd7, 0x58, 0x97, 0x60, 0x91, 0xa7, 0xfd, 0xab, 0x06, - 0xf5, 0xbc, 0x66, 0x4f, 0xe8, 0x08, 0xdd, 0x87, 0x7a, 0xc0, 0x99, 0x43, 0xc3, 0xb0, 0xdb, 0x1f, - 0xba, 0x3d, 0x55, 0x94, 0xaa, 0xad, 0xc7, 0x91, 0x75, 0x09, 0xc7, 0xb5, 0xf4, 0xf4, 0x78, 0xe8, - 0xf6, 0x90, 0x05, 0xb3, 0xae, 0xdf, 0xa3, 0x2f, 0x55, 0x31, 0x66, 0xed, 0x6a, 0x1c, 0x59, 0x09, - 0x80, 0x93, 0x05, 0xb5, 0x61, 0xae, 0xc7, 0x06, 0xc4, 0xf5, 0xd5, 0x37, 0x57, 0x6d, 0x88, 0x23, - 0x2b, 0x45, 0x70, 0xba, 0xb6, 0x05, 0xac, 0xe4, 0x99, 0xec, 0xa6, 0xcd, 0x96, 0x19, 0x7d, 0x06, - 0x0b, 0x59, 0xef, 0x8b, 0x29, 0x2d, 0xc5, 0x91, 0x75, 0xf9, 0x02, 0xd7, 0xb3, 0xa3, 0x4a, 0xea, - 0xff, 0x30, 0xef, 0x50, 0xcf, 0xeb, 0xba, 0x3d, 0x95, 0x56, 0xd5, 0xae, 0xc5, 0x91, 0x95, 0x41, - 0x78, 0x4e, 0x6e, 0x76, 0x7b, 0xed, 0x3f, 0x67, 0x40, 0xcf, 0xc3, 0x76, 0xa8, 0xd8, 0xf5, 0x4f, - 0x18, 0xfa, 0x08, 0xe6, 0x49, 0xaf, 0xc7, 0x69, 0x18, 0xa6, 0xc1, 0x94, 0x6b, 0x0a, 0xe1, 0x6c, - 0x83, 0x1e, 0xc0, 0xac, 0x2c, 0x6b, 0x68, 0x94, 0x5b, 0x33, 0x6b, 0xb5, 0x8d, 0xe5, 0x4c, 0x84, - 0x05, 0x99, 0x25, 0xb5, 0x50, 0x56, 0x38, 0x59, 0xd0, 0x6d, 0xd0, 0xf3, 0xb4, 0xb3, 0x28, 0xaa, - 0x2a, 0x78, 0x31, 0xc3, 0x37, 0xd3, 0x00, 0x03, 0x58, 0x0a, 0x38, 0x3d, 0xa1, 0x9c, 0xd3, 0x5e, - 0x6e, 0x2b, 0x7b, 0xdc, 0xd8, 0xb8, 0x3d, 0xa5, 0xf8, 0x34, 0xf9, 0xf5, 0xfd, 0xcc, 0x23, 0x65, - 0xb1, 0xaf, 0xc7, 0x91, 0x35, 0xcd, 0x83, 0xf5, 0x60, 0xc2, 0xb0, 0xfd, 0x9b, 0x06, 0xfa, 0xa4, - 0x37, 0x5a, 0x83, 0xf9, 0xa3, 0xce, 0x93, 0xce, 0xde, 0x37, 0x1d, 0xbd, 0xd4, 0xfc, 0xdf, 0xd9, - 0x79, 0x6b, 0x75, 0xd2, 0xe4, 0xc8, 0x7f, 0xe1, 0xb3, 0x9f, 0x7c, 0x74, 0x07, 0x2a, 0xbb, 0x9d, - 0x83, 0xc3, 0xcd, 0xce, 0xd6, 0xb6, 0xae, 0x35, 0x6f, 0x9e, 0x9d, 0xb7, 0x8c, 0x49, 0xd3, 0xac, - 0xaf, 0xa8, 0x0d, 0xd7, 0x76, 0xf6, 0x0e, 0x0e, 0xf5, 0x72, 0xd3, 0x38, 0x3b, 0x6f, 0xad, 0x4c, - 0xda, 0xed, 0xb0, 0x50, 0xb4, 0x6d, 0xb8, 0x51, 0x10, 0x84, 0xa0, 0xdc, 0x27, 0x1e, 0x66, 0x43, - 0x41, 0xd1, 0x1a, 0xa8, 0x07, 0xe6, 0x93, 0x01, 0x4d, 0x1b, 0x54, 0x8f, 0x23, 0x2b, 0xc7, 0x70, - 0xbe, 0x6b, 0xff, 0x5d, 0x81, 0x6a, 0x4e, 0x82, 0x76, 0xa0, 0xf1, 0x7e, 0xbc, 0x75, 0x5f, 0xd0, - 0x51, 0x3a, 0x6f, 0x56, 0xa6, 0x8a, 0xf9, 0x84, 0x8e, 0xec, 0xfa, 0xab, 0xc8, 0x2a, 0x5d, 0x44, - 0x96, 0x16, 0x47, 0x56, 0x09, 0xd7, 0x13, 0xcf, 0xa7, 0x3c, 0x90, 0xa2, 0x24, 0xb0, 0x5a, 0x60, - 0xca, 0xfb, 0x29, 0x29, 0x93, 0x89, 0x74, 0x73, 0x8a, 0xb2, 0xa0, 0xe9, 0x09, 0xea, 0x95, 0x9c, - 0xba, 0xa8, 0xfb, 0x23, 0x58, 0x2e, 0x84, 0xf0, 0xa9, 0xe8, 0xba, 0xfe, 0x09, 0x53, 0x52, 0xa9, - 0x6d, 0x18, 0x57, 0xb5, 0x7f, 0x82, 0x5a, 0xcf, 0xa9, 0x33, 0x6d, 0x7f, 0x02, 0x35, 0x87, 0x93, - 0xf0, 0x79, 0xd7, 0x61, 0x43, 0x3f, 0x99, 0x18, 0xb3, 0xf6, 0x62, 0x1c, 0x59, 0x45, 0x18, 0x83, - 0x3a, 0x6c, 0xc9, 0x3d, 0xba, 0x05, 0xf5, 0xe4, 0x8a, 0x53, 0x12, 0x32, 0xdf, 0x98, 0x55, 0x62, - 0x4d, 0xcc, 0xb1, 0x82, 0xe4, 0x00, 0x08, 0x05, 0x11, 0xd4, 0x98, 0x53, 0xdd, 0x50, 0xa2, 0x57, - 0x00, 0x4e, 0x16, 0xf4, 0x31, 0x2c, 0x06, 0x1e, 0x71, 0xe8, 0x80, 0xfa, 0xa2, 0x4b, 0x39, 0x67, - 0xdc, 0x98, 0x57, 0x34, 0x8d, 0x1c, 0xde, 0x96, 0xa8, 0x62, 0x72, 0xe5, 0x2f, 0x41, 0xa5, 0xa5, - 0xad, 0xcd, 0xa4, 0x4c, 0x12, 0xc0, 0xc9, 0x82, 0x7e, 0x00, 0x7d, 0xf2, 0x97, 0xc5, 0xa8, 0xaa, - 0x9a, 0xac, 0x66, 0x35, 0x79, 0x56, 0xb8, 0x3f, 0x24, 0x7d, 0xdb, 0x90, 0x25, 0x89, 0x23, 0x6b, - 0xca, 0x11, 0x2f, 0x0e, 0x2e, 0x9b, 0xa2, 0x47, 0x50, 0x09, 0x38, 0x0d, 0xa9, 0xcc, 0x00, 0xd4, - 0x43, 0x6b, 0x4e, 0x55, 0x5a, 0xbe, 0x30, 0x65, 0x91, 0xa8, 0x2e, 0xb3, 0xc7, 0xf9, 0x0e, 0x7d, - 0x0f, 0xcd, 0x4b, 0xea, 0x48, 0xb4, 0xdb, 0xe5, 0x52, 0xbc, 0xa1, 0x51, 0x53, 0xd3, 0xc2, 0xfc, - 0x80, 0x40, 0x0a, 0x1a, 0xc7, 0xab, 0x05, 0x51, 0x14, 0xf0, 0x10, 0xd9, 0x50, 0x1b, 0x50, 0xc1, - 0x5d, 0x47, 0x7e, 0x41, 0x68, 0xd4, 0x15, 0xdb, 0xad, 0xe9, 0x2c, 0x9f, 0x29, 0xa3, 0x43, 0xd2, - 0x0f, 0xb7, 0x7d, 0xc1, 0x47, 0x18, 0x06, 0x39, 0x20, 0x9f, 0xaa, 0x4c, 0x86, 0x1c, 0x7b, 0xd4, - 0x58, 0x68, 0x69, 0x6b, 0x95, 0xe4, 0x53, 0x32, 0x6c, 0xa7, 0x84, 0xf3, 0x3d, 0xb2, 0x61, 0x89, - 0x9c, 0x12, 0xd7, 0x23, 0xc7, 0xae, 0xe7, 0x8a, 0x51, 0xf7, 0x67, 0xe6, 0x53, 0xa3, 0xa1, 0xfa, - 0xac, 0x26, 0xcb, 0xd4, 0x25, 0xd6, 0x8b, 0xd0, 0x77, 0xcc, 0xa7, 0xcd, 0x2f, 0x61, 0x71, 0x22, - 0x1d, 0xa4, 0xc3, 0x4c, 0xf6, 0x00, 0xab, 0x58, 0x6e, 0xd1, 0x0a, 0xcc, 0x9e, 0x12, 0x6f, 0x48, - 0x93, 0x71, 0x8d, 0x93, 0xc3, 0xc3, 0xf2, 0xe7, 0x5a, 0xfb, 0x47, 0xa8, 0x64, 0x35, 0x47, 0x4d, - 0xa8, 0xec, 0xe1, 0x47, 0xbb, 0x9d, 0x4d, 0xfc, 0xad, 0x5e, 0x6a, 0xd6, 0xcf, 0xce, 0x5b, 0x95, - 0x3d, 0xde, 0x73, 0x7d, 0xc2, 0x47, 0xc8, 0x04, 0xd8, 0xfe, 0x7a, 0x73, 0xeb, 0x68, 0xf3, 0x70, - 0xb7, 0xf3, 0x58, 0xd7, 0x9a, 0x8d, 0xb3, 0xf3, 0x16, 0x6c, 0xe7, 0xff, 0x03, 0x90, 0x01, 0xf3, - 0x07, 0x47, 0x07, 0xfb, 0xdb, 0x5b, 0x72, 0xf0, 0xd4, 0xce, 0xce, 0x5b, 0xf3, 0x07, 0xc3, 0x30, - 0xa0, 0x8e, 0xb0, 0x97, 0x61, 0x89, 0x05, 0x52, 0x04, 0x69, 0x9b, 0xe4, 0x97, 0xdb, 0x0f, 0x2e, - 0xde, 0x98, 0xda, 0xeb, 0x37, 0x66, 0xe9, 0xdd, 0x1b, 0x53, 0xfb, 0x65, 0x6c, 0x6a, 0x7f, 0x8d, - 0x4d, 0xed, 0xd5, 0xd8, 0xd4, 0x2e, 0xc6, 0xa6, 0xf6, 0xcf, 0xd8, 0xd4, 0xfe, 0x1d, 0x9b, 0xa5, - 0x77, 0x63, 0x53, 0xfb, 0xfd, 0xad, 0x59, 0xba, 0x78, 0x6b, 0x96, 0x5e, 0xbf, 0x35, 0x4b, 0xc7, - 0x73, 0xea, 0x7f, 0xce, 0xfd, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xa8, 0xf8, 0x7a, 0x0a, 0x4a, - 0x09, 0x00, 0x00, -} - -func (x ActualLRPNetInfo_PreferredAddress) String() string { - s, ok := ActualLRPNetInfo_PreferredAddress_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) +func (x *ProtoActualLRPInstanceKey) Reset() { + *x = ProtoActualLRPInstanceKey{} + mi := &file_actual_lrp_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (x ActualLRP_Presence) String() string { - s, ok := ActualLRP_Presence_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} -func (this *ActualLRPGroup) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPGroup) - if !ok { - that2, ok := that.(ActualLRPGroup) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Instance.Equal(that1.Instance) { - return false - } - if !this.Evacuating.Equal(that1.Evacuating) { - return false - } - return true +func (x *ProtoActualLRPInstanceKey) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *PortMapping) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*PortMapping) - if !ok { - that2, ok := that.(PortMapping) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ContainerPort != that1.ContainerPort { - return false - } - if this.HostPort != that1.HostPort { - return false - } - if this.ContainerTlsProxyPort != that1.ContainerTlsProxyPort { - return false - } - if this.HostTlsProxyPort != that1.HostTlsProxyPort { - return false - } - return true -} -func (this *ActualLRPKey) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoActualLRPInstanceKey) ProtoMessage() {} - that1, ok := that.(*ActualLRPKey) - if !ok { - that2, ok := that.(ActualLRPKey) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoActualLRPInstanceKey) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProcessGuid != that1.ProcessGuid { - return false - } - if this.Index != that1.Index { - return false - } - if this.Domain != that1.Domain { - return false - } - return true + return mi.MessageOf(x) } -func (this *ActualLRPInstanceKey) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPInstanceKey) - if !ok { - that2, ok := that.(ActualLRPInstanceKey) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.InstanceGuid != that1.InstanceGuid { - return false - } - if this.CellId != that1.CellId { - return false - } - return true +// Deprecated: Use ProtoActualLRPInstanceKey.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPInstanceKey) Descriptor() ([]byte, []int) { + return file_actual_lrp_proto_rawDescGZIP(), []int{3} } -func (this *ActualLRPNetInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPNetInfo) - if !ok { - that2, ok := that.(ActualLRPNetInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Address != that1.Address { - return false - } - if len(this.Ports) != len(that1.Ports) { - return false - } - for i := range this.Ports { - if !this.Ports[i].Equal(that1.Ports[i]) { - return false - } - } - if this.InstanceAddress != that1.InstanceAddress { - return false +func (x *ProtoActualLRPInstanceKey) GetInstanceGuid() string { + if x != nil { + return x.InstanceGuid } - if this.PreferredAddress != that1.PreferredAddress { - return false - } - return true + return "" } -func (this *ActualLRPInternalRoute) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPInternalRoute) - if !ok { - that2, ok := that.(ActualLRPInternalRoute) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Hostname != that1.Hostname { - return false +func (x *ProtoActualLRPInstanceKey) GetCellId() string { + if x != nil { + return x.CellId } - return true + return "" } -func (this *ActualLRP) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRP) - if !ok { - that2, ok := that.(ActualLRP) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.ActualLRPKey.Equal(&that1.ActualLRPKey) { - return false - } - if !this.ActualLRPInstanceKey.Equal(&that1.ActualLRPInstanceKey) { - return false - } - if !this.ActualLRPNetInfo.Equal(&that1.ActualLRPNetInfo) { - return false - } - if this.CrashCount != that1.CrashCount { - return false - } - if this.CrashReason != that1.CrashReason { - return false - } - if this.State != that1.State { - return false - } - if this.PlacementError != that1.PlacementError { - return false - } - if this.Since != that1.Since { - return false - } - if !this.ModificationTag.Equal(&that1.ModificationTag) { - return false - } - if this.Presence != that1.Presence { - return false - } - if len(this.ActualLrpInternalRoutes) != len(that1.ActualLrpInternalRoutes) { - return false - } - for i := range this.ActualLrpInternalRoutes { - if !this.ActualLrpInternalRoutes[i].Equal(that1.ActualLrpInternalRoutes[i]) { - return false - } - } - if len(this.MetricTags) != len(that1.MetricTags) { - return false - } - for i := range this.MetricTags { - if this.MetricTags[i] != that1.MetricTags[i] { - return false - } - } - if that1.OptionalRoutable == nil { - if this.OptionalRoutable != nil { - return false - } - } else if this.OptionalRoutable == nil { - return false - } else if !this.OptionalRoutable.Equal(that1.OptionalRoutable) { - return false - } - if this.AvailabilityZone != that1.AvailabilityZone { - return false - } - return true +type ProtoActualLRPNetInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Ports []*ProtoPortMapping `protobuf:"bytes,2,rep,name=ports,proto3" json:"ports,omitempty"` + InstanceAddress string `protobuf:"bytes,3,opt,name=instance_address,proto3" json:"instance_address,omitempty"` + PreferredAddress ProtoActualLRPNetInfo_PreferredAddress `protobuf:"varint,4,opt,name=preferred_address,proto3,enum=models.ProtoActualLRPNetInfo_PreferredAddress" json:"preferred_address,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (this *ActualLRP_Routable) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRP_Routable) - if !ok { - that2, ok := that.(ActualLRP_Routable) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Routable != that1.Routable { - return false - } - return true +func (x *ProtoActualLRPNetInfo) Reset() { + *x = ProtoActualLRPNetInfo{} + mi := &file_actual_lrp_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (this *ActualLRPGroup) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ActualLRPGroup{") - if this.Instance != nil { - s = append(s, "Instance: "+fmt.Sprintf("%#v", this.Instance)+",\n") - } - if this.Evacuating != nil { - s = append(s, "Evacuating: "+fmt.Sprintf("%#v", this.Evacuating)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *PortMapping) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&models.PortMapping{") - s = append(s, "ContainerPort: "+fmt.Sprintf("%#v", this.ContainerPort)+",\n") - s = append(s, "HostPort: "+fmt.Sprintf("%#v", this.HostPort)+",\n") - s = append(s, "ContainerTlsProxyPort: "+fmt.Sprintf("%#v", this.ContainerTlsProxyPort)+",\n") - s = append(s, "HostTlsProxyPort: "+fmt.Sprintf("%#v", this.HostTlsProxyPort)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPKey) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&models.ActualLRPKey{") - s = append(s, "ProcessGuid: "+fmt.Sprintf("%#v", this.ProcessGuid)+",\n") - s = append(s, "Index: "+fmt.Sprintf("%#v", this.Index)+",\n") - s = append(s, "Domain: "+fmt.Sprintf("%#v", this.Domain)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPInstanceKey) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ActualLRPInstanceKey{") - s = append(s, "InstanceGuid: "+fmt.Sprintf("%#v", this.InstanceGuid)+",\n") - s = append(s, "CellId: "+fmt.Sprintf("%#v", this.CellId)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPNetInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&models.ActualLRPNetInfo{") - s = append(s, "Address: "+fmt.Sprintf("%#v", this.Address)+",\n") - if this.Ports != nil { - s = append(s, "Ports: "+fmt.Sprintf("%#v", this.Ports)+",\n") - } - s = append(s, "InstanceAddress: "+fmt.Sprintf("%#v", this.InstanceAddress)+",\n") - s = append(s, "PreferredAddress: "+fmt.Sprintf("%#v", this.PreferredAddress)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPInternalRoute) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.ActualLRPInternalRoute{") - s = append(s, "Hostname: "+fmt.Sprintf("%#v", this.Hostname)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRP) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 18) - s = append(s, "&models.ActualLRP{") - s = append(s, "ActualLRPKey: "+strings.Replace(this.ActualLRPKey.GoString(), `&`, ``, 1)+",\n") - s = append(s, "ActualLRPInstanceKey: "+strings.Replace(this.ActualLRPInstanceKey.GoString(), `&`, ``, 1)+",\n") - s = append(s, "ActualLRPNetInfo: "+strings.Replace(this.ActualLRPNetInfo.GoString(), `&`, ``, 1)+",\n") - s = append(s, "CrashCount: "+fmt.Sprintf("%#v", this.CrashCount)+",\n") - s = append(s, "CrashReason: "+fmt.Sprintf("%#v", this.CrashReason)+",\n") - s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") - s = append(s, "PlacementError: "+fmt.Sprintf("%#v", this.PlacementError)+",\n") - s = append(s, "Since: "+fmt.Sprintf("%#v", this.Since)+",\n") - s = append(s, "ModificationTag: "+strings.Replace(this.ModificationTag.GoString(), `&`, ``, 1)+",\n") - s = append(s, "Presence: "+fmt.Sprintf("%#v", this.Presence)+",\n") - if this.ActualLrpInternalRoutes != nil { - s = append(s, "ActualLrpInternalRoutes: "+fmt.Sprintf("%#v", this.ActualLrpInternalRoutes)+",\n") - } - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]string{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%#v: %#v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - if this.MetricTags != nil { - s = append(s, "MetricTags: "+mapStringForMetricTags+",\n") - } - if this.OptionalRoutable != nil { - s = append(s, "OptionalRoutable: "+fmt.Sprintf("%#v", this.OptionalRoutable)+",\n") - } - s = append(s, "AvailabilityZone: "+fmt.Sprintf("%#v", this.AvailabilityZone)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRP_Routable) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&models.ActualLRP_Routable{` + - `Routable:` + fmt.Sprintf("%#v", this.Routable) + `}`}, ", ") - return s -} -func valueToGoStringActualLrp(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *ActualLRPGroup) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPGroup) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Evacuating != nil { - { - size, err := m.Evacuating.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Instance != nil { - { - size, err := m.Instance.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + +func (x *ProtoActualLRPNetInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PortMapping) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (*ProtoActualLRPNetInfo) ProtoMessage() {} + +func (x *ProtoActualLRPNetInfo) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *PortMapping) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoActualLRPNetInfo.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPNetInfo) Descriptor() ([]byte, []int) { + return file_actual_lrp_proto_rawDescGZIP(), []int{4} } -func (m *PortMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.HostTlsProxyPort != 0 { - i = encodeVarintActualLrp(dAtA, i, uint64(m.HostTlsProxyPort)) - i-- - dAtA[i] = 0x20 - } - if m.ContainerTlsProxyPort != 0 { - i = encodeVarintActualLrp(dAtA, i, uint64(m.ContainerTlsProxyPort)) - i-- - dAtA[i] = 0x18 - } - if m.HostPort != 0 { - i = encodeVarintActualLrp(dAtA, i, uint64(m.HostPort)) - i-- - dAtA[i] = 0x10 - } - if m.ContainerPort != 0 { - i = encodeVarintActualLrp(dAtA, i, uint64(m.ContainerPort)) - i-- - dAtA[i] = 0x8 +func (x *ProtoActualLRPNetInfo) GetAddress() string { + if x != nil { + return x.Address } - return len(dAtA) - i, nil + return "" } -func (m *ActualLRPKey) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoActualLRPNetInfo) GetPorts() []*ProtoPortMapping { + if x != nil { + return x.Ports } - return dAtA[:n], nil -} - -func (m *ActualLRPKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return nil } -func (m *ActualLRPKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Domain) > 0 { - i -= len(m.Domain) - copy(dAtA[i:], m.Domain) - i = encodeVarintActualLrp(dAtA, i, uint64(len(m.Domain))) - i-- - dAtA[i] = 0x1a - } - if m.Index != 0 { - i = encodeVarintActualLrp(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x10 +func (x *ProtoActualLRPNetInfo) GetInstanceAddress() string { + if x != nil { + return x.InstanceAddress } - if len(m.ProcessGuid) > 0 { - i -= len(m.ProcessGuid) - copy(dAtA[i:], m.ProcessGuid) - i = encodeVarintActualLrp(dAtA, i, uint64(len(m.ProcessGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return "" } -func (m *ActualLRPInstanceKey) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoActualLRPNetInfo) GetPreferredAddress() ProtoActualLRPNetInfo_PreferredAddress { + if x != nil { + return x.PreferredAddress } - return dAtA[:n], nil + return ProtoActualLRPNetInfo_UNKNOWN } -func (m *ActualLRPInstanceKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type ProtoActualLRPInternalRoute struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPInstanceKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CellId) > 0 { - i -= len(m.CellId) - copy(dAtA[i:], m.CellId) - i = encodeVarintActualLrp(dAtA, i, uint64(len(m.CellId))) - i-- - dAtA[i] = 0x12 - } - if len(m.InstanceGuid) > 0 { - i -= len(m.InstanceGuid) - copy(dAtA[i:], m.InstanceGuid) - i = encodeVarintActualLrp(dAtA, i, uint64(len(m.InstanceGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func (x *ProtoActualLRPInternalRoute) Reset() { + *x = ProtoActualLRPInternalRoute{} + mi := &file_actual_lrp_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPNetInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *ProtoActualLRPInternalRoute) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPNetInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func (*ProtoActualLRPInternalRoute) ProtoMessage() {} -func (m *ActualLRPNetInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PreferredAddress != 0 { - i = encodeVarintActualLrp(dAtA, i, uint64(m.PreferredAddress)) - i-- - dAtA[i] = 0x20 - } - if len(m.InstanceAddress) > 0 { - i -= len(m.InstanceAddress) - copy(dAtA[i:], m.InstanceAddress) - i = encodeVarintActualLrp(dAtA, i, uint64(len(m.InstanceAddress))) - i-- - dAtA[i] = 0x1a - } - if len(m.Ports) > 0 { - for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func (x *ProtoActualLRPInternalRoute) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintActualLrp(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *ActualLRPInternalRoute) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +// Deprecated: Use ProtoActualLRPInternalRoute.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPInternalRoute) Descriptor() ([]byte, []int) { + return file_actual_lrp_proto_rawDescGZIP(), []int{5} } -func (m *ActualLRPInternalRoute) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *ProtoActualLRPInternalRoute) GetHostname() string { + if x != nil { + return x.Hostname + } + return "" } -func (m *ActualLRPInternalRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Hostname) > 0 { - i -= len(m.Hostname) - copy(dAtA[i:], m.Hostname) - i = encodeVarintActualLrp(dAtA, i, uint64(len(m.Hostname))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +type ProtoActualLRP struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpKey *ProtoActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,json=actualLrpKey,proto3" json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ProtoActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,json=actualLrpInstanceKey,proto3" json:"actual_lrp_instance_key,omitempty"` + ActualLrpNetInfo *ProtoActualLRPNetInfo `protobuf:"bytes,3,opt,name=actual_lrp_net_info,json=actualLrpNetInfo,proto3" json:"actual_lrp_net_info,omitempty"` + CrashCount int32 `protobuf:"varint,4,opt,name=crash_count,proto3" json:"crash_count,omitempty"` + CrashReason string `protobuf:"bytes,5,opt,name=crash_reason,proto3" json:"crash_reason,omitempty"` + State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state,omitempty"` + PlacementError string `protobuf:"bytes,7,opt,name=placement_error,proto3" json:"placement_error,omitempty"` + Since int64 `protobuf:"varint,8,opt,name=since,proto3" json:"since,omitempty"` + ModificationTag *ProtoModificationTag `protobuf:"bytes,9,opt,name=modification_tag,proto3" json:"modification_tag,omitempty"` + Presence ProtoActualLRP_Presence `protobuf:"varint,10,opt,name=presence,proto3,enum=models.ProtoActualLRP_Presence" json:"presence,omitempty"` + ActualLrpInternalRoutes []*ProtoActualLRPInternalRoute `protobuf:"bytes,11,rep,name=actual_lrp_internal_routes,json=actualLrpInternalRoutes,proto3" json:"actual_lrp_internal_routes,omitempty"` + MetricTags map[string]string `protobuf:"bytes,12,rep,name=metric_tags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Routable *bool `protobuf:"varint,13,opt,name=routable,proto3,oneof" json:"routable,omitempty"` + AvailabilityZone string `protobuf:"bytes,14,opt,name=availability_zone,proto3" json:"availability_zone,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRP) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *ProtoActualLRP) Reset() { + *x = ProtoActualLRP{} + mi := &file_actual_lrp_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRP) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *ProtoActualLRP) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRP) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AvailabilityZone) > 0 { - i -= len(m.AvailabilityZone) - copy(dAtA[i:], m.AvailabilityZone) - i = encodeVarintActualLrp(dAtA, i, uint64(len(m.AvailabilityZone))) - i-- - dAtA[i] = 0x72 - } - if m.OptionalRoutable != nil { - { - size := m.OptionalRoutable.Size() - i -= size - if _, err := m.OptionalRoutable.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.MetricTags) > 0 { - for k := range m.MetricTags { - v := m.MetricTags[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintActualLrp(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintActualLrp(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintActualLrp(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x62 - } - } - if len(m.ActualLrpInternalRoutes) > 0 { - for iNdEx := len(m.ActualLrpInternalRoutes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ActualLrpInternalRoutes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } - } - if m.Presence != 0 { - i = encodeVarintActualLrp(dAtA, i, uint64(m.Presence)) - i-- - dAtA[i] = 0x50 - } - { - size, err := m.ModificationTag.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - if m.Since != 0 { - i = encodeVarintActualLrp(dAtA, i, uint64(m.Since)) - i-- - dAtA[i] = 0x40 - } - if len(m.PlacementError) > 0 { - i -= len(m.PlacementError) - copy(dAtA[i:], m.PlacementError) - i = encodeVarintActualLrp(dAtA, i, uint64(len(m.PlacementError))) - i-- - dAtA[i] = 0x3a - } - if len(m.State) > 0 { - i -= len(m.State) - copy(dAtA[i:], m.State) - i = encodeVarintActualLrp(dAtA, i, uint64(len(m.State))) - i-- - dAtA[i] = 0x32 - } - if len(m.CrashReason) > 0 { - i -= len(m.CrashReason) - copy(dAtA[i:], m.CrashReason) - i = encodeVarintActualLrp(dAtA, i, uint64(len(m.CrashReason))) - i-- - dAtA[i] = 0x2a - } - if m.CrashCount != 0 { - i = encodeVarintActualLrp(dAtA, i, uint64(m.CrashCount)) - i-- - dAtA[i] = 0x20 - } - { - size, err := m.ActualLRPNetInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.ActualLRPInstanceKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.ActualLRPKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err +func (*ProtoActualLRP) ProtoMessage() {} + +func (x *ProtoActualLRP) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - i -= size - i = encodeVarintActualLrp(dAtA, i, uint64(size)) + return ms } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *ActualLRP_Routable) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoActualLRP.ProtoReflect.Descriptor instead. +func (*ProtoActualLRP) Descriptor() ([]byte, []int) { + return file_actual_lrp_proto_rawDescGZIP(), []int{6} } -func (m *ActualLRP_Routable) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i-- - if m.Routable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x68 - return len(dAtA) - i, nil -} -func encodeVarintActualLrp(dAtA []byte, offset int, v uint64) int { - offset -= sovActualLrp(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (x *ProtoActualLRP) GetActualLrpKey() *ProtoActualLRPKey { + if x != nil { + return x.ActualLrpKey } - dAtA[offset] = uint8(v) - return base -} -func (m *ActualLRPGroup) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Instance != nil { - l = m.Instance.Size() - n += 1 + l + sovActualLrp(uint64(l)) - } - if m.Evacuating != nil { - l = m.Evacuating.Size() - n += 1 + l + sovActualLrp(uint64(l)) - } - return n + return nil } -func (m *PortMapping) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ContainerPort != 0 { - n += 1 + sovActualLrp(uint64(m.ContainerPort)) - } - if m.HostPort != 0 { - n += 1 + sovActualLrp(uint64(m.HostPort)) +func (x *ProtoActualLRP) GetActualLrpInstanceKey() *ProtoActualLRPInstanceKey { + if x != nil { + return x.ActualLrpInstanceKey } - if m.ContainerTlsProxyPort != 0 { - n += 1 + sovActualLrp(uint64(m.ContainerTlsProxyPort)) - } - if m.HostTlsProxyPort != 0 { - n += 1 + sovActualLrp(uint64(m.HostTlsProxyPort)) - } - return n + return nil } -func (m *ActualLRPKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProcessGuid) - if l > 0 { - n += 1 + l + sovActualLrp(uint64(l)) - } - if m.Index != 0 { - n += 1 + sovActualLrp(uint64(m.Index)) +func (x *ProtoActualLRP) GetActualLrpNetInfo() *ProtoActualLRPNetInfo { + if x != nil { + return x.ActualLrpNetInfo } - l = len(m.Domain) - if l > 0 { - n += 1 + l + sovActualLrp(uint64(l)) - } - return n + return nil } -func (m *ActualLRPInstanceKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.InstanceGuid) - if l > 0 { - n += 1 + l + sovActualLrp(uint64(l)) +func (x *ProtoActualLRP) GetCrashCount() int32 { + if x != nil { + return x.CrashCount } - l = len(m.CellId) - if l > 0 { - n += 1 + l + sovActualLrp(uint64(l)) - } - return n + return 0 } -func (m *ActualLRPNetInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovActualLrp(uint64(l)) +func (x *ProtoActualLRP) GetCrashReason() string { + if x != nil { + return x.CrashReason } - if len(m.Ports) > 0 { - for _, e := range m.Ports { - l = e.Size() - n += 1 + l + sovActualLrp(uint64(l)) - } - } - l = len(m.InstanceAddress) - if l > 0 { - n += 1 + l + sovActualLrp(uint64(l)) - } - if m.PreferredAddress != 0 { - n += 1 + sovActualLrp(uint64(m.PreferredAddress)) - } - return n + return "" } -func (m *ActualLRPInternalRoute) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Hostname) - if l > 0 { - n += 1 + l + sovActualLrp(uint64(l)) +func (x *ProtoActualLRP) GetState() string { + if x != nil { + return x.State } - return n + return "" } -func (m *ActualLRP) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ActualLRPKey.Size() - n += 1 + l + sovActualLrp(uint64(l)) - l = m.ActualLRPInstanceKey.Size() - n += 1 + l + sovActualLrp(uint64(l)) - l = m.ActualLRPNetInfo.Size() - n += 1 + l + sovActualLrp(uint64(l)) - if m.CrashCount != 0 { - n += 1 + sovActualLrp(uint64(m.CrashCount)) - } - l = len(m.CrashReason) - if l > 0 { - n += 1 + l + sovActualLrp(uint64(l)) - } - l = len(m.State) - if l > 0 { - n += 1 + l + sovActualLrp(uint64(l)) - } - l = len(m.PlacementError) - if l > 0 { - n += 1 + l + sovActualLrp(uint64(l)) - } - if m.Since != 0 { - n += 1 + sovActualLrp(uint64(m.Since)) - } - l = m.ModificationTag.Size() - n += 1 + l + sovActualLrp(uint64(l)) - if m.Presence != 0 { - n += 1 + sovActualLrp(uint64(m.Presence)) - } - if len(m.ActualLrpInternalRoutes) > 0 { - for _, e := range m.ActualLrpInternalRoutes { - l = e.Size() - n += 1 + l + sovActualLrp(uint64(l)) - } - } - if len(m.MetricTags) > 0 { - for k, v := range m.MetricTags { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovActualLrp(uint64(len(k))) + 1 + len(v) + sovActualLrp(uint64(len(v))) - n += mapEntrySize + 1 + sovActualLrp(uint64(mapEntrySize)) - } - } - if m.OptionalRoutable != nil { - n += m.OptionalRoutable.Size() +func (x *ProtoActualLRP) GetPlacementError() string { + if x != nil { + return x.PlacementError } - l = len(m.AvailabilityZone) - if l > 0 { - n += 1 + l + sovActualLrp(uint64(l)) - } - return n + return "" } -func (m *ActualLRP_Routable) Size() (n int) { - if m == nil { - return 0 +func (x *ProtoActualLRP) GetSince() int64 { + if x != nil { + return x.Since } - var l int - _ = l - n += 2 - return n -} - -func sovActualLrp(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozActualLrp(x uint64) (n int) { - return sovActualLrp(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return 0 } -func (this *ActualLRPGroup) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPGroup{`, - `Instance:` + strings.Replace(this.Instance.String(), "ActualLRP", "ActualLRP", 1) + `,`, - `Evacuating:` + strings.Replace(this.Evacuating.String(), "ActualLRP", "ActualLRP", 1) + `,`, - `}`, - }, "") - return s -} -func (this *PortMapping) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PortMapping{`, - `ContainerPort:` + fmt.Sprintf("%v", this.ContainerPort) + `,`, - `HostPort:` + fmt.Sprintf("%v", this.HostPort) + `,`, - `ContainerTlsProxyPort:` + fmt.Sprintf("%v", this.ContainerTlsProxyPort) + `,`, - `HostTlsProxyPort:` + fmt.Sprintf("%v", this.HostTlsProxyPort) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPKey) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPKey{`, - `ProcessGuid:` + fmt.Sprintf("%v", this.ProcessGuid) + `,`, - `Index:` + fmt.Sprintf("%v", this.Index) + `,`, - `Domain:` + fmt.Sprintf("%v", this.Domain) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPInstanceKey) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPInstanceKey{`, - `InstanceGuid:` + fmt.Sprintf("%v", this.InstanceGuid) + `,`, - `CellId:` + fmt.Sprintf("%v", this.CellId) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPNetInfo) String() string { - if this == nil { - return "nil" - } - repeatedStringForPorts := "[]*PortMapping{" - for _, f := range this.Ports { - repeatedStringForPorts += strings.Replace(f.String(), "PortMapping", "PortMapping", 1) + "," - } - repeatedStringForPorts += "}" - s := strings.Join([]string{`&ActualLRPNetInfo{`, - `Address:` + fmt.Sprintf("%v", this.Address) + `,`, - `Ports:` + repeatedStringForPorts + `,`, - `InstanceAddress:` + fmt.Sprintf("%v", this.InstanceAddress) + `,`, - `PreferredAddress:` + fmt.Sprintf("%v", this.PreferredAddress) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPInternalRoute) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPInternalRoute{`, - `Hostname:` + fmt.Sprintf("%v", this.Hostname) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRP) String() string { - if this == nil { - return "nil" - } - repeatedStringForActualLrpInternalRoutes := "[]*ActualLRPInternalRoute{" - for _, f := range this.ActualLrpInternalRoutes { - repeatedStringForActualLrpInternalRoutes += strings.Replace(f.String(), "ActualLRPInternalRoute", "ActualLRPInternalRoute", 1) + "," - } - repeatedStringForActualLrpInternalRoutes += "}" - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]string{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%v: %v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - s := strings.Join([]string{`&ActualLRP{`, - `ActualLRPKey:` + strings.Replace(strings.Replace(this.ActualLRPKey.String(), "ActualLRPKey", "ActualLRPKey", 1), `&`, ``, 1) + `,`, - `ActualLRPInstanceKey:` + strings.Replace(strings.Replace(this.ActualLRPInstanceKey.String(), "ActualLRPInstanceKey", "ActualLRPInstanceKey", 1), `&`, ``, 1) + `,`, - `ActualLRPNetInfo:` + strings.Replace(strings.Replace(this.ActualLRPNetInfo.String(), "ActualLRPNetInfo", "ActualLRPNetInfo", 1), `&`, ``, 1) + `,`, - `CrashCount:` + fmt.Sprintf("%v", this.CrashCount) + `,`, - `CrashReason:` + fmt.Sprintf("%v", this.CrashReason) + `,`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `PlacementError:` + fmt.Sprintf("%v", this.PlacementError) + `,`, - `Since:` + fmt.Sprintf("%v", this.Since) + `,`, - `ModificationTag:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ModificationTag), "ModificationTag", "ModificationTag", 1), `&`, ``, 1) + `,`, - `Presence:` + fmt.Sprintf("%v", this.Presence) + `,`, - `ActualLrpInternalRoutes:` + repeatedStringForActualLrpInternalRoutes + `,`, - `MetricTags:` + mapStringForMetricTags + `,`, - `OptionalRoutable:` + fmt.Sprintf("%v", this.OptionalRoutable) + `,`, - `AvailabilityZone:` + fmt.Sprintf("%v", this.AvailabilityZone) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRP_Routable) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRP_Routable{`, - `Routable:` + fmt.Sprintf("%v", this.Routable) + `,`, - `}`, - }, "") - return s -} -func valueToStringActualLrp(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *ActualLRPGroup) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPGroup: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPGroup: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Instance", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Instance == nil { - m.Instance = &ActualLRP{} - } - if err := m.Instance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evacuating", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Evacuating == nil { - m.Evacuating = &ActualLRP{} - } - if err := m.Evacuating.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoActualLRP) GetModificationTag() *ProtoModificationTag { + if x != nil { + return x.ModificationTag } return nil } -func (m *PortMapping) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PortMapping: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PortMapping: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerPort", wireType) - } - m.ContainerPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ContainerPort |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HostPort", wireType) - } - m.HostPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HostPort |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerTlsProxyPort", wireType) - } - m.ContainerTlsProxyPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ContainerTlsProxyPort |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HostTlsProxyPort", wireType) - } - m.HostTlsProxyPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HostTlsProxyPort |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipActualLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoActualLRP) GetPresence() ProtoActualLRP_Presence { + if x != nil { + return x.Presence } - return nil + return ProtoActualLRP_ORDINARY } -func (m *ActualLRPKey) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoActualLRP) GetActualLrpInternalRoutes() []*ProtoActualLRPInternalRoute { + if x != nil { + return x.ActualLrpInternalRoutes } return nil } -func (m *ActualLRPInstanceKey) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPInstanceKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPInstanceKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstanceGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InstanceGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CellId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CellId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoActualLRP) GetMetricTags() map[string]string { + if x != nil { + return x.MetricTags } return nil } -func (m *ActualLRPNetInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPNetInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPNetInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ports = append(m.Ports, &PortMapping{}) - if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstanceAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InstanceAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PreferredAddress", wireType) - } - m.PreferredAddress = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PreferredAddress |= ActualLRPNetInfo_PreferredAddress(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipActualLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoActualLRP) GetRoutable() bool { + if x != nil && x.Routable != nil { + return *x.Routable } - return nil + return false } -func (m *ActualLRPInternalRoute) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPInternalRoute: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPInternalRoute: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hostname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoActualLRP) GetAvailabilityZone() string { + if x != nil { + return x.AvailabilityZone } - return nil + return "" } -func (m *ActualLRP) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRP: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRP: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLRPKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ActualLRPKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLRPInstanceKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ActualLRPInstanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLRPNetInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ActualLRPNetInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CrashCount", wireType) - } - m.CrashCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CrashCount |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CrashReason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CrashReason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.State = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlacementError", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PlacementError = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Since", wireType) - } - m.Since = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Since |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ModificationTag", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ModificationTag.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Presence", wireType) - } - m.Presence = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Presence |= ActualLRP_Presence(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpInternalRoutes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ActualLrpInternalRoutes = append(m.ActualLrpInternalRoutes, &ActualLRPInternalRoute{}) - if err := m.ActualLrpInternalRoutes[len(m.ActualLrpInternalRoutes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricTags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MetricTags == nil { - m.MetricTags = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthActualLrp - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthActualLrp - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthActualLrp - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthActualLrp - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipActualLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrp - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.MetricTags[mapkey] = mapvalue - iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Routable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.OptionalRoutable = &ActualLRP_Routable{b} - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AvailabilityZone", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AvailabilityZone = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipActualLrp(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowActualLrp - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowActualLrp - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowActualLrp - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthActualLrp - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupActualLrp - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthActualLrp - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +var File_actual_lrp_proto protoreflect.FileDescriptor + +const file_actual_lrp_proto_rawDesc = "" + + "\n" + + "\x10actual_lrp.proto\x12\x06models\x1a\tbbs.proto\x1a\x16modification_tag.proto\"\x85\x01\n" + + "\x13ProtoActualLRPGroup\x122\n" + + "\binstance\x18\x01 \x01(\v2\x16.models.ProtoActualLRPR\binstance\x126\n" + + "\n" + + "evacuating\x18\x02 \x01(\v2\x16.models.ProtoActualLRPR\n" + + "evacuating:\x02\x18\x01\"\xda\x01\n" + + "\x10ProtoPortMapping\x12+\n" + + "\x0econtainer_port\x18\x01 \x01(\rB\x03\xc0>\x01R\x0econtainer_port\x12!\n" + + "\thost_port\x18\x02 \x01(\rB\x03\xc0>\x01R\thost_port\x12?\n" + + "\x18container_tls_proxy_port\x18\x03 \x01(\rB\x03\xc0>\x01R\x18container_tls_proxy_port\x125\n" + + "\x13host_tls_proxy_port\x18\x04 \x01(\rB\x03\xc0>\x01R\x13host_tls_proxy_port\"t\n" + + "\x11ProtoActualLRPKey\x12'\n" + + "\fprocess_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\fprocess_guid\x12\x19\n" + + "\x05index\x18\x02 \x01(\x05B\x03\xc0>\x01R\x05index\x12\x1b\n" + + "\x06domain\x18\x03 \x01(\tB\x03\xc0>\x01R\x06domain\"e\n" + + "\x19ProtoActualLRPInstanceKey\x12)\n" + + "\rinstance_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\rinstance_guid\x12\x1d\n" + + "\acell_id\x18\x02 \x01(\tB\x03\xc0>\x01R\acell_id\"\x86\x03\n" + + "\x15ProtoActualLRPNetInfo\x12\x1d\n" + + "\aaddress\x18\x01 \x01(\tB\x03\xc0>\x01R\aaddress\x123\n" + + "\x05ports\x18\x02 \x03(\v2\x18.models.ProtoPortMappingB\x03\xc0>\x01R\x05ports\x12*\n" + + "\x10instance_address\x18\x03 \x01(\tR\x10instance_address\x12a\n" + + "\x11preferred_address\x18\x04 \x01(\x0e2..models.ProtoActualLRPNetInfo.PreferredAddressB\x03\xc0>\x01R\x11preferred_address\"\x89\x01\n" + + "\x10PreferredAddress\x12'\n" + + "\aUNKNOWN\x10\x00\x1a\x1a\x82}\x17PreferredAddressUnknown\x12)\n" + + "\bINSTANCE\x10\x01\x1a\x1b\x82}\x18PreferredAddressInstance\x12!\n" + + "\x04HOST\x10\x02\x1a\x17\x82}\x14PreferredAddressHost\">\n" + + "\x1bProtoActualLRPInternalRoute\x12\x1f\n" + + "\bhostname\x18\x01 \x01(\tB\x03\xc0>\x01R\bhostname\"\xfb\a\n" + + "\x0eProtoActualLRP\x12G\n" + + "\x0eactual_lrp_key\x18\x01 \x01(\v2\x19.models.ProtoActualLRPKeyB\x06\xc0>\x01\x90?\x01R\factualLrpKey\x12`\n" + + "\x17actual_lrp_instance_key\x18\x02 \x01(\v2!.models.ProtoActualLRPInstanceKeyB\x06\xc0>\x01\x90?\x01R\x14actualLrpInstanceKey\x12T\n" + + "\x13actual_lrp_net_info\x18\x03 \x01(\v2\x1d.models.ProtoActualLRPNetInfoB\x06\xc0>\x01\x90?\x01R\x10actualLrpNetInfo\x12%\n" + + "\vcrash_count\x18\x04 \x01(\x05B\x03\xc0>\x01R\vcrash_count\x12\"\n" + + "\fcrash_reason\x18\x05 \x01(\tR\fcrash_reason\x12\x19\n" + + "\x05state\x18\x06 \x01(\tB\x03\xc0>\x01R\x05state\x12(\n" + + "\x0fplacement_error\x18\a \x01(\tR\x0fplacement_error\x12\x19\n" + + "\x05since\x18\b \x01(\x03B\x03\xc0>\x01R\x05since\x12P\n" + + "\x10modification_tag\x18\t \x01(\v2\x1c.models.ProtoModificationTagB\x06\xc0>\x01\x90?\x01R\x10modification_tag\x12;\n" + + "\bpresence\x18\n" + + " \x01(\x0e2\x1f.models.ProtoActualLRP.PresenceR\bpresence\x12`\n" + + "\x1aactual_lrp_internal_routes\x18\v \x03(\v2#.models.ProtoActualLRPInternalRouteR\x17actualLrpInternalRoutes\x12H\n" + + "\vmetric_tags\x18\f \x03(\v2&.models.ProtoActualLRP.MetricTagsEntryR\vmetric_tags\x12$\n" + + "\broutable\x18\r \x01(\bB\x03\xc0>\x01H\x00R\broutable\x88\x01\x01\x121\n" + + "\x11availability_zone\x18\x0e \x01(\tB\x03\xc0>\x01R\x11availability_zone\x1a=\n" + + "\x0fMetricTagsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"]\n" + + "\bPresence\x12\x19\n" + + "\bORDINARY\x10\x00\x1a\v\x82}\bOrdinary\x12\x1d\n" + + "\n" + + "EVACUATING\x10\x01\x1a\r\x82}\n" + + "Evacuating\x12\x17\n" + + "\aSUSPECT\x10\x02\x1a\n" + + "\x82}\aSuspectB\v\n" + + "\t_routableB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthActualLrp = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowActualLrp = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupActualLrp = fmt.Errorf("proto: unexpected end of group") + file_actual_lrp_proto_rawDescOnce sync.Once + file_actual_lrp_proto_rawDescData []byte ) + +func file_actual_lrp_proto_rawDescGZIP() []byte { + file_actual_lrp_proto_rawDescOnce.Do(func() { + file_actual_lrp_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_actual_lrp_proto_rawDesc), len(file_actual_lrp_proto_rawDesc))) + }) + return file_actual_lrp_proto_rawDescData +} + +var file_actual_lrp_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_actual_lrp_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_actual_lrp_proto_goTypes = []any{ + (ProtoActualLRPNetInfo_PreferredAddress)(0), // 0: models.ProtoActualLRPNetInfo.PreferredAddress + (ProtoActualLRP_Presence)(0), // 1: models.ProtoActualLRP.Presence + (*ProtoActualLRPGroup)(nil), // 2: models.ProtoActualLRPGroup + (*ProtoPortMapping)(nil), // 3: models.ProtoPortMapping + (*ProtoActualLRPKey)(nil), // 4: models.ProtoActualLRPKey + (*ProtoActualLRPInstanceKey)(nil), // 5: models.ProtoActualLRPInstanceKey + (*ProtoActualLRPNetInfo)(nil), // 6: models.ProtoActualLRPNetInfo + (*ProtoActualLRPInternalRoute)(nil), // 7: models.ProtoActualLRPInternalRoute + (*ProtoActualLRP)(nil), // 8: models.ProtoActualLRP + nil, // 9: models.ProtoActualLRP.MetricTagsEntry + (*ProtoModificationTag)(nil), // 10: models.ProtoModificationTag +} +var file_actual_lrp_proto_depIdxs = []int32{ + 8, // 0: models.ProtoActualLRPGroup.instance:type_name -> models.ProtoActualLRP + 8, // 1: models.ProtoActualLRPGroup.evacuating:type_name -> models.ProtoActualLRP + 3, // 2: models.ProtoActualLRPNetInfo.ports:type_name -> models.ProtoPortMapping + 0, // 3: models.ProtoActualLRPNetInfo.preferred_address:type_name -> models.ProtoActualLRPNetInfo.PreferredAddress + 4, // 4: models.ProtoActualLRP.actual_lrp_key:type_name -> models.ProtoActualLRPKey + 5, // 5: models.ProtoActualLRP.actual_lrp_instance_key:type_name -> models.ProtoActualLRPInstanceKey + 6, // 6: models.ProtoActualLRP.actual_lrp_net_info:type_name -> models.ProtoActualLRPNetInfo + 10, // 7: models.ProtoActualLRP.modification_tag:type_name -> models.ProtoModificationTag + 1, // 8: models.ProtoActualLRP.presence:type_name -> models.ProtoActualLRP.Presence + 7, // 9: models.ProtoActualLRP.actual_lrp_internal_routes:type_name -> models.ProtoActualLRPInternalRoute + 9, // 10: models.ProtoActualLRP.metric_tags:type_name -> models.ProtoActualLRP.MetricTagsEntry + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_actual_lrp_proto_init() } +func file_actual_lrp_proto_init() { + if File_actual_lrp_proto != nil { + return + } + file_bbs_proto_init() + file_modification_tag_proto_init() + file_actual_lrp_proto_msgTypes[6].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_actual_lrp_proto_rawDesc), len(file_actual_lrp_proto_rawDesc)), + NumEnums: 2, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_actual_lrp_proto_goTypes, + DependencyIndexes: file_actual_lrp_proto_depIdxs, + EnumInfos: file_actual_lrp_proto_enumTypes, + MessageInfos: file_actual_lrp_proto_msgTypes, + }.Build() + File_actual_lrp_proto = out.File + file_actual_lrp_proto_goTypes = nil + file_actual_lrp_proto_depIdxs = nil +} diff --git a/models/actual_lrp.proto b/models/actual_lrp.proto index aa089c96..98618861 100644 --- a/models/actual_lrp.proto +++ b/models/actual_lrp.proto @@ -1,75 +1,72 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; import "modification_tag.proto"; -option (gogoproto.goproto_enum_prefix_all) = true; - -message ActualLRPGroup { +message ProtoActualLRPGroup { option deprecated = true; - ActualLRP instance = 1; - ActualLRP evacuating = 2; + ProtoActualLRP instance = 1; + ProtoActualLRP evacuating = 2; } -message PortMapping { - uint32 container_port = 1 [(gogoproto.jsontag) = "container_port"]; - uint32 host_port = 2 [(gogoproto.jsontag) = "host_port"]; - uint32 container_tls_proxy_port = 3 [(gogoproto.jsontag) = "container_tls_proxy_port"]; - uint32 host_tls_proxy_port = 4 [(gogoproto.jsontag) = "host_tls_proxy_port"]; +message ProtoPortMapping { + uint32 container_port = 1 [json_name = "container_port", (bbs.bbs_json_always_emit) = true]; + uint32 host_port = 2 [json_name = "host_port", (bbs.bbs_json_always_emit) = true]; + uint32 container_tls_proxy_port = 3 [json_name = "container_tls_proxy_port", (bbs.bbs_json_always_emit) = true]; + uint32 host_tls_proxy_port = 4 [json_name = "host_tls_proxy_port", (bbs.bbs_json_always_emit) = true]; } -message ActualLRPKey { - string process_guid = 1 [(gogoproto.jsontag) = "process_guid"]; - int32 index = 2 [(gogoproto.jsontag) = "index"]; - string domain = 3 [(gogoproto.jsontag) = "domain"]; +message ProtoActualLRPKey { + string process_guid = 1 [json_name = "process_guid", (bbs.bbs_json_always_emit) = true]; + int32 index = 2 [json_name = "index", (bbs.bbs_json_always_emit) = true]; + string domain = 3 [json_name = "domain", (bbs.bbs_json_always_emit) = true]; } -message ActualLRPInstanceKey { - string instance_guid = 1 [(gogoproto.jsontag) = "instance_guid"]; - string cell_id = 2 [(gogoproto.jsontag) = "cell_id"]; +message ProtoActualLRPInstanceKey { + string instance_guid = 1 [json_name = "instance_guid", (bbs.bbs_json_always_emit) = true]; + string cell_id = 2 [json_name = "cell_id", (bbs.bbs_json_always_emit) = true]; } -message ActualLRPNetInfo { - string address = 1 [(gogoproto.jsontag) = "address"]; - repeated PortMapping ports = 2 [(gogoproto.jsontag) = "ports"]; - string instance_address = 3; +message ProtoActualLRPNetInfo { + string address = 1 [json_name = "address", (bbs.bbs_json_always_emit) = true]; + repeated ProtoPortMapping ports = 2 [json_name = "ports", (bbs.bbs_json_always_emit) = true]; + string instance_address = 3 [json_name = "instance_address"]; enum PreferredAddress { - UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "PreferredAddressUnknown"]; - INSTANCE = 1 [(gogoproto.enumvalue_customname) = "PreferredAddressInstance"]; - HOST = 2 [(gogoproto.enumvalue_customname) = "PreferredAddressHost"]; + UNKNOWN = 0 [(bbs.bbs_enumvalue_customname) = "PreferredAddressUnknown"]; + INSTANCE = 1 [(bbs.bbs_enumvalue_customname) = "PreferredAddressInstance"]; + HOST = 2 [(bbs.bbs_enumvalue_customname) = "PreferredAddressHost"]; } - PreferredAddress preferred_address = 4 [(gogoproto.jsontag) = "preferred_address"]; + PreferredAddress preferred_address = 4 [json_name = "preferred_address", (bbs.bbs_json_always_emit) = true]; } -message ActualLRPInternalRoute { - string hostname = 1 [(gogoproto.jsontag) = "hostname"]; +message ProtoActualLRPInternalRoute { + string hostname = 1 [json_name = "hostname", (bbs.bbs_json_always_emit) = true]; } -message ActualLRP { +message ProtoActualLRP { enum Presence { - ORDINARY = 0 [(gogoproto.enumvalue_customname) = "Ordinary"]; - EVACUATING = 1 [(gogoproto.enumvalue_customname) = "Evacuating"]; - SUSPECT = 2 [(gogoproto.enumvalue_customname) = "Suspect"]; + ORDINARY = 0 [(bbs.bbs_enumvalue_customname) = "Ordinary"]; + EVACUATING = 1 [(bbs.bbs_enumvalue_customname) = "Evacuating"]; + SUSPECT = 2 [(bbs.bbs_enumvalue_customname) = "Suspect"]; } - ActualLRPKey actual_lrp_key = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; - ActualLRPInstanceKey actual_lrp_instance_key = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; - ActualLRPNetInfo actual_lrp_net_info = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; - int32 crash_count = 4 [(gogoproto.jsontag) = "crash_count"]; - string crash_reason = 5; - string state = 6 [(gogoproto.jsontag) = "state"]; - string placement_error = 7; - int64 since = 8 [(gogoproto.jsontag) = "since"]; - ModificationTag modification_tag = 9 [(gogoproto.nullable) = false,(gogoproto.jsontag) = "modification_tag"]; - Presence presence = 10 [(gogoproto.jsontag) = "presence"]; - repeated ActualLRPInternalRoute actual_lrp_internal_routes = 11; - map metric_tags = 12; - oneof optional_routable { - bool routable = 13 [(gogoproto.jsontag) = "routable"]; - } - string availability_zone = 14 [(gogoproto.jsontag) = "availability_zone"]; + ProtoActualLRPKey actual_lrp_key = 1 [(bbs.bbs_by_value) = true, (bbs.bbs_json_always_emit) = true]; + ProtoActualLRPInstanceKey actual_lrp_instance_key = 2 [(bbs.bbs_by_value) = true, (bbs.bbs_json_always_emit) = true]; + ProtoActualLRPNetInfo actual_lrp_net_info = 3 [(bbs.bbs_by_value) = true, (bbs.bbs_json_always_emit) = true]; + int32 crash_count = 4 [json_name = "crash_count", (bbs.bbs_json_always_emit) = true]; + string crash_reason = 5 [json_name = "crash_reason"]; + string state = 6 [json_name = "state", (bbs.bbs_json_always_emit) = true]; + string placement_error = 7 [json_name = "placement_error"]; + int64 since = 8 [json_name = "since", (bbs.bbs_json_always_emit) = true]; + ProtoModificationTag modification_tag = 9 [json_name = "modification_tag", (bbs.bbs_by_value) = true, (bbs.bbs_json_always_emit) = true]; + Presence presence = 10 [json_name = "presence"]; + repeated ProtoActualLRPInternalRoute actual_lrp_internal_routes = 11; + map metric_tags = 12 [json_name = "metric_tags"]; + optional bool routable = 13 [json_name = "routable", (bbs.bbs_json_always_emit) = true]; + string availability_zone = 14 [json_name = "availability_zone", (bbs.bbs_json_always_emit) = true]; } diff --git a/models/actual_lrp_bbs.pb.go b/models/actual_lrp_bbs.pb.go new file mode 100644 index 00000000..81957c06 --- /dev/null +++ b/models/actual_lrp_bbs.pb.go @@ -0,0 +1,1132 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: actual_lrp.proto + +package models + +import ( + strconv "strconv" +) + +// Deprecated: marked deprecated in actual_lrp.proto +// Prevent copylock errors when using ProtoActualLRPGroup directly +type ActualLRPGroup struct { + Instance *ActualLRP `json:"instance,omitempty"` + Evacuating *ActualLRP `json:"evacuating,omitempty"` +} + +func (this *ActualLRPGroup) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPGroup) + if !ok { + that2, ok := that.(ActualLRPGroup) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Instance == nil { + if that1.Instance != nil { + return false + } + } else if !this.Instance.Equal(*that1.Instance) { + return false + } + if this.Evacuating == nil { + if that1.Evacuating != nil { + return false + } + } else if !this.Evacuating.Equal(*that1.Evacuating) { + return false + } + return true +} +func (m *ActualLRPGroup) GetInstance() *ActualLRP { + if m != nil { + return m.Instance + } + return nil +} +func (m *ActualLRPGroup) SetInstance(value *ActualLRP) { + if m != nil { + m.Instance = value + } +} +func (m *ActualLRPGroup) GetEvacuating() *ActualLRP { + if m != nil { + return m.Evacuating + } + return nil +} +func (m *ActualLRPGroup) SetEvacuating(value *ActualLRP) { + if m != nil { + m.Evacuating = value + } +} +func (x *ActualLRPGroup) ToProto() *ProtoActualLRPGroup { + if x == nil { + return nil + } + + proto := &ProtoActualLRPGroup{ + Instance: x.Instance.ToProto(), + Evacuating: x.Evacuating.ToProto(), + } + return proto +} + +func (x *ProtoActualLRPGroup) FromProto() *ActualLRPGroup { + if x == nil { + return nil + } + + copysafe := &ActualLRPGroup{ + Instance: x.Instance.FromProto(), + Evacuating: x.Evacuating.FromProto(), + } + return copysafe +} + +func ActualLRPGroupToProtoSlice(values []*ActualLRPGroup) []*ProtoActualLRPGroup { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPGroup, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPGroupFromProtoSlice(values []*ProtoActualLRPGroup) []*ActualLRPGroup { + if values == nil { + return nil + } + result := make([]*ActualLRPGroup, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoPortMapping directly +type PortMapping struct { + ContainerPort uint32 `json:"container_port"` + HostPort uint32 `json:"host_port"` + ContainerTlsProxyPort uint32 `json:"container_tls_proxy_port"` + HostTlsProxyPort uint32 `json:"host_tls_proxy_port"` +} + +func (this *PortMapping) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*PortMapping) + if !ok { + that2, ok := that.(PortMapping) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ContainerPort != that1.ContainerPort { + return false + } + if this.HostPort != that1.HostPort { + return false + } + if this.ContainerTlsProxyPort != that1.ContainerTlsProxyPort { + return false + } + if this.HostTlsProxyPort != that1.HostTlsProxyPort { + return false + } + return true +} +func (m *PortMapping) GetContainerPort() uint32 { + if m != nil { + return m.ContainerPort + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} +func (m *PortMapping) SetContainerPort(value uint32) { + if m != nil { + m.ContainerPort = value + } +} +func (m *PortMapping) GetHostPort() uint32 { + if m != nil { + return m.HostPort + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} +func (m *PortMapping) SetHostPort(value uint32) { + if m != nil { + m.HostPort = value + } +} +func (m *PortMapping) GetContainerTlsProxyPort() uint32 { + if m != nil { + return m.ContainerTlsProxyPort + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} +func (m *PortMapping) SetContainerTlsProxyPort(value uint32) { + if m != nil { + m.ContainerTlsProxyPort = value + } +} +func (m *PortMapping) GetHostTlsProxyPort() uint32 { + if m != nil { + return m.HostTlsProxyPort + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} +func (m *PortMapping) SetHostTlsProxyPort(value uint32) { + if m != nil { + m.HostTlsProxyPort = value + } +} +func (x *PortMapping) ToProto() *ProtoPortMapping { + if x == nil { + return nil + } + + proto := &ProtoPortMapping{ + ContainerPort: x.ContainerPort, + HostPort: x.HostPort, + ContainerTlsProxyPort: x.ContainerTlsProxyPort, + HostTlsProxyPort: x.HostTlsProxyPort, + } + return proto +} + +func (x *ProtoPortMapping) FromProto() *PortMapping { + if x == nil { + return nil + } + + copysafe := &PortMapping{ + ContainerPort: x.ContainerPort, + HostPort: x.HostPort, + ContainerTlsProxyPort: x.ContainerTlsProxyPort, + HostTlsProxyPort: x.HostTlsProxyPort, + } + return copysafe +} + +func PortMappingToProtoSlice(values []*PortMapping) []*ProtoPortMapping { + if values == nil { + return nil + } + result := make([]*ProtoPortMapping, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func PortMappingFromProtoSlice(values []*ProtoPortMapping) []*PortMapping { + if values == nil { + return nil + } + result := make([]*PortMapping, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoActualLRPKey directly +type ActualLRPKey struct { + ProcessGuid string `json:"process_guid"` + Index int32 `json:"index"` + Domain string `json:"domain"` +} + +func (this *ActualLRPKey) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPKey) + if !ok { + that2, ok := that.(ActualLRPKey) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ProcessGuid != that1.ProcessGuid { + return false + } + if this.Index != that1.Index { + return false + } + if this.Domain != that1.Domain { + return false + } + return true +} +func (m *ActualLRPKey) GetProcessGuid() string { + if m != nil { + return m.ProcessGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPKey) SetProcessGuid(value string) { + if m != nil { + m.ProcessGuid = value + } +} +func (m *ActualLRPKey) GetIndex() int32 { + if m != nil { + return m.Index + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *ActualLRPKey) SetIndex(value int32) { + if m != nil { + m.Index = value + } +} +func (m *ActualLRPKey) GetDomain() string { + if m != nil { + return m.Domain + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPKey) SetDomain(value string) { + if m != nil { + m.Domain = value + } +} +func (x *ActualLRPKey) ToProto() *ProtoActualLRPKey { + if x == nil { + return nil + } + + proto := &ProtoActualLRPKey{ + ProcessGuid: x.ProcessGuid, + Index: x.Index, + Domain: x.Domain, + } + return proto +} + +func (x *ProtoActualLRPKey) FromProto() *ActualLRPKey { + if x == nil { + return nil + } + + copysafe := &ActualLRPKey{ + ProcessGuid: x.ProcessGuid, + Index: x.Index, + Domain: x.Domain, + } + return copysafe +} + +func ActualLRPKeyToProtoSlice(values []*ActualLRPKey) []*ProtoActualLRPKey { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPKey, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPKeyFromProtoSlice(values []*ProtoActualLRPKey) []*ActualLRPKey { + if values == nil { + return nil + } + result := make([]*ActualLRPKey, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoActualLRPInstanceKey directly +type ActualLRPInstanceKey struct { + InstanceGuid string `json:"instance_guid"` + CellId string `json:"cell_id"` +} + +func (this *ActualLRPInstanceKey) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPInstanceKey) + if !ok { + that2, ok := that.(ActualLRPInstanceKey) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.InstanceGuid != that1.InstanceGuid { + return false + } + if this.CellId != that1.CellId { + return false + } + return true +} +func (m *ActualLRPInstanceKey) GetInstanceGuid() string { + if m != nil { + return m.InstanceGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPInstanceKey) SetInstanceGuid(value string) { + if m != nil { + m.InstanceGuid = value + } +} +func (m *ActualLRPInstanceKey) GetCellId() string { + if m != nil { + return m.CellId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPInstanceKey) SetCellId(value string) { + if m != nil { + m.CellId = value + } +} +func (x *ActualLRPInstanceKey) ToProto() *ProtoActualLRPInstanceKey { + if x == nil { + return nil + } + + proto := &ProtoActualLRPInstanceKey{ + InstanceGuid: x.InstanceGuid, + CellId: x.CellId, + } + return proto +} + +func (x *ProtoActualLRPInstanceKey) FromProto() *ActualLRPInstanceKey { + if x == nil { + return nil + } + + copysafe := &ActualLRPInstanceKey{ + InstanceGuid: x.InstanceGuid, + CellId: x.CellId, + } + return copysafe +} + +func ActualLRPInstanceKeyToProtoSlice(values []*ActualLRPInstanceKey) []*ProtoActualLRPInstanceKey { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPInstanceKey, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPInstanceKeyFromProtoSlice(values []*ProtoActualLRPInstanceKey) []*ActualLRPInstanceKey { + if values == nil { + return nil + } + result := make([]*ActualLRPInstanceKey, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +type ActualLRPNetInfo_PreferredAddress int32 + +const ( + ActualLRPNetInfo_PreferredAddressUnknown ActualLRPNetInfo_PreferredAddress = 0 + ActualLRPNetInfo_PreferredAddressInstance ActualLRPNetInfo_PreferredAddress = 1 + ActualLRPNetInfo_PreferredAddressHost ActualLRPNetInfo_PreferredAddress = 2 +) + +// Enum value maps for ActualLRPNetInfo_PreferredAddress +var ( + ActualLRPNetInfo_PreferredAddress_name = map[int32]string{ + 0: "UNKNOWN", + 1: "INSTANCE", + 2: "HOST", + } + ActualLRPNetInfo_PreferredAddress_value = map[string]int32{ + "UNKNOWN": 0, + "INSTANCE": 1, + "HOST": 2, + } +) + +func (m ActualLRPNetInfo_PreferredAddress) String() string { + s, ok := ActualLRPNetInfo_PreferredAddress_name[int32(m)] + if ok { + return s + } + return strconv.Itoa(int(m)) +} + +// Prevent copylock errors when using ProtoActualLRPNetInfo directly +type ActualLRPNetInfo struct { + Address string `json:"address"` + Ports []*PortMapping `json:"ports"` + InstanceAddress string `json:"instance_address,omitempty"` + PreferredAddress ActualLRPNetInfo_PreferredAddress `json:"preferred_address"` +} + +func (this *ActualLRPNetInfo) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPNetInfo) + if !ok { + that2, ok := that.(ActualLRPNetInfo) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Address != that1.Address { + return false + } + if this.Ports == nil { + if that1.Ports != nil { + return false + } + } else if len(this.Ports) != len(that1.Ports) { + return false + } + for i := range this.Ports { + if !this.Ports[i].Equal(that1.Ports[i]) { + return false + } + } + if this.InstanceAddress != that1.InstanceAddress { + return false + } + if this.PreferredAddress != that1.PreferredAddress { + return false + } + return true +} +func (m *ActualLRPNetInfo) GetAddress() string { + if m != nil { + return m.Address + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPNetInfo) SetAddress(value string) { + if m != nil { + m.Address = value + } +} +func (m *ActualLRPNetInfo) GetPorts() []*PortMapping { + if m != nil { + return m.Ports + } + return nil +} +func (m *ActualLRPNetInfo) SetPorts(value []*PortMapping) { + if m != nil { + m.Ports = value + } +} +func (m *ActualLRPNetInfo) GetInstanceAddress() string { + if m != nil { + return m.InstanceAddress + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPNetInfo) SetInstanceAddress(value string) { + if m != nil { + m.InstanceAddress = value + } +} +func (m *ActualLRPNetInfo) GetPreferredAddress() ActualLRPNetInfo_PreferredAddress { + if m != nil { + return m.PreferredAddress + } + var defaultValue ActualLRPNetInfo_PreferredAddress + defaultValue = 0 + return defaultValue +} +func (m *ActualLRPNetInfo) SetPreferredAddress(value ActualLRPNetInfo_PreferredAddress) { + if m != nil { + m.PreferredAddress = value + } +} +func (x *ActualLRPNetInfo) ToProto() *ProtoActualLRPNetInfo { + if x == nil { + return nil + } + + proto := &ProtoActualLRPNetInfo{ + Address: x.Address, + Ports: PortMappingToProtoSlice(x.Ports), + InstanceAddress: x.InstanceAddress, + PreferredAddress: ProtoActualLRPNetInfo_PreferredAddress(x.PreferredAddress), + } + return proto +} + +func (x *ProtoActualLRPNetInfo) FromProto() *ActualLRPNetInfo { + if x == nil { + return nil + } + + copysafe := &ActualLRPNetInfo{ + Address: x.Address, + Ports: PortMappingFromProtoSlice(x.Ports), + InstanceAddress: x.InstanceAddress, + PreferredAddress: ActualLRPNetInfo_PreferredAddress(x.PreferredAddress), + } + return copysafe +} + +func ActualLRPNetInfoToProtoSlice(values []*ActualLRPNetInfo) []*ProtoActualLRPNetInfo { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPNetInfo, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPNetInfoFromProtoSlice(values []*ProtoActualLRPNetInfo) []*ActualLRPNetInfo { + if values == nil { + return nil + } + result := make([]*ActualLRPNetInfo, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoActualLRPInternalRoute directly +type ActualLRPInternalRoute struct { + Hostname string `json:"hostname"` +} + +func (this *ActualLRPInternalRoute) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPInternalRoute) + if !ok { + that2, ok := that.(ActualLRPInternalRoute) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Hostname != that1.Hostname { + return false + } + return true +} +func (m *ActualLRPInternalRoute) GetHostname() string { + if m != nil { + return m.Hostname + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPInternalRoute) SetHostname(value string) { + if m != nil { + m.Hostname = value + } +} +func (x *ActualLRPInternalRoute) ToProto() *ProtoActualLRPInternalRoute { + if x == nil { + return nil + } + + proto := &ProtoActualLRPInternalRoute{ + Hostname: x.Hostname, + } + return proto +} + +func (x *ProtoActualLRPInternalRoute) FromProto() *ActualLRPInternalRoute { + if x == nil { + return nil + } + + copysafe := &ActualLRPInternalRoute{ + Hostname: x.Hostname, + } + return copysafe +} + +func ActualLRPInternalRouteToProtoSlice(values []*ActualLRPInternalRoute) []*ProtoActualLRPInternalRoute { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPInternalRoute, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPInternalRouteFromProtoSlice(values []*ProtoActualLRPInternalRoute) []*ActualLRPInternalRoute { + if values == nil { + return nil + } + result := make([]*ActualLRPInternalRoute, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +type ActualLRP_Presence int32 + +const ( + ActualLRP_Ordinary ActualLRP_Presence = 0 + ActualLRP_Evacuating ActualLRP_Presence = 1 + ActualLRP_Suspect ActualLRP_Presence = 2 +) + +// Enum value maps for ActualLRP_Presence +var ( + ActualLRP_Presence_name = map[int32]string{ + 0: "ORDINARY", + 1: "EVACUATING", + 2: "SUSPECT", + } + ActualLRP_Presence_value = map[string]int32{ + "ORDINARY": 0, + "EVACUATING": 1, + "SUSPECT": 2, + } +) + +func (m ActualLRP_Presence) String() string { + s, ok := ActualLRP_Presence_name[int32(m)] + if ok { + return s + } + return strconv.Itoa(int(m)) +} + +// Prevent copylock errors when using ProtoActualLRP directly +type ActualLRP struct { + ActualLrpKey ActualLRPKey `json:"actualLrpKey"` + ActualLrpInstanceKey ActualLRPInstanceKey `json:"actualLrpInstanceKey"` + ActualLrpNetInfo ActualLRPNetInfo `json:"actualLrpNetInfo"` + CrashCount int32 `json:"crash_count"` + CrashReason string `json:"crash_reason,omitempty"` + State string `json:"state"` + PlacementError string `json:"placement_error,omitempty"` + Since int64 `json:"since"` + ModificationTag ModificationTag `json:"modification_tag"` + Presence ActualLRP_Presence `json:"presence,omitempty"` + ActualLrpInternalRoutes []*ActualLRPInternalRoute `json:"actualLrpInternalRoutes,omitempty"` + MetricTags map[string]string `json:"metric_tags,omitempty"` + Routable *bool `json:"routable"` + AvailabilityZone string `json:"availability_zone"` +} + +func (this *ActualLRP) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRP) + if !ok { + that2, ok := that.(ActualLRP) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if !this.ActualLrpKey.Equal(that1.ActualLrpKey) { + return false + } + if !this.ActualLrpInstanceKey.Equal(that1.ActualLrpInstanceKey) { + return false + } + if !this.ActualLrpNetInfo.Equal(that1.ActualLrpNetInfo) { + return false + } + if this.CrashCount != that1.CrashCount { + return false + } + if this.CrashReason != that1.CrashReason { + return false + } + if this.State != that1.State { + return false + } + if this.PlacementError != that1.PlacementError { + return false + } + if this.Since != that1.Since { + return false + } + if !this.ModificationTag.Equal(that1.ModificationTag) { + return false + } + if this.Presence != that1.Presence { + return false + } + if this.ActualLrpInternalRoutes == nil { + if that1.ActualLrpInternalRoutes != nil { + return false + } + } else if len(this.ActualLrpInternalRoutes) != len(that1.ActualLrpInternalRoutes) { + return false + } + for i := range this.ActualLrpInternalRoutes { + if !this.ActualLrpInternalRoutes[i].Equal(that1.ActualLrpInternalRoutes[i]) { + return false + } + } + if this.MetricTags == nil { + if that1.MetricTags != nil { + return false + } + } else if len(this.MetricTags) != len(that1.MetricTags) { + return false + } + for i := range this.MetricTags { + if this.MetricTags[i] != that1.MetricTags[i] { + return false + } + } + if this.Routable == nil { + if that1.Routable != nil { + return false + } + } else if *this.Routable != *that1.Routable { + return false + } + if this.AvailabilityZone != that1.AvailabilityZone { + return false + } + return true +} +func (m *ActualLRP) SetActualLrpKey(value ActualLRPKey) { + if m != nil { + m.ActualLrpKey = value + } +} +func (m *ActualLRP) SetActualLrpInstanceKey(value ActualLRPInstanceKey) { + if m != nil { + m.ActualLrpInstanceKey = value + } +} +func (m *ActualLRP) SetActualLrpNetInfo(value ActualLRPNetInfo) { + if m != nil { + m.ActualLrpNetInfo = value + } +} +func (m *ActualLRP) GetCrashCount() int32 { + if m != nil { + return m.CrashCount + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *ActualLRP) SetCrashCount(value int32) { + if m != nil { + m.CrashCount = value + } +} +func (m *ActualLRP) GetCrashReason() string { + if m != nil { + return m.CrashReason + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRP) SetCrashReason(value string) { + if m != nil { + m.CrashReason = value + } +} +func (m *ActualLRP) GetState() string { + if m != nil { + return m.State + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRP) SetState(value string) { + if m != nil { + m.State = value + } +} +func (m *ActualLRP) GetPlacementError() string { + if m != nil { + return m.PlacementError + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRP) SetPlacementError(value string) { + if m != nil { + m.PlacementError = value + } +} +func (m *ActualLRP) GetSince() int64 { + if m != nil { + return m.Since + } + var defaultValue int64 + defaultValue = 0 + return defaultValue +} +func (m *ActualLRP) SetSince(value int64) { + if m != nil { + m.Since = value + } +} +func (m *ActualLRP) SetModificationTag(value ModificationTag) { + if m != nil { + m.ModificationTag = value + } +} +func (m *ActualLRP) GetPresence() ActualLRP_Presence { + if m != nil { + return m.Presence + } + var defaultValue ActualLRP_Presence + defaultValue = 0 + return defaultValue +} +func (m *ActualLRP) SetPresence(value ActualLRP_Presence) { + if m != nil { + m.Presence = value + } +} +func (m *ActualLRP) GetActualLrpInternalRoutes() []*ActualLRPInternalRoute { + if m != nil { + return m.ActualLrpInternalRoutes + } + return nil +} +func (m *ActualLRP) SetActualLrpInternalRoutes(value []*ActualLRPInternalRoute) { + if m != nil { + m.ActualLrpInternalRoutes = value + } +} +func (m *ActualLRP) GetMetricTags() map[string]string { + if m != nil { + return m.MetricTags + } + return nil +} +func (m *ActualLRP) SetMetricTags(value map[string]string) { + if m != nil { + m.MetricTags = value + } +} +func (m *ActualLRP) RoutableExists() bool { + return m != nil && m.Routable != nil +} +func (m *ActualLRP) GetRoutable() *bool { + if m != nil && m.Routable != nil { + return m.Routable + } + var defaultValue bool + defaultValue = false + return &defaultValue +} +func (m *ActualLRP) SetRoutable(value *bool) { + if m != nil { + m.Routable = value + } +} +func (m *ActualLRP) GetAvailabilityZone() string { + if m != nil { + return m.AvailabilityZone + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRP) SetAvailabilityZone(value string) { + if m != nil { + m.AvailabilityZone = value + } +} +func (x *ActualLRP) ToProto() *ProtoActualLRP { + if x == nil { + return nil + } + + proto := &ProtoActualLRP{ + ActualLrpKey: x.ActualLrpKey.ToProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.ToProto(), + ActualLrpNetInfo: x.ActualLrpNetInfo.ToProto(), + CrashCount: x.CrashCount, + CrashReason: x.CrashReason, + State: x.State, + PlacementError: x.PlacementError, + Since: x.Since, + ModificationTag: x.ModificationTag.ToProto(), + Presence: ProtoActualLRP_Presence(x.Presence), + ActualLrpInternalRoutes: ActualLRPInternalRouteToProtoSlice(x.ActualLrpInternalRoutes), + MetricTags: x.MetricTags, + Routable: x.Routable, + AvailabilityZone: x.AvailabilityZone, + } + return proto +} + +func (x *ProtoActualLRP) FromProto() *ActualLRP { + if x == nil { + return nil + } + + copysafe := &ActualLRP{ + ActualLrpKey: *x.ActualLrpKey.FromProto(), + ActualLrpInstanceKey: *x.ActualLrpInstanceKey.FromProto(), + ActualLrpNetInfo: *x.ActualLrpNetInfo.FromProto(), + CrashCount: x.CrashCount, + CrashReason: x.CrashReason, + State: x.State, + PlacementError: x.PlacementError, + Since: x.Since, + ModificationTag: *x.ModificationTag.FromProto(), + Presence: ActualLRP_Presence(x.Presence), + ActualLrpInternalRoutes: ActualLRPInternalRouteFromProtoSlice(x.ActualLrpInternalRoutes), + MetricTags: x.MetricTags, + Routable: x.Routable, + AvailabilityZone: x.AvailabilityZone, + } + return copysafe +} + +func ActualLRPToProtoSlice(values []*ActualLRP) []*ProtoActualLRP { + if values == nil { + return nil + } + result := make([]*ProtoActualLRP, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPFromProtoSlice(values []*ProtoActualLRP) []*ActualLRP { + if values == nil { + return nil + } + result := make([]*ActualLRP, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/actual_lrp_requests.go b/models/actual_lrp_requests.go index 96268193..aabd6403 100644 --- a/models/actual_lrp_requests.go +++ b/models/actual_lrp_requests.go @@ -2,17 +2,12 @@ package models import "encoding/json" -func (request *ActualLRPsRequest) Validate() error { - return nil +func (request *ProtoActualLRPsRequest) Validate() error { + return request.FromProto().Validate() } -func (request *ActualLRPsRequest) SetIndex(index int32) { - request.OptionalIndex = &ActualLRPsRequest_Index{Index: index} -} - -func (request ActualLRPsRequest) IndexExists() bool { - _, ok := request.GetOptionalIndex().(*ActualLRPsRequest_Index) - return ok +func (request *ActualLRPsRequest) Validate() error { + return nil } type internalActualLRPsRequest struct { @@ -32,7 +27,7 @@ func (request *ActualLRPsRequest) UnmarshalJSON(data []byte) error { request.CellId = internalRequest.CellId request.ProcessGuid = internalRequest.ProcessGuid if internalRequest.Index != nil { - request.SetIndex(*internalRequest.Index) + request.SetIndex(internalRequest.Index) } return nil @@ -45,18 +40,24 @@ func (request ActualLRPsRequest) MarshalJSON() ([]byte, error) { ProcessGuid: request.ProcessGuid, } - if request.IndexExists() { - i := request.GetIndex() - internalRequest.Index = &i - } + i := request.GetIndex() + internalRequest.Index = i return json.Marshal(internalRequest) } +func (request *ProtoActualLRPGroupsRequest) Validate() error { + return request.FromProto().Validate() +} + // Deprecated: use the ActualLRPInstances API instead func (request *ActualLRPGroupsRequest) Validate() error { return nil } +func (request *ProtoActualLRPGroupsByProcessGuidRequest) Validate() error { + return request.FromProto().Validate() +} + // Deprecated: use the ActualLRPInstances API instead func (request *ActualLRPGroupsByProcessGuidRequest) Validate() error { var validationError ValidationError @@ -72,6 +73,10 @@ func (request *ActualLRPGroupsByProcessGuidRequest) Validate() error { return nil } +func (request *ProtoActualLRPGroupByProcessGuidAndIndexRequest) Validate() error { + return request.FromProto().Validate() +} + // Deprecated: use the ActualLRPInstances API instead func (request *ActualLRPGroupByProcessGuidAndIndexRequest) Validate() error { var validationError ValidationError @@ -91,6 +96,10 @@ func (request *ActualLRPGroupByProcessGuidAndIndexRequest) Validate() error { return nil } +func (request *ProtoRemoveActualLRPRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *RemoveActualLRPRequest) Validate() error { var validationError ValidationError @@ -109,6 +118,10 @@ func (request *RemoveActualLRPRequest) Validate() error { return nil } +func (request *ProtoClaimActualLRPRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *ClaimActualLRPRequest) Validate() error { var validationError ValidationError @@ -129,6 +142,10 @@ func (request *ClaimActualLRPRequest) Validate() error { return nil } +func (request *ProtoStartActualLRPRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *StartActualLRPRequest) Validate() error { var validationError ValidationError @@ -157,15 +174,8 @@ func (request *StartActualLRPRequest) Validate() error { return nil } -func (request *StartActualLRPRequest) SetRoutable(routable bool) { - request.OptionalRoutable = &StartActualLRPRequest_Routable{ - Routable: routable, - } -} - -func (request *StartActualLRPRequest) RoutableExists() bool { - _, ok := request.GetOptionalRoutable().(*StartActualLRPRequest_Routable) - return ok +func (request *ProtoCrashActualLRPRequest) Validate() error { + return request.FromProto().Validate() } func (request *CrashActualLRPRequest) Validate() error { @@ -190,6 +200,10 @@ func (request *CrashActualLRPRequest) Validate() error { return nil } +func (request *ProtoFailActualLRPRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *FailActualLRPRequest) Validate() error { var validationError ValidationError @@ -210,6 +224,10 @@ func (request *FailActualLRPRequest) Validate() error { return nil } +func (request *ProtoRetireActualLRPRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *RetireActualLRPRequest) Validate() error { var validationError ValidationError @@ -226,6 +244,10 @@ func (request *RetireActualLRPRequest) Validate() error { return nil } +func (request *ProtoRemoveEvacuatingActualLRPRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *RemoveEvacuatingActualLRPRequest) Validate() error { var validationError ValidationError @@ -248,6 +270,10 @@ func (request *RemoveEvacuatingActualLRPRequest) Validate() error { return nil } +func (request *ProtoEvacuateClaimedActualLRPRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *EvacuateClaimedActualLRPRequest) Validate() error { var validationError ValidationError @@ -270,6 +296,10 @@ func (request *EvacuateClaimedActualLRPRequest) Validate() error { return nil } +func (request *ProtoEvacuateCrashedActualLRPRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *EvacuateCrashedActualLRPRequest) Validate() error { var validationError ValidationError @@ -296,6 +326,10 @@ func (request *EvacuateCrashedActualLRPRequest) Validate() error { return nil } +func (request *ProtoEvacuateStoppedActualLRPRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *EvacuateStoppedActualLRPRequest) Validate() error { var validationError ValidationError @@ -318,6 +352,10 @@ func (request *EvacuateStoppedActualLRPRequest) Validate() error { return nil } +func (request *ProtoEvacuateRunningActualLRPRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *EvacuateRunningActualLRPRequest) Validate() error { var validationError ValidationError diff --git a/models/actual_lrp_requests.pb.go b/models/actual_lrp_requests.pb.go index f34f6715..9c2135e6 100644 --- a/models/actual_lrp_requests.pb.go +++ b/models/actual_lrp_requests.pb.go @@ -1,4872 +1,963 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: actual_lrp_requests.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -type ActualLRPLifecycleResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` +type ProtoActualLRPLifecycleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPLifecycleResponse) Reset() { *m = ActualLRPLifecycleResponse{} } -func (*ActualLRPLifecycleResponse) ProtoMessage() {} -func (*ActualLRPLifecycleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{0} +func (x *ProtoActualLRPLifecycleResponse) Reset() { + *x = ProtoActualLRPLifecycleResponse{} + mi := &file_actual_lrp_requests_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPLifecycleResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoActualLRPLifecycleResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPLifecycleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPLifecycleResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoActualLRPLifecycleResponse) ProtoMessage() {} + +func (x *ProtoActualLRPLifecycleResponse) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ActualLRPLifecycleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPLifecycleResponse.Merge(m, src) -} -func (m *ActualLRPLifecycleResponse) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPLifecycleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPLifecycleResponse.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ActualLRPLifecycleResponse proto.InternalMessageInfo +// Deprecated: Use ProtoActualLRPLifecycleResponse.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPLifecycleResponse) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{0} +} -func (m *ActualLRPLifecycleResponse) GetError() *Error { - if m != nil { - return m.Error +func (x *ProtoActualLRPLifecycleResponse) GetError() *ProtoError { + if x != nil { + return x.Error } return nil } -// Deprecated: Do not use. -type ActualLRPGroupsResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - ActualLrpGroups []*ActualLRPGroup `protobuf:"bytes,2,rep,name=actual_lrp_groups,json=actualLrpGroups,proto3" json:"actual_lrp_groups,omitempty"` +// Deprecated: Marked as deprecated in actual_lrp_requests.proto. +type ProtoActualLRPGroupsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + ActualLrpGroups []*ProtoActualLRPGroup `protobuf:"bytes,2,rep,name=actual_lrp_groups,proto3" json:"actual_lrp_groups,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPGroupsResponse) Reset() { *m = ActualLRPGroupsResponse{} } -func (*ActualLRPGroupsResponse) ProtoMessage() {} -func (*ActualLRPGroupsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{1} +func (x *ProtoActualLRPGroupsResponse) Reset() { + *x = ProtoActualLRPGroupsResponse{} + mi := &file_actual_lrp_requests_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPGroupsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoActualLRPGroupsResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPGroupsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPGroupsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoActualLRPGroupsResponse) ProtoMessage() {} + +func (x *ProtoActualLRPGroupsResponse) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ActualLRPGroupsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPGroupsResponse.Merge(m, src) -} -func (m *ActualLRPGroupsResponse) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPGroupsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPGroupsResponse.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ActualLRPGroupsResponse proto.InternalMessageInfo +// Deprecated: Use ProtoActualLRPGroupsResponse.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPGroupsResponse) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{1} +} -func (m *ActualLRPGroupsResponse) GetError() *Error { - if m != nil { - return m.Error +func (x *ProtoActualLRPGroupsResponse) GetError() *ProtoError { + if x != nil { + return x.Error } return nil } -func (m *ActualLRPGroupsResponse) GetActualLrpGroups() []*ActualLRPGroup { - if m != nil { - return m.ActualLrpGroups +func (x *ProtoActualLRPGroupsResponse) GetActualLrpGroups() []*ProtoActualLRPGroup { + if x != nil { + return x.ActualLrpGroups } return nil } -// Deprecated: Do not use. -type ActualLRPGroupResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - ActualLrpGroup *ActualLRPGroup `protobuf:"bytes,2,opt,name=actual_lrp_group,json=actualLrpGroup,proto3" json:"actual_lrp_group,omitempty"` +// Deprecated: Marked as deprecated in actual_lrp_requests.proto. +type ProtoActualLRPGroupResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + ActualLrpGroup *ProtoActualLRPGroup `protobuf:"bytes,2,opt,name=actual_lrp_group,proto3" json:"actual_lrp_group,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPGroupResponse) Reset() { *m = ActualLRPGroupResponse{} } -func (*ActualLRPGroupResponse) ProtoMessage() {} -func (*ActualLRPGroupResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{2} +func (x *ProtoActualLRPGroupResponse) Reset() { + *x = ProtoActualLRPGroupResponse{} + mi := &file_actual_lrp_requests_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPGroupResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoActualLRPGroupResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPGroupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPGroupResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoActualLRPGroupResponse) ProtoMessage() {} + +func (x *ProtoActualLRPGroupResponse) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ActualLRPGroupResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPGroupResponse.Merge(m, src) -} -func (m *ActualLRPGroupResponse) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPGroupResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPGroupResponse.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ActualLRPGroupResponse proto.InternalMessageInfo +// Deprecated: Use ProtoActualLRPGroupResponse.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPGroupResponse) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{2} +} -func (m *ActualLRPGroupResponse) GetError() *Error { - if m != nil { - return m.Error +func (x *ProtoActualLRPGroupResponse) GetError() *ProtoError { + if x != nil { + return x.Error } return nil } -func (m *ActualLRPGroupResponse) GetActualLrpGroup() *ActualLRPGroup { - if m != nil { - return m.ActualLrpGroup +func (x *ProtoActualLRPGroupResponse) GetActualLrpGroup() *ProtoActualLRPGroup { + if x != nil { + return x.ActualLrpGroup } return nil } -// Deprecated: Do not use. -type ActualLRPGroupsRequest struct { - Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain"` - CellId string `protobuf:"bytes,2,opt,name=cell_id,json=cellId,proto3" json:"cell_id"` +// Deprecated: Marked as deprecated in actual_lrp_requests.proto. +type ProtoActualLRPGroupsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` + CellId string `protobuf:"bytes,2,opt,name=cell_id,proto3" json:"cell_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPGroupsRequest) Reset() { *m = ActualLRPGroupsRequest{} } -func (*ActualLRPGroupsRequest) ProtoMessage() {} -func (*ActualLRPGroupsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{3} +func (x *ProtoActualLRPGroupsRequest) Reset() { + *x = ProtoActualLRPGroupsRequest{} + mi := &file_actual_lrp_requests_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPGroupsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoActualLRPGroupsRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPGroupsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPGroupsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoActualLRPGroupsRequest) ProtoMessage() {} + +func (x *ProtoActualLRPGroupsRequest) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ActualLRPGroupsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPGroupsRequest.Merge(m, src) -} -func (m *ActualLRPGroupsRequest) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPGroupsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPGroupsRequest.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ActualLRPGroupsRequest proto.InternalMessageInfo +// Deprecated: Use ProtoActualLRPGroupsRequest.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPGroupsRequest) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{3} +} -func (m *ActualLRPGroupsRequest) GetDomain() string { - if m != nil { - return m.Domain +func (x *ProtoActualLRPGroupsRequest) GetDomain() string { + if x != nil { + return x.Domain } return "" } -func (m *ActualLRPGroupsRequest) GetCellId() string { - if m != nil { - return m.CellId +func (x *ProtoActualLRPGroupsRequest) GetCellId() string { + if x != nil { + return x.CellId } return "" } -// Deprecated: Do not use. -type ActualLRPGroupsByProcessGuidRequest struct { - ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,json=processGuid,proto3" json:"process_guid"` +// Deprecated: Marked as deprecated in actual_lrp_requests.proto. +type ProtoActualLRPGroupsByProcessGuidRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,proto3" json:"process_guid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPGroupsByProcessGuidRequest) Reset() { *m = ActualLRPGroupsByProcessGuidRequest{} } -func (*ActualLRPGroupsByProcessGuidRequest) ProtoMessage() {} -func (*ActualLRPGroupsByProcessGuidRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{4} +func (x *ProtoActualLRPGroupsByProcessGuidRequest) Reset() { + *x = ProtoActualLRPGroupsByProcessGuidRequest{} + mi := &file_actual_lrp_requests_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPGroupsByProcessGuidRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoActualLRPGroupsByProcessGuidRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPGroupsByProcessGuidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPGroupsByProcessGuidRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoActualLRPGroupsByProcessGuidRequest) ProtoMessage() {} + +func (x *ProtoActualLRPGroupsByProcessGuidRequest) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ActualLRPGroupsByProcessGuidRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPGroupsByProcessGuidRequest.Merge(m, src) -} -func (m *ActualLRPGroupsByProcessGuidRequest) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPGroupsByProcessGuidRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPGroupsByProcessGuidRequest.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ActualLRPGroupsByProcessGuidRequest proto.InternalMessageInfo +// Deprecated: Use ProtoActualLRPGroupsByProcessGuidRequest.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPGroupsByProcessGuidRequest) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{4} +} -func (m *ActualLRPGroupsByProcessGuidRequest) GetProcessGuid() string { - if m != nil { - return m.ProcessGuid +func (x *ProtoActualLRPGroupsByProcessGuidRequest) GetProcessGuid() string { + if x != nil { + return x.ProcessGuid } return "" } -// Deprecated: Do not use. -type ActualLRPGroupByProcessGuidAndIndexRequest struct { - ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,json=processGuid,proto3" json:"process_guid"` - Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index"` +// Deprecated: Marked as deprecated in actual_lrp_requests.proto. +type ProtoActualLRPGroupByProcessGuidAndIndexRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,proto3" json:"process_guid,omitempty"` + Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPGroupByProcessGuidAndIndexRequest) Reset() { - *m = ActualLRPGroupByProcessGuidAndIndexRequest{} -} -func (*ActualLRPGroupByProcessGuidAndIndexRequest) ProtoMessage() {} -func (*ActualLRPGroupByProcessGuidAndIndexRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{5} +func (x *ProtoActualLRPGroupByProcessGuidAndIndexRequest) Reset() { + *x = ProtoActualLRPGroupByProcessGuidAndIndexRequest{} + mi := &file_actual_lrp_requests_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPGroupByProcessGuidAndIndexRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoActualLRPGroupByProcessGuidAndIndexRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPGroupByProcessGuidAndIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPGroupByProcessGuidAndIndexRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoActualLRPGroupByProcessGuidAndIndexRequest) ProtoMessage() {} + +func (x *ProtoActualLRPGroupByProcessGuidAndIndexRequest) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ActualLRPGroupByProcessGuidAndIndexRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPGroupByProcessGuidAndIndexRequest.Merge(m, src) -} -func (m *ActualLRPGroupByProcessGuidAndIndexRequest) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPGroupByProcessGuidAndIndexRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPGroupByProcessGuidAndIndexRequest.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ActualLRPGroupByProcessGuidAndIndexRequest proto.InternalMessageInfo +// Deprecated: Use ProtoActualLRPGroupByProcessGuidAndIndexRequest.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPGroupByProcessGuidAndIndexRequest) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{5} +} -func (m *ActualLRPGroupByProcessGuidAndIndexRequest) GetProcessGuid() string { - if m != nil { - return m.ProcessGuid +func (x *ProtoActualLRPGroupByProcessGuidAndIndexRequest) GetProcessGuid() string { + if x != nil { + return x.ProcessGuid } return "" } -func (m *ActualLRPGroupByProcessGuidAndIndexRequest) GetIndex() int32 { - if m != nil { - return m.Index +func (x *ProtoActualLRPGroupByProcessGuidAndIndexRequest) GetIndex() int32 { + if x != nil { + return x.Index } return 0 } -type ClaimActualLRPRequest struct { - ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,json=processGuid,proto3" json:"process_guid"` - Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index"` - ActualLrpInstanceKey *ActualLRPInstanceKey `protobuf:"bytes,3,opt,name=actual_lrp_instance_key,json=actualLrpInstanceKey,proto3" json:"actual_lrp_instance_key,omitempty"` +type ProtoClaimActualLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,proto3" json:"process_guid,omitempty"` + Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + ActualLrpInstanceKey *ProtoActualLRPInstanceKey `protobuf:"bytes,3,opt,name=actual_lrp_instance_key,proto3" json:"actual_lrp_instance_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ClaimActualLRPRequest) Reset() { *m = ClaimActualLRPRequest{} } -func (*ClaimActualLRPRequest) ProtoMessage() {} -func (*ClaimActualLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{6} +func (x *ProtoClaimActualLRPRequest) Reset() { + *x = ProtoClaimActualLRPRequest{} + mi := &file_actual_lrp_requests_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ClaimActualLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoClaimActualLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ClaimActualLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ClaimActualLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoClaimActualLRPRequest) ProtoMessage() {} + +func (x *ProtoClaimActualLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ClaimActualLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClaimActualLRPRequest.Merge(m, src) -} -func (m *ClaimActualLRPRequest) XXX_Size() int { - return m.Size() -} -func (m *ClaimActualLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ClaimActualLRPRequest.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ClaimActualLRPRequest proto.InternalMessageInfo +// Deprecated: Use ProtoClaimActualLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoClaimActualLRPRequest) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{6} +} -func (m *ClaimActualLRPRequest) GetProcessGuid() string { - if m != nil { - return m.ProcessGuid +func (x *ProtoClaimActualLRPRequest) GetProcessGuid() string { + if x != nil { + return x.ProcessGuid } return "" } -func (m *ClaimActualLRPRequest) GetIndex() int32 { - if m != nil { - return m.Index +func (x *ProtoClaimActualLRPRequest) GetIndex() int32 { + if x != nil { + return x.Index } return 0 } -func (m *ClaimActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { - if m != nil { - return m.ActualLrpInstanceKey +func (x *ProtoClaimActualLRPRequest) GetActualLrpInstanceKey() *ProtoActualLRPInstanceKey { + if x != nil { + return x.ActualLrpInstanceKey } return nil } -type StartActualLRPRequest struct { - ActualLrpKey *ActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,json=actualLrpKey,proto3" json:"actual_lrp_key,omitempty"` - ActualLrpInstanceKey *ActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,json=actualLrpInstanceKey,proto3" json:"actual_lrp_instance_key,omitempty"` - ActualLrpNetInfo *ActualLRPNetInfo `protobuf:"bytes,3,opt,name=actual_lrp_net_info,json=actualLrpNetInfo,proto3" json:"actual_lrp_net_info,omitempty"` - ActualLrpInternalRoutes []*ActualLRPInternalRoute `protobuf:"bytes,4,rep,name=actual_lrp_internal_routes,json=actualLrpInternalRoutes,proto3" json:"actual_lrp_internal_routes,omitempty"` - MetricTags map[string]string `protobuf:"bytes,5,rep,name=metric_tags,json=metricTags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Types that are valid to be assigned to OptionalRoutable: - // *StartActualLRPRequest_Routable - OptionalRoutable isStartActualLRPRequest_OptionalRoutable `protobuf_oneof:"optional_routable"` - AvailabilityZone string `protobuf:"bytes,7,opt,name=availability_zone,json=availabilityZone,proto3" json:"availability_zone"` -} - -func (m *StartActualLRPRequest) Reset() { *m = StartActualLRPRequest{} } -func (*StartActualLRPRequest) ProtoMessage() {} -func (*StartActualLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{7} +type ProtoStartActualLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpKey *ProtoActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,proto3" json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ProtoActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,proto3" json:"actual_lrp_instance_key,omitempty"` + ActualLrpNetInfo *ProtoActualLRPNetInfo `protobuf:"bytes,3,opt,name=actual_lrp_net_info,proto3" json:"actual_lrp_net_info,omitempty"` + ActualLrpInternalRoutes []*ProtoActualLRPInternalRoute `protobuf:"bytes,4,rep,name=actual_lrp_internal_routes,proto3" json:"actual_lrp_internal_routes,omitempty"` + MetricTags map[string]string `protobuf:"bytes,5,rep,name=metric_tags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Routable *bool `protobuf:"varint,6,opt,name=Routable,proto3,oneof" json:"Routable,omitempty"` + AvailabilityZone string `protobuf:"bytes,7,opt,name=availability_zone,proto3" json:"availability_zone,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *StartActualLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StartActualLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StartActualLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StartActualLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StartActualLRPRequest.Merge(m, src) -} -func (m *StartActualLRPRequest) XXX_Size() int { - return m.Size() -} -func (m *StartActualLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StartActualLRPRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StartActualLRPRequest proto.InternalMessageInfo -type isStartActualLRPRequest_OptionalRoutable interface { - isStartActualLRPRequest_OptionalRoutable() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int +func (x *ProtoStartActualLRPRequest) Reset() { + *x = ProtoStartActualLRPRequest{} + mi := &file_actual_lrp_requests_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -type StartActualLRPRequest_Routable struct { - Routable bool `protobuf:"varint,6,opt,name=Routable,proto3,oneof" json:"Routable,omitempty"` +func (x *ProtoStartActualLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (*StartActualLRPRequest_Routable) isStartActualLRPRequest_OptionalRoutable() {} +func (*ProtoStartActualLRPRequest) ProtoMessage() {} -func (m *StartActualLRPRequest) GetOptionalRoutable() isStartActualLRPRequest_OptionalRoutable { - if m != nil { - return m.OptionalRoutable +func (x *ProtoStartActualLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) +} + +// Deprecated: Use ProtoStartActualLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoStartActualLRPRequest) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{7} } -func (m *StartActualLRPRequest) GetActualLrpKey() *ActualLRPKey { - if m != nil { - return m.ActualLrpKey +func (x *ProtoStartActualLRPRequest) GetActualLrpKey() *ProtoActualLRPKey { + if x != nil { + return x.ActualLrpKey } return nil } -func (m *StartActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { - if m != nil { - return m.ActualLrpInstanceKey +func (x *ProtoStartActualLRPRequest) GetActualLrpInstanceKey() *ProtoActualLRPInstanceKey { + if x != nil { + return x.ActualLrpInstanceKey } return nil } -func (m *StartActualLRPRequest) GetActualLrpNetInfo() *ActualLRPNetInfo { - if m != nil { - return m.ActualLrpNetInfo +func (x *ProtoStartActualLRPRequest) GetActualLrpNetInfo() *ProtoActualLRPNetInfo { + if x != nil { + return x.ActualLrpNetInfo } return nil } -func (m *StartActualLRPRequest) GetActualLrpInternalRoutes() []*ActualLRPInternalRoute { - if m != nil { - return m.ActualLrpInternalRoutes +func (x *ProtoStartActualLRPRequest) GetActualLrpInternalRoutes() []*ProtoActualLRPInternalRoute { + if x != nil { + return x.ActualLrpInternalRoutes } return nil } -func (m *StartActualLRPRequest) GetMetricTags() map[string]string { - if m != nil { - return m.MetricTags +func (x *ProtoStartActualLRPRequest) GetMetricTags() map[string]string { + if x != nil { + return x.MetricTags } return nil } -func (m *StartActualLRPRequest) GetRoutable() bool { - if x, ok := m.GetOptionalRoutable().(*StartActualLRPRequest_Routable); ok { - return x.Routable +func (x *ProtoStartActualLRPRequest) GetRoutable() bool { + if x != nil && x.Routable != nil { + return *x.Routable } return false } -func (m *StartActualLRPRequest) GetAvailabilityZone() string { - if m != nil { - return m.AvailabilityZone +func (x *ProtoStartActualLRPRequest) GetAvailabilityZone() string { + if x != nil { + return x.AvailabilityZone } return "" } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*StartActualLRPRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*StartActualLRPRequest_Routable)(nil), - } +type ProtoCrashActualLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpKey *ProtoActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,proto3" json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ProtoActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,proto3" json:"actual_lrp_instance_key,omitempty"` + ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,proto3" json:"error_message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -type CrashActualLRPRequest struct { - ActualLrpKey *ActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,json=actualLrpKey,proto3" json:"actual_lrp_key,omitempty"` - ActualLrpInstanceKey *ActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,json=actualLrpInstanceKey,proto3" json:"actual_lrp_instance_key,omitempty"` - ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,json=errorMessage,proto3" json:"error_message"` +func (x *ProtoCrashActualLRPRequest) Reset() { + *x = ProtoCrashActualLRPRequest{} + mi := &file_actual_lrp_requests_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CrashActualLRPRequest) Reset() { *m = CrashActualLRPRequest{} } -func (*CrashActualLRPRequest) ProtoMessage() {} -func (*CrashActualLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{8} -} -func (m *CrashActualLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (x *ProtoCrashActualLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CrashActualLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CrashActualLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoCrashActualLRPRequest) ProtoMessage() {} + +func (x *ProtoCrashActualLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *CrashActualLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CrashActualLRPRequest.Merge(m, src) -} -func (m *CrashActualLRPRequest) XXX_Size() int { - return m.Size() -} -func (m *CrashActualLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CrashActualLRPRequest.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_CrashActualLRPRequest proto.InternalMessageInfo +// Deprecated: Use ProtoCrashActualLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoCrashActualLRPRequest) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{8} +} -func (m *CrashActualLRPRequest) GetActualLrpKey() *ActualLRPKey { - if m != nil { - return m.ActualLrpKey +func (x *ProtoCrashActualLRPRequest) GetActualLrpKey() *ProtoActualLRPKey { + if x != nil { + return x.ActualLrpKey } return nil } -func (m *CrashActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { - if m != nil { - return m.ActualLrpInstanceKey +func (x *ProtoCrashActualLRPRequest) GetActualLrpInstanceKey() *ProtoActualLRPInstanceKey { + if x != nil { + return x.ActualLrpInstanceKey } return nil } -func (m *CrashActualLRPRequest) GetErrorMessage() string { - if m != nil { - return m.ErrorMessage +func (x *ProtoCrashActualLRPRequest) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage } return "" } -type FailActualLRPRequest struct { - ActualLrpKey *ActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,json=actualLrpKey,proto3" json:"actual_lrp_key,omitempty"` - ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message"` -} - -func (m *FailActualLRPRequest) Reset() { *m = FailActualLRPRequest{} } -func (*FailActualLRPRequest) ProtoMessage() {} -func (*FailActualLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{9} -} -func (m *FailActualLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FailActualLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FailActualLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *FailActualLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FailActualLRPRequest.Merge(m, src) -} -func (m *FailActualLRPRequest) XXX_Size() int { - return m.Size() +type ProtoFailActualLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpKey *ProtoActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,proto3" json:"actual_lrp_key,omitempty"` + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,proto3" json:"error_message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *FailActualLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_FailActualLRPRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_FailActualLRPRequest proto.InternalMessageInfo -func (m *FailActualLRPRequest) GetActualLrpKey() *ActualLRPKey { - if m != nil { - return m.ActualLrpKey - } - return nil +func (x *ProtoFailActualLRPRequest) Reset() { + *x = ProtoFailActualLRPRequest{} + mi := &file_actual_lrp_requests_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *FailActualLRPRequest) GetErrorMessage() string { - if m != nil { - return m.ErrorMessage - } - return "" +func (x *ProtoFailActualLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -type RetireActualLRPRequest struct { - ActualLrpKey *ActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,json=actualLrpKey,proto3" json:"actual_lrp_key,omitempty"` -} +func (*ProtoFailActualLRPRequest) ProtoMessage() {} -func (m *RetireActualLRPRequest) Reset() { *m = RetireActualLRPRequest{} } -func (*RetireActualLRPRequest) ProtoMessage() {} -func (*RetireActualLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{10} -} -func (m *RetireActualLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RetireActualLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RetireActualLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoFailActualLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil - } -} -func (m *RetireActualLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RetireActualLRPRequest.Merge(m, src) -} -func (m *RetireActualLRPRequest) XXX_Size() int { - return m.Size() -} -func (m *RetireActualLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RetireActualLRPRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RetireActualLRPRequest proto.InternalMessageInfo - -func (m *RetireActualLRPRequest) GetActualLrpKey() *ActualLRPKey { - if m != nil { - return m.ActualLrpKey + return ms } - return nil + return mi.MessageOf(x) } -type RemoveActualLRPRequest struct { - ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,json=processGuid,proto3" json:"process_guid"` - Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index"` - ActualLrpInstanceKey *ActualLRPInstanceKey `protobuf:"bytes,3,opt,name=actual_lrp_instance_key,json=actualLrpInstanceKey,proto3" json:"actual_lrp_instance_key,omitempty"` +// Deprecated: Use ProtoFailActualLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoFailActualLRPRequest) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{9} } -func (m *RemoveActualLRPRequest) Reset() { *m = RemoveActualLRPRequest{} } -func (*RemoveActualLRPRequest) ProtoMessage() {} -func (*RemoveActualLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{11} -} -func (m *RemoveActualLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveActualLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveActualLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ProtoFailActualLRPRequest) GetActualLrpKey() *ProtoActualLRPKey { + if x != nil { + return x.ActualLrpKey } -} -func (m *RemoveActualLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveActualLRPRequest.Merge(m, src) -} -func (m *RemoveActualLRPRequest) XXX_Size() int { - return m.Size() -} -func (m *RemoveActualLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveActualLRPRequest.DiscardUnknown(m) + return nil } -var xxx_messageInfo_RemoveActualLRPRequest proto.InternalMessageInfo - -func (m *RemoveActualLRPRequest) GetProcessGuid() string { - if m != nil { - return m.ProcessGuid +func (x *ProtoFailActualLRPRequest) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage } return "" } -func (m *RemoveActualLRPRequest) GetIndex() int32 { - if m != nil { - return m.Index - } - return 0 +type ProtoRetireActualLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpKey *ProtoActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,proto3" json:"actual_lrp_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *RemoveActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { - if m != nil { - return m.ActualLrpInstanceKey - } - return nil +func (x *ProtoRetireActualLRPRequest) Reset() { + *x = ProtoRetireActualLRPRequest{} + mi := &file_actual_lrp_requests_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -type ActualLRPsResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - ActualLrps []*ActualLRP `protobuf:"bytes,2,rep,name=actual_lrps,json=actualLrps,proto3" json:"actual_lrps,omitempty"` +func (x *ProtoRetireActualLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPsResponse) Reset() { *m = ActualLRPsResponse{} } -func (*ActualLRPsResponse) ProtoMessage() {} -func (*ActualLRPsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{12} -} -func (m *ActualLRPsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActualLRPsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (*ProtoRetireActualLRPRequest) ProtoMessage() {} + +func (x *ProtoRetireActualLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *ActualLRPsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPsResponse.Merge(m, src) -} -func (m *ActualLRPsResponse) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ActualLRPsResponse proto.InternalMessageInfo -func (m *ActualLRPsResponse) GetError() *Error { - if m != nil { - return m.Error - } - return nil +// Deprecated: Use ProtoRetireActualLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoRetireActualLRPRequest) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{10} } -func (m *ActualLRPsResponse) GetActualLrps() []*ActualLRP { - if m != nil { - return m.ActualLrps +func (x *ProtoRetireActualLRPRequest) GetActualLrpKey() *ProtoActualLRPKey { + if x != nil { + return x.ActualLrpKey } return nil } -type ActualLRPsRequest struct { - Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain"` - CellId string `protobuf:"bytes,2,opt,name=cell_id,json=cellId,proto3" json:"cell_id"` - ProcessGuid string `protobuf:"bytes,3,opt,name=process_guid,json=processGuid,proto3" json:"process_guid"` - // Types that are valid to be assigned to OptionalIndex: - // *ActualLRPsRequest_Index - OptionalIndex isActualLRPsRequest_OptionalIndex `protobuf_oneof:"optional_index"` -} - -func (m *ActualLRPsRequest) Reset() { *m = ActualLRPsRequest{} } -func (*ActualLRPsRequest) ProtoMessage() {} -func (*ActualLRPsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a7753fd8557db809, []int{13} -} -func (m *ActualLRPsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActualLRPsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +type ProtoRemoveActualLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,proto3" json:"process_guid,omitempty"` + Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + ActualLrpInstanceKey *ProtoActualLRPInstanceKey `protobuf:"bytes,3,opt,name=actual_lrp_instance_key,proto3" json:"actual_lrp_instance_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPsRequest.Merge(m, src) -} -func (m *ActualLRPsRequest) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ActualLRPsRequest proto.InternalMessageInfo -type isActualLRPsRequest_OptionalIndex interface { - isActualLRPsRequest_OptionalIndex() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int +func (x *ProtoRemoveActualLRPRequest) Reset() { + *x = ProtoRemoveActualLRPRequest{} + mi := &file_actual_lrp_requests_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -type ActualLRPsRequest_Index struct { - Index int32 `protobuf:"varint,4,opt,name=index,proto3,oneof" json:"index"` +func (x *ProtoRemoveActualLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (*ActualLRPsRequest_Index) isActualLRPsRequest_OptionalIndex() {} - -func (m *ActualLRPsRequest) GetOptionalIndex() isActualLRPsRequest_OptionalIndex { - if m != nil { - return m.OptionalIndex - } - return nil -} +func (*ProtoRemoveActualLRPRequest) ProtoMessage() {} -func (m *ActualLRPsRequest) GetDomain() string { - if m != nil { - return m.Domain +func (x *ProtoRemoveActualLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -func (m *ActualLRPsRequest) GetCellId() string { - if m != nil { - return m.CellId - } - return "" +// Deprecated: Use ProtoRemoveActualLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoRemoveActualLRPRequest) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{11} } -func (m *ActualLRPsRequest) GetProcessGuid() string { - if m != nil { - return m.ProcessGuid +func (x *ProtoRemoveActualLRPRequest) GetProcessGuid() string { + if x != nil { + return x.ProcessGuid } return "" } -func (m *ActualLRPsRequest) GetIndex() int32 { - if x, ok := m.GetOptionalIndex().(*ActualLRPsRequest_Index); ok { +func (x *ProtoRemoveActualLRPRequest) GetIndex() int32 { + if x != nil { return x.Index } return 0 } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ActualLRPsRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ActualLRPsRequest_Index)(nil), +func (x *ProtoRemoveActualLRPRequest) GetActualLrpInstanceKey() *ProtoActualLRPInstanceKey { + if x != nil { + return x.ActualLrpInstanceKey } + return nil } -func init() { - proto.RegisterType((*ActualLRPLifecycleResponse)(nil), "models.ActualLRPLifecycleResponse") - proto.RegisterType((*ActualLRPGroupsResponse)(nil), "models.ActualLRPGroupsResponse") - proto.RegisterType((*ActualLRPGroupResponse)(nil), "models.ActualLRPGroupResponse") - proto.RegisterType((*ActualLRPGroupsRequest)(nil), "models.ActualLRPGroupsRequest") - proto.RegisterType((*ActualLRPGroupsByProcessGuidRequest)(nil), "models.ActualLRPGroupsByProcessGuidRequest") - proto.RegisterType((*ActualLRPGroupByProcessGuidAndIndexRequest)(nil), "models.ActualLRPGroupByProcessGuidAndIndexRequest") - proto.RegisterType((*ClaimActualLRPRequest)(nil), "models.ClaimActualLRPRequest") - proto.RegisterType((*StartActualLRPRequest)(nil), "models.StartActualLRPRequest") - proto.RegisterMapType((map[string]string)(nil), "models.StartActualLRPRequest.MetricTagsEntry") - proto.RegisterType((*CrashActualLRPRequest)(nil), "models.CrashActualLRPRequest") - proto.RegisterType((*FailActualLRPRequest)(nil), "models.FailActualLRPRequest") - proto.RegisterType((*RetireActualLRPRequest)(nil), "models.RetireActualLRPRequest") - proto.RegisterType((*RemoveActualLRPRequest)(nil), "models.RemoveActualLRPRequest") - proto.RegisterType((*ActualLRPsResponse)(nil), "models.ActualLRPsResponse") - proto.RegisterType((*ActualLRPsRequest)(nil), "models.ActualLRPsRequest") +type ProtoActualLRPsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + ActualLrps []*ProtoActualLRP `protobuf:"bytes,2,rep,name=actual_lrps,proto3" json:"actual_lrps,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { proto.RegisterFile("actual_lrp_requests.proto", fileDescriptor_a7753fd8557db809) } - -var fileDescriptor_a7753fd8557db809 = []byte{ - // 851 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x38, 0xb1, 0x5b, 0x3f, 0xa7, 0xa9, 0xbd, 0xcd, 0x8f, 0xc5, 0xaa, 0xd6, 0x61, 0xcb, - 0x21, 0x42, 0xaa, 0x2b, 0xa5, 0x08, 0xa1, 0x48, 0x48, 0xc4, 0xa8, 0xa4, 0x56, 0xd3, 0xaa, 0x9a, - 0xf6, 0x04, 0x12, 0xab, 0xb1, 0x3d, 0x76, 0x47, 0xec, 0xee, 0x98, 0x99, 0xd9, 0x08, 0x73, 0x42, - 0x42, 0xea, 0x81, 0x13, 0x7f, 0x06, 0x7f, 0x07, 0x1c, 0xe0, 0x98, 0x03, 0x87, 0x9e, 0xac, 0xc6, - 0xb9, 0x20, 0x9f, 0xfa, 0x27, 0xa0, 0x9d, 0xf1, 0x6e, 0xd6, 0xde, 0x82, 0x1a, 0x08, 0x12, 0x3d, - 0xed, 0xbc, 0x6f, 0xde, 0x7c, 0xdf, 0x37, 0x6f, 0xdf, 0xcc, 0x2e, 0xbc, 0x43, 0x7a, 0x2a, 0x22, - 0xbe, 0xe7, 0x8b, 0x91, 0x27, 0xe8, 0xd7, 0x11, 0x95, 0x4a, 0xb6, 0x46, 0x82, 0x2b, 0x6e, 0x95, - 0x03, 0xde, 0xa7, 0xbe, 0x6c, 0xdc, 0x1e, 0x32, 0xf5, 0x2c, 0xea, 0xb6, 0x7a, 0x3c, 0xb8, 0x33, - 0xe4, 0x43, 0x7e, 0x47, 0x4f, 0x77, 0xa3, 0x81, 0x8e, 0x74, 0xa0, 0x47, 0x66, 0x59, 0xa3, 0x76, - 0xce, 0x38, 0x47, 0xaa, 0x54, 0x08, 0x2e, 0x4c, 0xe0, 0x1e, 0x40, 0xe3, 0x40, 0x27, 0x1c, 0xe1, - 0xc7, 0x47, 0x6c, 0x40, 0x7b, 0xe3, 0x9e, 0x4f, 0x31, 0x95, 0x23, 0x1e, 0x4a, 0x6a, 0xdd, 0x82, - 0x92, 0x4e, 0xb6, 0xd1, 0x0e, 0xda, 0xad, 0xee, 0x5d, 0x6b, 0x19, 0x0f, 0xad, 0x7b, 0x31, 0x88, - 0xcd, 0x9c, 0xfb, 0x1c, 0xc1, 0x76, 0xca, 0x71, 0x28, 0x78, 0x34, 0x92, 0x17, 0x22, 0xb0, 0xda, - 0x50, 0xcf, 0x6c, 0x7b, 0xa8, 0x19, 0xec, 0xe2, 0xce, 0xca, 0x6e, 0x75, 0x6f, 0x2b, 0x59, 0xb0, - 0x28, 0x80, 0xaf, 0x9b, 0x05, 0x47, 0x62, 0x64, 0x04, 0xf7, 0x8b, 0x36, 0x72, 0xbf, 0x47, 0xb0, - 0xb5, 0x94, 0x77, 0x21, 0x1f, 0x9f, 0x40, 0x6d, 0xd9, 0x87, 0x5d, 0xd4, 0xf9, 0x7f, 0x65, 0x63, - 0x7d, 0xd1, 0x86, 0x76, 0x31, 0x58, 0x36, 0x21, 0xb1, 0x79, 0x91, 0x96, 0x0b, 0xe5, 0x3e, 0x0f, - 0x08, 0x0b, 0xb5, 0x8b, 0x4a, 0x1b, 0x66, 0x93, 0xe6, 0x1c, 0xc1, 0xf3, 0xa7, 0xf5, 0x1e, 0x5c, - 0xe9, 0x51, 0xdf, 0xf7, 0x58, 0x5f, 0x4b, 0x57, 0xda, 0xd5, 0xd9, 0xa4, 0x99, 0x40, 0xb8, 0x1c, - 0x0f, 0x3a, 0x7d, 0xad, 0xf3, 0x25, 0xdc, 0x5a, 0xd2, 0x69, 0x8f, 0x1f, 0x0b, 0xde, 0xa3, 0x52, - 0x1e, 0x46, 0xac, 0x9f, 0x88, 0xde, 0x85, 0xb5, 0x91, 0x41, 0xbd, 0x61, 0xc4, 0xfa, 0x73, 0xe9, - 0xda, 0x6c, 0xd2, 0x5c, 0xc0, 0x71, 0x75, 0x74, 0xbe, 0x56, 0xf3, 0x3f, 0x47, 0xf0, 0xfe, 0xa2, - 0xc0, 0x02, 0xff, 0x41, 0xd8, 0xef, 0x84, 0x7d, 0xfa, 0xcd, 0xbf, 0xd1, 0xb1, 0x9a, 0x50, 0x62, - 0x31, 0x89, 0xde, 0x6b, 0xa9, 0x5d, 0x99, 0x4d, 0x9a, 0x06, 0xc0, 0xe6, 0xa1, 0x8d, 0xfc, 0x8c, - 0x60, 0xf3, 0x53, 0x9f, 0xb0, 0x20, 0x75, 0xf3, 0x9f, 0x6a, 0x5a, 0x4f, 0x60, 0x3b, 0xd3, 0x06, - 0x2c, 0x94, 0x8a, 0x84, 0x3d, 0xea, 0x7d, 0x45, 0xc7, 0xf6, 0x8a, 0xee, 0x86, 0x9b, 0xb9, 0x6e, - 0xe8, 0xcc, 0x93, 0x1e, 0xd0, 0x31, 0xde, 0x48, 0x7b, 0x22, 0x83, 0xba, 0xbf, 0xaf, 0xc2, 0xe6, - 0x13, 0x45, 0x84, 0xca, 0x6d, 0x62, 0x1f, 0xd6, 0x33, 0x72, 0xb1, 0x8a, 0xe9, 0xd1, 0x8d, 0x9c, - 0x4a, 0xcc, 0xbe, 0x96, 0xb2, 0x3f, 0xa0, 0xe3, 0xbf, 0xb3, 0x5a, 0xfc, 0xa7, 0x56, 0xad, 0x43, - 0xb8, 0x91, 0x21, 0x0d, 0xa9, 0xf2, 0x58, 0x38, 0xe0, 0xf3, 0xbd, 0xdb, 0x39, 0xc2, 0x47, 0x54, - 0x75, 0xc2, 0x01, 0xc7, 0xb5, 0x94, 0x6c, 0x8e, 0x58, 0x5f, 0x40, 0x63, 0xc1, 0x9d, 0xa2, 0x22, - 0x24, 0xbe, 0x27, 0x78, 0xa4, 0xa8, 0xb4, 0x57, 0xf5, 0x01, 0x77, 0x5e, 0x63, 0xd0, 0xe4, 0xe1, - 0x38, 0x0d, 0x6f, 0x67, 0x2c, 0x66, 0x70, 0x69, 0x3d, 0x82, 0x6a, 0x40, 0x95, 0x60, 0x3d, 0x4f, - 0x91, 0xa1, 0xb4, 0x4b, 0x9a, 0xed, 0x76, 0xc2, 0xf6, 0xda, 0x52, 0xb7, 0x1e, 0xea, 0x05, 0x4f, - 0xc9, 0x50, 0xde, 0x0b, 0x95, 0x18, 0x63, 0x08, 0x52, 0xc0, 0xba, 0x09, 0x57, 0x63, 0x66, 0xd2, - 0xf5, 0xa9, 0x5d, 0xde, 0x41, 0xbb, 0x57, 0xef, 0x17, 0x70, 0x8a, 0xe8, 0x2b, 0xea, 0x98, 0x30, - 0x9f, 0x74, 0x99, 0xcf, 0xd4, 0xd8, 0xfb, 0x96, 0x87, 0xd4, 0xbe, 0xa2, 0xdb, 0x6d, 0x73, 0x36, - 0x69, 0xe6, 0x27, 0x71, 0x2d, 0x0b, 0x7d, 0xce, 0x43, 0xda, 0xf8, 0x18, 0xae, 0x2f, 0x19, 0xb0, - 0x6a, 0xb0, 0x92, 0xbc, 0xf0, 0x0a, 0x8e, 0x87, 0xd6, 0x06, 0x94, 0x8e, 0x89, 0x1f, 0x51, 0x73, - 0xfa, 0xb1, 0x09, 0xf6, 0x8b, 0x1f, 0xa1, 0xf6, 0x0d, 0xa8, 0xf3, 0x91, 0x62, 0x3c, 0x29, 0x61, - 0xec, 0xcb, 0x7d, 0x19, 0x9f, 0x0d, 0x41, 0xe4, 0xb3, 0xff, 0x7f, 0x5b, 0x7d, 0x08, 0xd7, 0xf4, - 0x35, 0xeb, 0x05, 0x54, 0x4a, 0x32, 0xa4, 0xba, 0xa1, 0x2a, 0xed, 0xfa, 0x6c, 0xd2, 0x5c, 0x9c, - 0xc0, 0x6b, 0x3a, 0x7c, 0x68, 0x22, 0xf7, 0x07, 0x04, 0x1b, 0x9f, 0x11, 0xe6, 0x5f, 0xea, 0x0e, - 0x73, 0x66, 0x8a, 0x6f, 0x66, 0xe6, 0x29, 0x6c, 0x61, 0xaa, 0x98, 0xa0, 0x97, 0xe9, 0xc6, 0xfd, - 0x05, 0xc5, 0xb4, 0x01, 0x3f, 0xa6, 0x6f, 0xf3, 0x15, 0x17, 0x80, 0x95, 0x66, 0x5f, 0xf0, 0x0f, - 0x60, 0x0f, 0xaa, 0xe7, 0x7e, 0x92, 0x6f, 0x7f, 0x3d, 0xe7, 0x01, 0x43, 0x2a, 0x2c, 0xdd, 0x5f, - 0x11, 0xd4, 0xb3, 0x7a, 0x97, 0xfc, 0x8d, 0xcd, 0x55, 0x7e, 0xe5, 0x4d, 0x2a, 0xff, 0x6e, 0x52, - 0xf9, 0xd5, 0xa5, 0xca, 0xdf, 0x2f, 0xcc, 0x6b, 0xdf, 0xae, 0xc1, 0x7a, 0x7a, 0x8e, 0x0d, 0xf2, - 0xc1, 0xc9, 0xa9, 0x53, 0x78, 0x71, 0xea, 0x14, 0x5e, 0x9d, 0x3a, 0xe8, 0xbb, 0xa9, 0x83, 0x7e, - 0x9a, 0x3a, 0xe8, 0xb7, 0xa9, 0x83, 0x4e, 0xa6, 0x0e, 0x7a, 0x39, 0x75, 0xd0, 0x1f, 0x53, 0xa7, - 0xf0, 0x6a, 0xea, 0xa0, 0x1f, 0xcf, 0x9c, 0xc2, 0xc9, 0x99, 0x53, 0x78, 0x71, 0xe6, 0x14, 0xba, - 0x65, 0xfd, 0x03, 0x77, 0xf7, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xee, 0x85, 0x3a, 0xee, 0x33, - 0x0a, 0x00, 0x00, +func (x *ProtoActualLRPsResponse) Reset() { + *x = ProtoActualLRPsResponse{} + mi := &file_actual_lrp_requests_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (this *ActualLRPLifecycleResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ActualLRPLifecycleResponse) - if !ok { - that2, ok := that.(ActualLRPLifecycleResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Error.Equal(that1.Error) { - return false - } - return true +func (x *ProtoActualLRPsResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *ActualLRPGroupsResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPGroupsResponse) - if !ok { - that2, ok := that.(ActualLRPGroupsResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Error.Equal(that1.Error) { - return false - } - if len(this.ActualLrpGroups) != len(that1.ActualLrpGroups) { - return false - } - for i := range this.ActualLrpGroups { - if !this.ActualLrpGroups[i].Equal(that1.ActualLrpGroups[i]) { - return false - } - } - return true -} -func (this *ActualLRPGroupResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoActualLRPsResponse) ProtoMessage() {} - that1, ok := that.(*ActualLRPGroupResponse) - if !ok { - that2, ok := that.(ActualLRPGroupResponse) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoActualLRPsResponse) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Error.Equal(that1.Error) { - return false - } - if !this.ActualLrpGroup.Equal(that1.ActualLrpGroup) { - return false - } - return true + return mi.MessageOf(x) } -func (this *ActualLRPGroupsRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPGroupsRequest) - if !ok { - that2, ok := that.(ActualLRPGroupsRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Domain != that1.Domain { - return false - } - if this.CellId != that1.CellId { - return false - } - return true +// Deprecated: Use ProtoActualLRPsResponse.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPsResponse) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{12} } -func (this *ActualLRPGroupsByProcessGuidRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPGroupsByProcessGuidRequest) - if !ok { - that2, ok := that.(ActualLRPGroupsByProcessGuidRequest) - if ok { - that1 = &that2 - } else { - return false - } +func (x *ProtoActualLRPsResponse) GetError() *ProtoError { + if x != nil { + return x.Error } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProcessGuid != that1.ProcessGuid { - return false - } - return true + return nil } -func (this *ActualLRPGroupByProcessGuidAndIndexRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPGroupByProcessGuidAndIndexRequest) - if !ok { - that2, ok := that.(ActualLRPGroupByProcessGuidAndIndexRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProcessGuid != that1.ProcessGuid { - return false - } - if this.Index != that1.Index { - return false +func (x *ProtoActualLRPsResponse) GetActualLrps() []*ProtoActualLRP { + if x != nil { + return x.ActualLrps } - return true + return nil } -func (this *ClaimActualLRPRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ClaimActualLRPRequest) - if !ok { - that2, ok := that.(ClaimActualLRPRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProcessGuid != that1.ProcessGuid { - return false - } - if this.Index != that1.Index { - return false - } - if !this.ActualLrpInstanceKey.Equal(that1.ActualLrpInstanceKey) { - return false - } - return true +type ProtoActualLRPsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` + CellId string `protobuf:"bytes,2,opt,name=cell_id,proto3" json:"cell_id,omitempty"` + ProcessGuid string `protobuf:"bytes,3,opt,name=process_guid,proto3" json:"process_guid,omitempty"` + Index *int32 `protobuf:"varint,4,opt,name=index,proto3,oneof" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (this *StartActualLRPRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*StartActualLRPRequest) - if !ok { - that2, ok := that.(StartActualLRPRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.ActualLrpKey.Equal(that1.ActualLrpKey) { - return false - } - if !this.ActualLrpInstanceKey.Equal(that1.ActualLrpInstanceKey) { - return false - } - if !this.ActualLrpNetInfo.Equal(that1.ActualLrpNetInfo) { - return false - } - if len(this.ActualLrpInternalRoutes) != len(that1.ActualLrpInternalRoutes) { - return false - } - for i := range this.ActualLrpInternalRoutes { - if !this.ActualLrpInternalRoutes[i].Equal(that1.ActualLrpInternalRoutes[i]) { - return false - } - } - if len(this.MetricTags) != len(that1.MetricTags) { - return false - } - for i := range this.MetricTags { - if this.MetricTags[i] != that1.MetricTags[i] { - return false - } - } - if that1.OptionalRoutable == nil { - if this.OptionalRoutable != nil { - return false - } - } else if this.OptionalRoutable == nil { - return false - } else if !this.OptionalRoutable.Equal(that1.OptionalRoutable) { - return false - } - if this.AvailabilityZone != that1.AvailabilityZone { - return false - } - return true +func (x *ProtoActualLRPsRequest) Reset() { + *x = ProtoActualLRPsRequest{} + mi := &file_actual_lrp_requests_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (this *StartActualLRPRequest_Routable) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*StartActualLRPRequest_Routable) - if !ok { - that2, ok := that.(StartActualLRPRequest_Routable) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Routable != that1.Routable { - return false - } - return true +func (x *ProtoActualLRPsRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *CrashActualLRPRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*CrashActualLRPRequest) - if !ok { - that2, ok := that.(CrashActualLRPRequest) - if ok { - that1 = &that2 - } else { - return false +func (*ProtoActualLRPsRequest) ProtoMessage() {} + +func (x *ProtoActualLRPsRequest) ProtoReflect() protoreflect.Message { + mi := &file_actual_lrp_requests_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.ActualLrpKey.Equal(that1.ActualLrpKey) { - return false - } - if !this.ActualLrpInstanceKey.Equal(that1.ActualLrpInstanceKey) { - return false - } - if this.ErrorMessage != that1.ErrorMessage { - return false - } - return true + return mi.MessageOf(x) } -func (this *FailActualLRPRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*FailActualLRPRequest) - if !ok { - that2, ok := that.(FailActualLRPRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.ActualLrpKey.Equal(that1.ActualLrpKey) { - return false - } - if this.ErrorMessage != that1.ErrorMessage { - return false - } - return true +// Deprecated: Use ProtoActualLRPsRequest.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPsRequest) Descriptor() ([]byte, []int) { + return file_actual_lrp_requests_proto_rawDescGZIP(), []int{13} } -func (this *RetireActualLRPRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*RetireActualLRPRequest) - if !ok { - that2, ok := that.(RetireActualLRPRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false +func (x *ProtoActualLRPsRequest) GetDomain() string { + if x != nil { + return x.Domain } - if !this.ActualLrpKey.Equal(that1.ActualLrpKey) { - return false - } - return true + return "" } -func (this *RemoveActualLRPRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*RemoveActualLRPRequest) - if !ok { - that2, ok := that.(RemoveActualLRPRequest) - if ok { - that1 = &that2 - } else { - return false - } +func (x *ProtoActualLRPsRequest) GetCellId() string { + if x != nil { + return x.CellId } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProcessGuid != that1.ProcessGuid { - return false - } - if this.Index != that1.Index { - return false - } - if !this.ActualLrpInstanceKey.Equal(that1.ActualLrpInstanceKey) { - return false - } - return true + return "" } -func (this *ActualLRPsResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPsResponse) - if !ok { - that2, ok := that.(ActualLRPsResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false +func (x *ProtoActualLRPsRequest) GetProcessGuid() string { + if x != nil { + return x.ProcessGuid } - if !this.Error.Equal(that1.Error) { - return false - } - if len(this.ActualLrps) != len(that1.ActualLrps) { - return false - } - for i := range this.ActualLrps { - if !this.ActualLrps[i].Equal(that1.ActualLrps[i]) { - return false - } - } - return true + return "" } -func (this *ActualLRPsRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPsRequest) - if !ok { - that2, ok := that.(ActualLRPsRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false +func (x *ProtoActualLRPsRequest) GetIndex() int32 { + if x != nil && x.Index != nil { + return *x.Index } - if this.Domain != that1.Domain { - return false - } - if this.CellId != that1.CellId { - return false - } - if this.ProcessGuid != that1.ProcessGuid { - return false - } - if that1.OptionalIndex == nil { - if this.OptionalIndex != nil { - return false - } - } else if this.OptionalIndex == nil { - return false - } else if !this.OptionalIndex.Equal(that1.OptionalIndex) { - return false - } - return true + return 0 } -func (this *ActualLRPsRequest_Index) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPsRequest_Index) - if !ok { - that2, ok := that.(ActualLRPsRequest_Index) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Index != that1.Index { - return false - } - return true +var File_actual_lrp_requests_proto protoreflect.FileDescriptor + +const file_actual_lrp_requests_proto_rawDesc = "" + + "\n" + + "\x19actual_lrp_requests.proto\x12\x06models\x1a\tbbs.proto\x1a\x10actual_lrp.proto\x1a\verror.proto\"K\n" + + "\x1fProtoActualLRPLifecycleResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\"\x97\x01\n" + + "\x1cProtoActualLRPGroupsResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\x12I\n" + + "\x11actual_lrp_groups\x18\x02 \x03(\v2\x1b.models.ProtoActualLRPGroupR\x11actual_lrp_groups:\x02\x18\x01\"\x94\x01\n" + + "\x1bProtoActualLRPGroupResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\x12G\n" + + "\x10actual_lrp_group\x18\x02 \x01(\v2\x1b.models.ProtoActualLRPGroupR\x10actual_lrp_group:\x02\x18\x01\"]\n" + + "\x1bProtoActualLRPGroupsRequest\x12\x1b\n" + + "\x06domain\x18\x01 \x01(\tB\x03\xc0>\x01R\x06domain\x12\x1d\n" + + "\acell_id\x18\x02 \x01(\tB\x03\xc0>\x01R\acell_id:\x02\x18\x01\"W\n" + + "(ProtoActualLRPGroupsByProcessGuidRequest\x12'\n" + + "\fprocess_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\fprocess_guid:\x02\x18\x01\"y\n" + + "/ProtoActualLRPGroupByProcessGuidAndIndexRequest\x12'\n" + + "\fprocess_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\fprocess_guid\x12\x19\n" + + "\x05index\x18\x02 \x01(\x05B\x03\xc0>\x01R\x05index:\x02\x18\x01\"\xbd\x01\n" + + "\x1aProtoClaimActualLRPRequest\x12'\n" + + "\fprocess_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\fprocess_guid\x12\x19\n" + + "\x05index\x18\x02 \x01(\x05B\x03\xc0>\x01R\x05index\x12[\n" + + "\x17actual_lrp_instance_key\x18\x03 \x01(\v2!.models.ProtoActualLRPInstanceKeyR\x17actual_lrp_instance_key\"\xe8\x04\n" + + "\x1aProtoStartActualLRPRequest\x12A\n" + + "\x0eactual_lrp_key\x18\x01 \x01(\v2\x19.models.ProtoActualLRPKeyR\x0eactual_lrp_key\x12[\n" + + "\x17actual_lrp_instance_key\x18\x02 \x01(\v2!.models.ProtoActualLRPInstanceKeyR\x17actual_lrp_instance_key\x12O\n" + + "\x13actual_lrp_net_info\x18\x03 \x01(\v2\x1d.models.ProtoActualLRPNetInfoR\x13actual_lrp_net_info\x12c\n" + + "\x1aactual_lrp_internal_routes\x18\x04 \x03(\v2#.models.ProtoActualLRPInternalRouteR\x1aactual_lrp_internal_routes\x12T\n" + + "\vmetric_tags\x18\x05 \x03(\v22.models.ProtoStartActualLRPRequest.MetricTagsEntryR\vmetric_tags\x12\x1f\n" + + "\bRoutable\x18\x06 \x01(\bH\x00R\bRoutable\x88\x01\x01\x121\n" + + "\x11availability_zone\x18\a \x01(\tB\x03\xc0>\x01R\x11availability_zone\x1a=\n" + + "\x0fMetricTagsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\v\n" + + "\t_Routable\"\xe7\x01\n" + + "\x1aProtoCrashActualLRPRequest\x12A\n" + + "\x0eactual_lrp_key\x18\x01 \x01(\v2\x19.models.ProtoActualLRPKeyR\x0eactual_lrp_key\x12[\n" + + "\x17actual_lrp_instance_key\x18\x02 \x01(\v2!.models.ProtoActualLRPInstanceKeyR\x17actual_lrp_instance_key\x12)\n" + + "\rerror_message\x18\x03 \x01(\tB\x03\xc0>\x01R\rerror_message\"\x89\x01\n" + + "\x19ProtoFailActualLRPRequest\x12A\n" + + "\x0eactual_lrp_key\x18\x01 \x01(\v2\x19.models.ProtoActualLRPKeyR\x0eactual_lrp_key\x12)\n" + + "\rerror_message\x18\x02 \x01(\tB\x03\xc0>\x01R\rerror_message\"`\n" + + "\x1bProtoRetireActualLRPRequest\x12A\n" + + "\x0eactual_lrp_key\x18\x01 \x01(\v2\x19.models.ProtoActualLRPKeyR\x0eactual_lrp_key\"\xbe\x01\n" + + "\x1bProtoRemoveActualLRPRequest\x12'\n" + + "\fprocess_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\fprocess_guid\x12\x19\n" + + "\x05index\x18\x02 \x01(\x05B\x03\xc0>\x01R\x05index\x12[\n" + + "\x17actual_lrp_instance_key\x18\x03 \x01(\v2!.models.ProtoActualLRPInstanceKeyR\x17actual_lrp_instance_key\"}\n" + + "\x17ProtoActualLRPsResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\x128\n" + + "\vactual_lrps\x18\x02 \x03(\v2\x16.models.ProtoActualLRPR\vactual_lrps\"\xa7\x01\n" + + "\x16ProtoActualLRPsRequest\x12\x1b\n" + + "\x06domain\x18\x01 \x01(\tB\x03\xc0>\x01R\x06domain\x12\x1d\n" + + "\acell_id\x18\x02 \x01(\tB\x03\xc0>\x01R\acell_id\x12'\n" + + "\fprocess_guid\x18\x03 \x01(\tB\x03\xc0>\x01R\fprocess_guid\x12\x1e\n" + + "\x05index\x18\x04 \x01(\x05B\x03\xc0>\x01H\x00R\x05index\x88\x01\x01B\b\n" + + "\x06_indexB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" + +var ( + file_actual_lrp_requests_proto_rawDescOnce sync.Once + file_actual_lrp_requests_proto_rawDescData []byte +) + +func file_actual_lrp_requests_proto_rawDescGZIP() []byte { + file_actual_lrp_requests_proto_rawDescOnce.Do(func() { + file_actual_lrp_requests_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_actual_lrp_requests_proto_rawDesc), len(file_actual_lrp_requests_proto_rawDesc))) + }) + return file_actual_lrp_requests_proto_rawDescData +} + +var file_actual_lrp_requests_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_actual_lrp_requests_proto_goTypes = []any{ + (*ProtoActualLRPLifecycleResponse)(nil), // 0: models.ProtoActualLRPLifecycleResponse + (*ProtoActualLRPGroupsResponse)(nil), // 1: models.ProtoActualLRPGroupsResponse + (*ProtoActualLRPGroupResponse)(nil), // 2: models.ProtoActualLRPGroupResponse + (*ProtoActualLRPGroupsRequest)(nil), // 3: models.ProtoActualLRPGroupsRequest + (*ProtoActualLRPGroupsByProcessGuidRequest)(nil), // 4: models.ProtoActualLRPGroupsByProcessGuidRequest + (*ProtoActualLRPGroupByProcessGuidAndIndexRequest)(nil), // 5: models.ProtoActualLRPGroupByProcessGuidAndIndexRequest + (*ProtoClaimActualLRPRequest)(nil), // 6: models.ProtoClaimActualLRPRequest + (*ProtoStartActualLRPRequest)(nil), // 7: models.ProtoStartActualLRPRequest + (*ProtoCrashActualLRPRequest)(nil), // 8: models.ProtoCrashActualLRPRequest + (*ProtoFailActualLRPRequest)(nil), // 9: models.ProtoFailActualLRPRequest + (*ProtoRetireActualLRPRequest)(nil), // 10: models.ProtoRetireActualLRPRequest + (*ProtoRemoveActualLRPRequest)(nil), // 11: models.ProtoRemoveActualLRPRequest + (*ProtoActualLRPsResponse)(nil), // 12: models.ProtoActualLRPsResponse + (*ProtoActualLRPsRequest)(nil), // 13: models.ProtoActualLRPsRequest + nil, // 14: models.ProtoStartActualLRPRequest.MetricTagsEntry + (*ProtoError)(nil), // 15: models.ProtoError + (*ProtoActualLRPGroup)(nil), // 16: models.ProtoActualLRPGroup + (*ProtoActualLRPInstanceKey)(nil), // 17: models.ProtoActualLRPInstanceKey + (*ProtoActualLRPKey)(nil), // 18: models.ProtoActualLRPKey + (*ProtoActualLRPNetInfo)(nil), // 19: models.ProtoActualLRPNetInfo + (*ProtoActualLRPInternalRoute)(nil), // 20: models.ProtoActualLRPInternalRoute + (*ProtoActualLRP)(nil), // 21: models.ProtoActualLRP +} +var file_actual_lrp_requests_proto_depIdxs = []int32{ + 15, // 0: models.ProtoActualLRPLifecycleResponse.error:type_name -> models.ProtoError + 15, // 1: models.ProtoActualLRPGroupsResponse.error:type_name -> models.ProtoError + 16, // 2: models.ProtoActualLRPGroupsResponse.actual_lrp_groups:type_name -> models.ProtoActualLRPGroup + 15, // 3: models.ProtoActualLRPGroupResponse.error:type_name -> models.ProtoError + 16, // 4: models.ProtoActualLRPGroupResponse.actual_lrp_group:type_name -> models.ProtoActualLRPGroup + 17, // 5: models.ProtoClaimActualLRPRequest.actual_lrp_instance_key:type_name -> models.ProtoActualLRPInstanceKey + 18, // 6: models.ProtoStartActualLRPRequest.actual_lrp_key:type_name -> models.ProtoActualLRPKey + 17, // 7: models.ProtoStartActualLRPRequest.actual_lrp_instance_key:type_name -> models.ProtoActualLRPInstanceKey + 19, // 8: models.ProtoStartActualLRPRequest.actual_lrp_net_info:type_name -> models.ProtoActualLRPNetInfo + 20, // 9: models.ProtoStartActualLRPRequest.actual_lrp_internal_routes:type_name -> models.ProtoActualLRPInternalRoute + 14, // 10: models.ProtoStartActualLRPRequest.metric_tags:type_name -> models.ProtoStartActualLRPRequest.MetricTagsEntry + 18, // 11: models.ProtoCrashActualLRPRequest.actual_lrp_key:type_name -> models.ProtoActualLRPKey + 17, // 12: models.ProtoCrashActualLRPRequest.actual_lrp_instance_key:type_name -> models.ProtoActualLRPInstanceKey + 18, // 13: models.ProtoFailActualLRPRequest.actual_lrp_key:type_name -> models.ProtoActualLRPKey + 18, // 14: models.ProtoRetireActualLRPRequest.actual_lrp_key:type_name -> models.ProtoActualLRPKey + 17, // 15: models.ProtoRemoveActualLRPRequest.actual_lrp_instance_key:type_name -> models.ProtoActualLRPInstanceKey + 15, // 16: models.ProtoActualLRPsResponse.error:type_name -> models.ProtoError + 21, // 17: models.ProtoActualLRPsResponse.actual_lrps:type_name -> models.ProtoActualLRP + 18, // [18:18] is the sub-list for method output_type + 18, // [18:18] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name +} + +func init() { file_actual_lrp_requests_proto_init() } +func file_actual_lrp_requests_proto_init() { + if File_actual_lrp_requests_proto != nil { + return + } + file_bbs_proto_init() + file_actual_lrp_proto_init() + file_error_proto_init() + file_actual_lrp_requests_proto_msgTypes[7].OneofWrappers = []any{} + file_actual_lrp_requests_proto_msgTypes[13].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_actual_lrp_requests_proto_rawDesc), len(file_actual_lrp_requests_proto_rawDesc)), + NumEnums: 0, + NumMessages: 15, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_actual_lrp_requests_proto_goTypes, + DependencyIndexes: file_actual_lrp_requests_proto_depIdxs, + MessageInfos: file_actual_lrp_requests_proto_msgTypes, + }.Build() + File_actual_lrp_requests_proto = out.File + file_actual_lrp_requests_proto_goTypes = nil + file_actual_lrp_requests_proto_depIdxs = nil } -func (this *ActualLRPLifecycleResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.ActualLRPLifecycleResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPGroupsResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ActualLRPGroupsResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - if this.ActualLrpGroups != nil { - s = append(s, "ActualLrpGroups: "+fmt.Sprintf("%#v", this.ActualLrpGroups)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPGroupResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ActualLRPGroupResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - if this.ActualLrpGroup != nil { - s = append(s, "ActualLrpGroup: "+fmt.Sprintf("%#v", this.ActualLrpGroup)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPGroupsRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ActualLRPGroupsRequest{") - s = append(s, "Domain: "+fmt.Sprintf("%#v", this.Domain)+",\n") - s = append(s, "CellId: "+fmt.Sprintf("%#v", this.CellId)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPGroupsByProcessGuidRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.ActualLRPGroupsByProcessGuidRequest{") - s = append(s, "ProcessGuid: "+fmt.Sprintf("%#v", this.ProcessGuid)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPGroupByProcessGuidAndIndexRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ActualLRPGroupByProcessGuidAndIndexRequest{") - s = append(s, "ProcessGuid: "+fmt.Sprintf("%#v", this.ProcessGuid)+",\n") - s = append(s, "Index: "+fmt.Sprintf("%#v", this.Index)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ClaimActualLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&models.ClaimActualLRPRequest{") - s = append(s, "ProcessGuid: "+fmt.Sprintf("%#v", this.ProcessGuid)+",\n") - s = append(s, "Index: "+fmt.Sprintf("%#v", this.Index)+",\n") - if this.ActualLrpInstanceKey != nil { - s = append(s, "ActualLrpInstanceKey: "+fmt.Sprintf("%#v", this.ActualLrpInstanceKey)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StartActualLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&models.StartActualLRPRequest{") - if this.ActualLrpKey != nil { - s = append(s, "ActualLrpKey: "+fmt.Sprintf("%#v", this.ActualLrpKey)+",\n") - } - if this.ActualLrpInstanceKey != nil { - s = append(s, "ActualLrpInstanceKey: "+fmt.Sprintf("%#v", this.ActualLrpInstanceKey)+",\n") - } - if this.ActualLrpNetInfo != nil { - s = append(s, "ActualLrpNetInfo: "+fmt.Sprintf("%#v", this.ActualLrpNetInfo)+",\n") - } - if this.ActualLrpInternalRoutes != nil { - s = append(s, "ActualLrpInternalRoutes: "+fmt.Sprintf("%#v", this.ActualLrpInternalRoutes)+",\n") - } - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]string{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%#v: %#v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - if this.MetricTags != nil { - s = append(s, "MetricTags: "+mapStringForMetricTags+",\n") - } - if this.OptionalRoutable != nil { - s = append(s, "OptionalRoutable: "+fmt.Sprintf("%#v", this.OptionalRoutable)+",\n") - } - s = append(s, "AvailabilityZone: "+fmt.Sprintf("%#v", this.AvailabilityZone)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StartActualLRPRequest_Routable) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&models.StartActualLRPRequest_Routable{` + - `Routable:` + fmt.Sprintf("%#v", this.Routable) + `}`}, ", ") - return s -} -func (this *CrashActualLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&models.CrashActualLRPRequest{") - if this.ActualLrpKey != nil { - s = append(s, "ActualLrpKey: "+fmt.Sprintf("%#v", this.ActualLrpKey)+",\n") - } - if this.ActualLrpInstanceKey != nil { - s = append(s, "ActualLrpInstanceKey: "+fmt.Sprintf("%#v", this.ActualLrpInstanceKey)+",\n") - } - s = append(s, "ErrorMessage: "+fmt.Sprintf("%#v", this.ErrorMessage)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FailActualLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.FailActualLRPRequest{") - if this.ActualLrpKey != nil { - s = append(s, "ActualLrpKey: "+fmt.Sprintf("%#v", this.ActualLrpKey)+",\n") - } - s = append(s, "ErrorMessage: "+fmt.Sprintf("%#v", this.ErrorMessage)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RetireActualLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.RetireActualLRPRequest{") - if this.ActualLrpKey != nil { - s = append(s, "ActualLrpKey: "+fmt.Sprintf("%#v", this.ActualLrpKey)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RemoveActualLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&models.RemoveActualLRPRequest{") - s = append(s, "ProcessGuid: "+fmt.Sprintf("%#v", this.ProcessGuid)+",\n") - s = append(s, "Index: "+fmt.Sprintf("%#v", this.Index)+",\n") - if this.ActualLrpInstanceKey != nil { - s = append(s, "ActualLrpInstanceKey: "+fmt.Sprintf("%#v", this.ActualLrpInstanceKey)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPsResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ActualLRPsResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - if this.ActualLrps != nil { - s = append(s, "ActualLrps: "+fmt.Sprintf("%#v", this.ActualLrps)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPsRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&models.ActualLRPsRequest{") - s = append(s, "Domain: "+fmt.Sprintf("%#v", this.Domain)+",\n") - s = append(s, "CellId: "+fmt.Sprintf("%#v", this.CellId)+",\n") - s = append(s, "ProcessGuid: "+fmt.Sprintf("%#v", this.ProcessGuid)+",\n") - if this.OptionalIndex != nil { - s = append(s, "OptionalIndex: "+fmt.Sprintf("%#v", this.OptionalIndex)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPsRequest_Index) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&models.ActualLRPsRequest_Index{` + - `Index:` + fmt.Sprintf("%#v", this.Index) + `}`}, ", ") - return s -} -func valueToGoStringActualLrpRequests(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *ActualLRPLifecycleResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPLifecycleResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPLifecycleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActualLRPGroupsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPGroupsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPGroupsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ActualLrpGroups) > 0 { - for iNdEx := len(m.ActualLrpGroups) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ActualLrpGroups[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActualLRPGroupResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPGroupResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPGroupResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ActualLrpGroup != nil { - { - size, err := m.ActualLrpGroup.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActualLRPGroupsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPGroupsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPGroupsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CellId) > 0 { - i -= len(m.CellId) - copy(dAtA[i:], m.CellId) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(m.CellId))) - i-- - dAtA[i] = 0x12 - } - if len(m.Domain) > 0 { - i -= len(m.Domain) - copy(dAtA[i:], m.Domain) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(m.Domain))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActualLRPGroupsByProcessGuidRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPGroupsByProcessGuidRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPGroupsByProcessGuidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProcessGuid) > 0 { - i -= len(m.ProcessGuid) - copy(dAtA[i:], m.ProcessGuid) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(m.ProcessGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActualLRPGroupByProcessGuidAndIndexRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPGroupByProcessGuidAndIndexRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPGroupByProcessGuidAndIndexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Index != 0 { - i = encodeVarintActualLrpRequests(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x10 - } - if len(m.ProcessGuid) > 0 { - i -= len(m.ProcessGuid) - copy(dAtA[i:], m.ProcessGuid) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(m.ProcessGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ClaimActualLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClaimActualLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ClaimActualLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ActualLrpInstanceKey != nil { - { - size, err := m.ActualLrpInstanceKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Index != 0 { - i = encodeVarintActualLrpRequests(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x10 - } - if len(m.ProcessGuid) > 0 { - i -= len(m.ProcessGuid) - copy(dAtA[i:], m.ProcessGuid) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(m.ProcessGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *StartActualLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StartActualLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StartActualLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AvailabilityZone) > 0 { - i -= len(m.AvailabilityZone) - copy(dAtA[i:], m.AvailabilityZone) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(m.AvailabilityZone))) - i-- - dAtA[i] = 0x3a - } - if m.OptionalRoutable != nil { - { - size := m.OptionalRoutable.Size() - i -= size - if _, err := m.OptionalRoutable.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.MetricTags) > 0 { - for k := range m.MetricTags { - v := m.MetricTags[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintActualLrpRequests(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x2a - } - } - if len(m.ActualLrpInternalRoutes) > 0 { - for iNdEx := len(m.ActualLrpInternalRoutes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ActualLrpInternalRoutes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.ActualLrpNetInfo != nil { - { - size, err := m.ActualLrpNetInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.ActualLrpInstanceKey != nil { - { - size, err := m.ActualLrpInstanceKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ActualLrpKey != nil { - { - size, err := m.ActualLrpKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *StartActualLRPRequest_Routable) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StartActualLRPRequest_Routable) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i-- - if m.Routable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *CrashActualLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CrashActualLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CrashActualLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ErrorMessage) > 0 { - i -= len(m.ErrorMessage) - copy(dAtA[i:], m.ErrorMessage) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(m.ErrorMessage))) - i-- - dAtA[i] = 0x1a - } - if m.ActualLrpInstanceKey != nil { - { - size, err := m.ActualLrpInstanceKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ActualLrpKey != nil { - { - size, err := m.ActualLrpKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *FailActualLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FailActualLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FailActualLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ErrorMessage) > 0 { - i -= len(m.ErrorMessage) - copy(dAtA[i:], m.ErrorMessage) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(m.ErrorMessage))) - i-- - dAtA[i] = 0x12 - } - if m.ActualLrpKey != nil { - { - size, err := m.ActualLrpKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RetireActualLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RetireActualLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RetireActualLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ActualLrpKey != nil { - { - size, err := m.ActualLrpKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveActualLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveActualLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveActualLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ActualLrpInstanceKey != nil { - { - size, err := m.ActualLrpInstanceKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Index != 0 { - i = encodeVarintActualLrpRequests(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x10 - } - if len(m.ProcessGuid) > 0 { - i -= len(m.ProcessGuid) - copy(dAtA[i:], m.ProcessGuid) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(m.ProcessGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActualLRPsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ActualLrps) > 0 { - for iNdEx := len(m.ActualLrps) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ActualLrps[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintActualLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActualLRPsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.OptionalIndex != nil { - { - size := m.OptionalIndex.Size() - i -= size - if _, err := m.OptionalIndex.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.ProcessGuid) > 0 { - i -= len(m.ProcessGuid) - copy(dAtA[i:], m.ProcessGuid) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(m.ProcessGuid))) - i-- - dAtA[i] = 0x1a - } - if len(m.CellId) > 0 { - i -= len(m.CellId) - copy(dAtA[i:], m.CellId) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(m.CellId))) - i-- - dAtA[i] = 0x12 - } - if len(m.Domain) > 0 { - i -= len(m.Domain) - copy(dAtA[i:], m.Domain) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(len(m.Domain))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActualLRPsRequest_Index) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPsRequest_Index) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintActualLrpRequests(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x20 - return len(dAtA) - i, nil -} -func encodeVarintActualLrpRequests(dAtA []byte, offset int, v uint64) int { - offset -= sovActualLrpRequests(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ActualLRPLifecycleResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - return n -} - -func (m *ActualLRPGroupsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - if len(m.ActualLrpGroups) > 0 { - for _, e := range m.ActualLrpGroups { - l = e.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - } - return n -} - -func (m *ActualLRPGroupResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - if m.ActualLrpGroup != nil { - l = m.ActualLrpGroup.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - return n -} - -func (m *ActualLRPGroupsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Domain) - if l > 0 { - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - l = len(m.CellId) - if l > 0 { - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - return n -} - -func (m *ActualLRPGroupsByProcessGuidRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProcessGuid) - if l > 0 { - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - return n -} - -func (m *ActualLRPGroupByProcessGuidAndIndexRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProcessGuid) - if l > 0 { - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - if m.Index != 0 { - n += 1 + sovActualLrpRequests(uint64(m.Index)) - } - return n -} - -func (m *ClaimActualLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProcessGuid) - if l > 0 { - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - if m.Index != 0 { - n += 1 + sovActualLrpRequests(uint64(m.Index)) - } - if m.ActualLrpInstanceKey != nil { - l = m.ActualLrpInstanceKey.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - return n -} - -func (m *StartActualLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActualLrpKey != nil { - l = m.ActualLrpKey.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - if m.ActualLrpInstanceKey != nil { - l = m.ActualLrpInstanceKey.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - if m.ActualLrpNetInfo != nil { - l = m.ActualLrpNetInfo.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - if len(m.ActualLrpInternalRoutes) > 0 { - for _, e := range m.ActualLrpInternalRoutes { - l = e.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - } - if len(m.MetricTags) > 0 { - for k, v := range m.MetricTags { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovActualLrpRequests(uint64(len(k))) + 1 + len(v) + sovActualLrpRequests(uint64(len(v))) - n += mapEntrySize + 1 + sovActualLrpRequests(uint64(mapEntrySize)) - } - } - if m.OptionalRoutable != nil { - n += m.OptionalRoutable.Size() - } - l = len(m.AvailabilityZone) - if l > 0 { - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - return n -} - -func (m *StartActualLRPRequest_Routable) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 2 - return n -} -func (m *CrashActualLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActualLrpKey != nil { - l = m.ActualLrpKey.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - if m.ActualLrpInstanceKey != nil { - l = m.ActualLrpInstanceKey.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - l = len(m.ErrorMessage) - if l > 0 { - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - return n -} - -func (m *FailActualLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActualLrpKey != nil { - l = m.ActualLrpKey.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - l = len(m.ErrorMessage) - if l > 0 { - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - return n -} - -func (m *RetireActualLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActualLrpKey != nil { - l = m.ActualLrpKey.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - return n -} - -func (m *RemoveActualLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProcessGuid) - if l > 0 { - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - if m.Index != 0 { - n += 1 + sovActualLrpRequests(uint64(m.Index)) - } - if m.ActualLrpInstanceKey != nil { - l = m.ActualLrpInstanceKey.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - return n -} - -func (m *ActualLRPsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - if len(m.ActualLrps) > 0 { - for _, e := range m.ActualLrps { - l = e.Size() - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - } - return n -} - -func (m *ActualLRPsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Domain) - if l > 0 { - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - l = len(m.CellId) - if l > 0 { - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - l = len(m.ProcessGuid) - if l > 0 { - n += 1 + l + sovActualLrpRequests(uint64(l)) - } - if m.OptionalIndex != nil { - n += m.OptionalIndex.Size() - } - return n -} - -func (m *ActualLRPsRequest_Index) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovActualLrpRequests(uint64(m.Index)) - return n -} - -func sovActualLrpRequests(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozActualLrpRequests(x uint64) (n int) { - return sovActualLrpRequests(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *ActualLRPLifecycleResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPLifecycleResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPGroupsResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForActualLrpGroups := "[]*ActualLRPGroup{" - for _, f := range this.ActualLrpGroups { - repeatedStringForActualLrpGroups += strings.Replace(fmt.Sprintf("%v", f), "ActualLRPGroup", "ActualLRPGroup", 1) + "," - } - repeatedStringForActualLrpGroups += "}" - s := strings.Join([]string{`&ActualLRPGroupsResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `ActualLrpGroups:` + repeatedStringForActualLrpGroups + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPGroupResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPGroupResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `ActualLrpGroup:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpGroup), "ActualLRPGroup", "ActualLRPGroup", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPGroupsRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPGroupsRequest{`, - `Domain:` + fmt.Sprintf("%v", this.Domain) + `,`, - `CellId:` + fmt.Sprintf("%v", this.CellId) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPGroupsByProcessGuidRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPGroupsByProcessGuidRequest{`, - `ProcessGuid:` + fmt.Sprintf("%v", this.ProcessGuid) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPGroupByProcessGuidAndIndexRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPGroupByProcessGuidAndIndexRequest{`, - `ProcessGuid:` + fmt.Sprintf("%v", this.ProcessGuid) + `,`, - `Index:` + fmt.Sprintf("%v", this.Index) + `,`, - `}`, - }, "") - return s -} -func (this *ClaimActualLRPRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClaimActualLRPRequest{`, - `ProcessGuid:` + fmt.Sprintf("%v", this.ProcessGuid) + `,`, - `Index:` + fmt.Sprintf("%v", this.Index) + `,`, - `ActualLrpInstanceKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpInstanceKey), "ActualLRPInstanceKey", "ActualLRPInstanceKey", 1) + `,`, - `}`, - }, "") - return s -} -func (this *StartActualLRPRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForActualLrpInternalRoutes := "[]*ActualLRPInternalRoute{" - for _, f := range this.ActualLrpInternalRoutes { - repeatedStringForActualLrpInternalRoutes += strings.Replace(fmt.Sprintf("%v", f), "ActualLRPInternalRoute", "ActualLRPInternalRoute", 1) + "," - } - repeatedStringForActualLrpInternalRoutes += "}" - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]string{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%v: %v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - s := strings.Join([]string{`&StartActualLRPRequest{`, - `ActualLrpKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpKey), "ActualLRPKey", "ActualLRPKey", 1) + `,`, - `ActualLrpInstanceKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpInstanceKey), "ActualLRPInstanceKey", "ActualLRPInstanceKey", 1) + `,`, - `ActualLrpNetInfo:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpNetInfo), "ActualLRPNetInfo", "ActualLRPNetInfo", 1) + `,`, - `ActualLrpInternalRoutes:` + repeatedStringForActualLrpInternalRoutes + `,`, - `MetricTags:` + mapStringForMetricTags + `,`, - `OptionalRoutable:` + fmt.Sprintf("%v", this.OptionalRoutable) + `,`, - `AvailabilityZone:` + fmt.Sprintf("%v", this.AvailabilityZone) + `,`, - `}`, - }, "") - return s -} -func (this *StartActualLRPRequest_Routable) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StartActualLRPRequest_Routable{`, - `Routable:` + fmt.Sprintf("%v", this.Routable) + `,`, - `}`, - }, "") - return s -} -func (this *CrashActualLRPRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CrashActualLRPRequest{`, - `ActualLrpKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpKey), "ActualLRPKey", "ActualLRPKey", 1) + `,`, - `ActualLrpInstanceKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpInstanceKey), "ActualLRPInstanceKey", "ActualLRPInstanceKey", 1) + `,`, - `ErrorMessage:` + fmt.Sprintf("%v", this.ErrorMessage) + `,`, - `}`, - }, "") - return s -} -func (this *FailActualLRPRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FailActualLRPRequest{`, - `ActualLrpKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpKey), "ActualLRPKey", "ActualLRPKey", 1) + `,`, - `ErrorMessage:` + fmt.Sprintf("%v", this.ErrorMessage) + `,`, - `}`, - }, "") - return s -} -func (this *RetireActualLRPRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RetireActualLRPRequest{`, - `ActualLrpKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpKey), "ActualLRPKey", "ActualLRPKey", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveActualLRPRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveActualLRPRequest{`, - `ProcessGuid:` + fmt.Sprintf("%v", this.ProcessGuid) + `,`, - `Index:` + fmt.Sprintf("%v", this.Index) + `,`, - `ActualLrpInstanceKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpInstanceKey), "ActualLRPInstanceKey", "ActualLRPInstanceKey", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPsResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForActualLrps := "[]*ActualLRP{" - for _, f := range this.ActualLrps { - repeatedStringForActualLrps += strings.Replace(fmt.Sprintf("%v", f), "ActualLRP", "ActualLRP", 1) + "," - } - repeatedStringForActualLrps += "}" - s := strings.Join([]string{`&ActualLRPsResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `ActualLrps:` + repeatedStringForActualLrps + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPsRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPsRequest{`, - `Domain:` + fmt.Sprintf("%v", this.Domain) + `,`, - `CellId:` + fmt.Sprintf("%v", this.CellId) + `,`, - `ProcessGuid:` + fmt.Sprintf("%v", this.ProcessGuid) + `,`, - `OptionalIndex:` + fmt.Sprintf("%v", this.OptionalIndex) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPsRequest_Index) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPsRequest_Index{`, - `Index:` + fmt.Sprintf("%v", this.Index) + `,`, - `}`, - }, "") - return s -} -func valueToStringActualLrpRequests(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *ActualLRPLifecycleResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPLifecycleResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPLifecycleResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPGroupsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPGroupsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPGroupsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpGroups", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ActualLrpGroups = append(m.ActualLrpGroups, &ActualLRPGroup{}) - if err := m.ActualLrpGroups[len(m.ActualLrpGroups)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPGroupResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPGroupResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPGroupResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpGroup", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpGroup == nil { - m.ActualLrpGroup = &ActualLRPGroup{} - } - if err := m.ActualLrpGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPGroupsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPGroupsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPGroupsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CellId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CellId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPGroupsByProcessGuidRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPGroupsByProcessGuidRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPGroupsByProcessGuidRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPGroupByProcessGuidAndIndexRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPGroupByProcessGuidAndIndexRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPGroupByProcessGuidAndIndexRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ClaimActualLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ClaimActualLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClaimActualLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpInstanceKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpInstanceKey == nil { - m.ActualLrpInstanceKey = &ActualLRPInstanceKey{} - } - if err := m.ActualLrpInstanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StartActualLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StartActualLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StartActualLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpKey == nil { - m.ActualLrpKey = &ActualLRPKey{} - } - if err := m.ActualLrpKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpInstanceKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpInstanceKey == nil { - m.ActualLrpInstanceKey = &ActualLRPInstanceKey{} - } - if err := m.ActualLrpInstanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpNetInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpNetInfo == nil { - m.ActualLrpNetInfo = &ActualLRPNetInfo{} - } - if err := m.ActualLrpNetInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpInternalRoutes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ActualLrpInternalRoutes = append(m.ActualLrpInternalRoutes, &ActualLRPInternalRoute{}) - if err := m.ActualLrpInternalRoutes[len(m.ActualLrpInternalRoutes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricTags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MetricTags == nil { - m.MetricTags = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthActualLrpRequests - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthActualLrpRequests - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.MetricTags[mapkey] = mapvalue - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Routable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.OptionalRoutable = &StartActualLRPRequest_Routable{b} - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AvailabilityZone", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AvailabilityZone = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CrashActualLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CrashActualLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CrashActualLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpKey == nil { - m.ActualLrpKey = &ActualLRPKey{} - } - if err := m.ActualLrpKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpInstanceKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpInstanceKey == nil { - m.ActualLrpInstanceKey = &ActualLRPInstanceKey{} - } - if err := m.ActualLrpInstanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ErrorMessage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ErrorMessage = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FailActualLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FailActualLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FailActualLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpKey == nil { - m.ActualLrpKey = &ActualLRPKey{} - } - if err := m.ActualLrpKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ErrorMessage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ErrorMessage = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RetireActualLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RetireActualLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RetireActualLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpKey == nil { - m.ActualLrpKey = &ActualLRPKey{} - } - if err := m.ActualLrpKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveActualLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RemoveActualLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveActualLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpInstanceKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpInstanceKey == nil { - m.ActualLrpInstanceKey = &ActualLRPInstanceKey{} - } - if err := m.ActualLrpInstanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrps", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ActualLrps = append(m.ActualLrps, &ActualLRP{}) - if err := m.ActualLrps[len(m.ActualLrps)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CellId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CellId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthActualLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthActualLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.OptionalIndex = &ActualLRPsRequest_Index{v} - default: - iNdEx = preIndex - skippy, err := skipActualLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthActualLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipActualLrpRequests(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowActualLrpRequests - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthActualLrpRequests - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupActualLrpRequests - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthActualLrpRequests - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthActualLrpRequests = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowActualLrpRequests = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupActualLrpRequests = fmt.Errorf("proto: unexpected end of group") -) diff --git a/models/actual_lrp_requests.proto b/models/actual_lrp_requests.proto index 178d6127..62955aaf 100644 --- a/models/actual_lrp_requests.proto +++ b/models/actual_lrp_requests.proto @@ -1,94 +1,91 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; import "actual_lrp.proto"; import "error.proto"; -message ActualLRPLifecycleResponse { - Error error = 1; +message ProtoActualLRPLifecycleResponse { + ProtoError error = 1; } -message ActualLRPGroupsResponse { +message ProtoActualLRPGroupsResponse { option deprecated = true; - Error error = 1; - repeated ActualLRPGroup actual_lrp_groups = 2; + ProtoError error = 1; + repeated ProtoActualLRPGroup actual_lrp_groups = 2 [json_name = "actual_lrp_groups"]; } -message ActualLRPGroupResponse { +message ProtoActualLRPGroupResponse { option deprecated = true; - Error error = 1; - ActualLRPGroup actual_lrp_group = 2; + ProtoError error = 1; + ProtoActualLRPGroup actual_lrp_group = 2 [json_name = "actual_lrp_group"]; } -message ActualLRPGroupsRequest { +message ProtoActualLRPGroupsRequest { option deprecated = true; - string domain = 1 [(gogoproto.jsontag) = "domain"]; - string cell_id = 2 [(gogoproto.jsontag) = "cell_id"]; + string domain = 1 [json_name = "domain", (bbs.bbs_json_always_emit) = true]; + string cell_id = 2 [json_name = "cell_id", (bbs.bbs_json_always_emit) = true]; } -message ActualLRPGroupsByProcessGuidRequest { +message ProtoActualLRPGroupsByProcessGuidRequest { option deprecated = true; - string process_guid = 1 [(gogoproto.jsontag) = "process_guid"]; + string process_guid = 1 [json_name = "process_guid", (bbs.bbs_json_always_emit) = true]; } -message ActualLRPGroupByProcessGuidAndIndexRequest { +message ProtoActualLRPGroupByProcessGuidAndIndexRequest { option deprecated = true; - string process_guid = 1 [(gogoproto.jsontag) = "process_guid"]; - int32 index = 2 [(gogoproto.jsontag) = "index"]; + string process_guid = 1 [json_name = "process_guid", (bbs.bbs_json_always_emit) = true]; + int32 index = 2 [json_name = "index", (bbs.bbs_json_always_emit) = true]; } -message ClaimActualLRPRequest { - string process_guid = 1 [(gogoproto.jsontag) = "process_guid"]; - int32 index = 2 [(gogoproto.jsontag) = "index"]; - ActualLRPInstanceKey actual_lrp_instance_key = 3; +message ProtoClaimActualLRPRequest { + string process_guid = 1 [json_name = "process_guid", (bbs.bbs_json_always_emit) = true]; + int32 index = 2 [json_name = "index", (bbs.bbs_json_always_emit) = true]; + ProtoActualLRPInstanceKey actual_lrp_instance_key = 3 [json_name = "actual_lrp_instance_key"]; } -message StartActualLRPRequest { - ActualLRPKey actual_lrp_key = 1; - ActualLRPInstanceKey actual_lrp_instance_key = 2; - ActualLRPNetInfo actual_lrp_net_info = 3; - repeated ActualLRPInternalRoute actual_lrp_internal_routes = 4; - map metric_tags = 5; - oneof optional_routable { - bool Routable = 6; - } - string availability_zone = 7 [(gogoproto.jsontag)= "availability_zone"]; +message ProtoStartActualLRPRequest { + ProtoActualLRPKey actual_lrp_key = 1 [json_name = "actual_lrp_key"]; + ProtoActualLRPInstanceKey actual_lrp_instance_key = 2 [json_name = "actual_lrp_instance_key"]; + ProtoActualLRPNetInfo actual_lrp_net_info = 3 [json_name = "actual_lrp_net_info"]; + repeated ProtoActualLRPInternalRoute actual_lrp_internal_routes = 4 [json_name = "actual_lrp_internal_routes"]; + map metric_tags = 5 [json_name = "metric_tags"]; + optional bool Routable = 6; + string availability_zone = 7 [json_name= "availability_zone", (bbs.bbs_json_always_emit) = true]; } -message CrashActualLRPRequest { - ActualLRPKey actual_lrp_key = 1; - ActualLRPInstanceKey actual_lrp_instance_key = 2; - string error_message = 3 [(gogoproto.jsontag) = "error_message"]; +message ProtoCrashActualLRPRequest { + ProtoActualLRPKey actual_lrp_key = 1 [json_name = "actual_lrp_key"]; + ProtoActualLRPInstanceKey actual_lrp_instance_key = 2 [json_name = "actual_lrp_instance_key"]; + string error_message = 3 [json_name = "error_message", (bbs.bbs_json_always_emit) = true]; } -message FailActualLRPRequest { - ActualLRPKey actual_lrp_key = 1; - string error_message = 2 [(gogoproto.jsontag) = "error_message"]; +message ProtoFailActualLRPRequest { + ProtoActualLRPKey actual_lrp_key = 1 [json_name = "actual_lrp_key"]; + string error_message = 2 [json_name = "error_message", (bbs.bbs_json_always_emit) = true]; } -message RetireActualLRPRequest { - ActualLRPKey actual_lrp_key = 1; +message ProtoRetireActualLRPRequest { + ProtoActualLRPKey actual_lrp_key = 1 [json_name = "actual_lrp_key"]; } -message RemoveActualLRPRequest { - string process_guid = 1 [(gogoproto.jsontag) = "process_guid"]; - int32 index = 2 [(gogoproto.jsontag) = "index"]; - ActualLRPInstanceKey actual_lrp_instance_key = 3; +message ProtoRemoveActualLRPRequest { + string process_guid = 1 [json_name = "process_guid", (bbs.bbs_json_always_emit) = true]; + int32 index = 2 [json_name = "index", (bbs.bbs_json_always_emit) = true]; + ProtoActualLRPInstanceKey actual_lrp_instance_key = 3 [json_name = "actual_lrp_instance_key"]; } -message ActualLRPsResponse { - Error error = 1; - repeated ActualLRP actual_lrps = 2; +message ProtoActualLRPsResponse { + ProtoError error = 1; + repeated ProtoActualLRP actual_lrps = 2 [json_name = "actual_lrps"]; } -message ActualLRPsRequest { - string domain = 1 [(gogoproto.jsontag) = "domain"]; - string cell_id = 2 [(gogoproto.jsontag) = "cell_id"]; - string process_guid = 3 [(gogoproto.jsontag) = "process_guid"]; - oneof optional_index { - int32 index = 4 [(gogoproto.jsontag) = "index"]; - } +message ProtoActualLRPsRequest { + string domain = 1 [json_name = "domain", (bbs.bbs_json_always_emit) = true]; + string cell_id = 2 [json_name = "cell_id", (bbs.bbs_json_always_emit) = true]; + string process_guid = 3 [json_name = "process_guid", (bbs.bbs_json_always_emit) = true]; + optional int32 index = 4 [json_name = "index", (bbs.bbs_json_always_emit) = true]; } diff --git a/models/actual_lrp_requests_bbs.pb.go b/models/actual_lrp_requests_bbs.pb.go new file mode 100644 index 00000000..f407513d --- /dev/null +++ b/models/actual_lrp_requests_bbs.pb.go @@ -0,0 +1,1727 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: actual_lrp_requests.proto + +package models + +// Prevent copylock errors when using ProtoActualLRPLifecycleResponse directly +type ActualLRPLifecycleResponse struct { + Error *Error `json:"error,omitempty"` +} + +func (this *ActualLRPLifecycleResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPLifecycleResponse) + if !ok { + that2, ok := that.(ActualLRPLifecycleResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + return true +} +func (m *ActualLRPLifecycleResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *ActualLRPLifecycleResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (x *ActualLRPLifecycleResponse) ToProto() *ProtoActualLRPLifecycleResponse { + if x == nil { + return nil + } + + proto := &ProtoActualLRPLifecycleResponse{ + Error: x.Error.ToProto(), + } + return proto +} + +func (x *ProtoActualLRPLifecycleResponse) FromProto() *ActualLRPLifecycleResponse { + if x == nil { + return nil + } + + copysafe := &ActualLRPLifecycleResponse{ + Error: x.Error.FromProto(), + } + return copysafe +} + +func ActualLRPLifecycleResponseToProtoSlice(values []*ActualLRPLifecycleResponse) []*ProtoActualLRPLifecycleResponse { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPLifecycleResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPLifecycleResponseFromProtoSlice(values []*ProtoActualLRPLifecycleResponse) []*ActualLRPLifecycleResponse { + if values == nil { + return nil + } + result := make([]*ActualLRPLifecycleResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Deprecated: marked deprecated in actual_lrp_requests.proto +// Prevent copylock errors when using ProtoActualLRPGroupsResponse directly +type ActualLRPGroupsResponse struct { + Error *Error `json:"error,omitempty"` + ActualLrpGroups []*ActualLRPGroup `json:"actual_lrp_groups,omitempty"` +} + +func (this *ActualLRPGroupsResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPGroupsResponse) + if !ok { + that2, ok := that.(ActualLRPGroupsResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + if this.ActualLrpGroups == nil { + if that1.ActualLrpGroups != nil { + return false + } + } else if len(this.ActualLrpGroups) != len(that1.ActualLrpGroups) { + return false + } + for i := range this.ActualLrpGroups { + if !this.ActualLrpGroups[i].Equal(that1.ActualLrpGroups[i]) { + return false + } + } + return true +} +func (m *ActualLRPGroupsResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *ActualLRPGroupsResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (m *ActualLRPGroupsResponse) GetActualLrpGroups() []*ActualLRPGroup { + if m != nil { + return m.ActualLrpGroups + } + return nil +} +func (m *ActualLRPGroupsResponse) SetActualLrpGroups(value []*ActualLRPGroup) { + if m != nil { + m.ActualLrpGroups = value + } +} +func (x *ActualLRPGroupsResponse) ToProto() *ProtoActualLRPGroupsResponse { + if x == nil { + return nil + } + + proto := &ProtoActualLRPGroupsResponse{ + Error: x.Error.ToProto(), + ActualLrpGroups: ActualLRPGroupToProtoSlice(x.ActualLrpGroups), + } + return proto +} + +func (x *ProtoActualLRPGroupsResponse) FromProto() *ActualLRPGroupsResponse { + if x == nil { + return nil + } + + copysafe := &ActualLRPGroupsResponse{ + Error: x.Error.FromProto(), + ActualLrpGroups: ActualLRPGroupFromProtoSlice(x.ActualLrpGroups), + } + return copysafe +} + +func ActualLRPGroupsResponseToProtoSlice(values []*ActualLRPGroupsResponse) []*ProtoActualLRPGroupsResponse { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPGroupsResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPGroupsResponseFromProtoSlice(values []*ProtoActualLRPGroupsResponse) []*ActualLRPGroupsResponse { + if values == nil { + return nil + } + result := make([]*ActualLRPGroupsResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Deprecated: marked deprecated in actual_lrp_requests.proto +// Prevent copylock errors when using ProtoActualLRPGroupResponse directly +type ActualLRPGroupResponse struct { + Error *Error `json:"error,omitempty"` + ActualLrpGroup *ActualLRPGroup `json:"actual_lrp_group,omitempty"` +} + +func (this *ActualLRPGroupResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPGroupResponse) + if !ok { + that2, ok := that.(ActualLRPGroupResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + if this.ActualLrpGroup == nil { + if that1.ActualLrpGroup != nil { + return false + } + } else if !this.ActualLrpGroup.Equal(*that1.ActualLrpGroup) { + return false + } + return true +} +func (m *ActualLRPGroupResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *ActualLRPGroupResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (m *ActualLRPGroupResponse) GetActualLrpGroup() *ActualLRPGroup { + if m != nil { + return m.ActualLrpGroup + } + return nil +} +func (m *ActualLRPGroupResponse) SetActualLrpGroup(value *ActualLRPGroup) { + if m != nil { + m.ActualLrpGroup = value + } +} +func (x *ActualLRPGroupResponse) ToProto() *ProtoActualLRPGroupResponse { + if x == nil { + return nil + } + + proto := &ProtoActualLRPGroupResponse{ + Error: x.Error.ToProto(), + ActualLrpGroup: x.ActualLrpGroup.ToProto(), + } + return proto +} + +func (x *ProtoActualLRPGroupResponse) FromProto() *ActualLRPGroupResponse { + if x == nil { + return nil + } + + copysafe := &ActualLRPGroupResponse{ + Error: x.Error.FromProto(), + ActualLrpGroup: x.ActualLrpGroup.FromProto(), + } + return copysafe +} + +func ActualLRPGroupResponseToProtoSlice(values []*ActualLRPGroupResponse) []*ProtoActualLRPGroupResponse { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPGroupResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPGroupResponseFromProtoSlice(values []*ProtoActualLRPGroupResponse) []*ActualLRPGroupResponse { + if values == nil { + return nil + } + result := make([]*ActualLRPGroupResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Deprecated: marked deprecated in actual_lrp_requests.proto +// Prevent copylock errors when using ProtoActualLRPGroupsRequest directly +type ActualLRPGroupsRequest struct { + Domain string `json:"domain"` + CellId string `json:"cell_id"` +} + +func (this *ActualLRPGroupsRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPGroupsRequest) + if !ok { + that2, ok := that.(ActualLRPGroupsRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Domain != that1.Domain { + return false + } + if this.CellId != that1.CellId { + return false + } + return true +} +func (m *ActualLRPGroupsRequest) GetDomain() string { + if m != nil { + return m.Domain + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPGroupsRequest) SetDomain(value string) { + if m != nil { + m.Domain = value + } +} +func (m *ActualLRPGroupsRequest) GetCellId() string { + if m != nil { + return m.CellId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPGroupsRequest) SetCellId(value string) { + if m != nil { + m.CellId = value + } +} +func (x *ActualLRPGroupsRequest) ToProto() *ProtoActualLRPGroupsRequest { + if x == nil { + return nil + } + + proto := &ProtoActualLRPGroupsRequest{ + Domain: x.Domain, + CellId: x.CellId, + } + return proto +} + +func (x *ProtoActualLRPGroupsRequest) FromProto() *ActualLRPGroupsRequest { + if x == nil { + return nil + } + + copysafe := &ActualLRPGroupsRequest{ + Domain: x.Domain, + CellId: x.CellId, + } + return copysafe +} + +func ActualLRPGroupsRequestToProtoSlice(values []*ActualLRPGroupsRequest) []*ProtoActualLRPGroupsRequest { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPGroupsRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPGroupsRequestFromProtoSlice(values []*ProtoActualLRPGroupsRequest) []*ActualLRPGroupsRequest { + if values == nil { + return nil + } + result := make([]*ActualLRPGroupsRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Deprecated: marked deprecated in actual_lrp_requests.proto +// Prevent copylock errors when using ProtoActualLRPGroupsByProcessGuidRequest directly +type ActualLRPGroupsByProcessGuidRequest struct { + ProcessGuid string `json:"process_guid"` +} + +func (this *ActualLRPGroupsByProcessGuidRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPGroupsByProcessGuidRequest) + if !ok { + that2, ok := that.(ActualLRPGroupsByProcessGuidRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ProcessGuid != that1.ProcessGuid { + return false + } + return true +} +func (m *ActualLRPGroupsByProcessGuidRequest) GetProcessGuid() string { + if m != nil { + return m.ProcessGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPGroupsByProcessGuidRequest) SetProcessGuid(value string) { + if m != nil { + m.ProcessGuid = value + } +} +func (x *ActualLRPGroupsByProcessGuidRequest) ToProto() *ProtoActualLRPGroupsByProcessGuidRequest { + if x == nil { + return nil + } + + proto := &ProtoActualLRPGroupsByProcessGuidRequest{ + ProcessGuid: x.ProcessGuid, + } + return proto +} + +func (x *ProtoActualLRPGroupsByProcessGuidRequest) FromProto() *ActualLRPGroupsByProcessGuidRequest { + if x == nil { + return nil + } + + copysafe := &ActualLRPGroupsByProcessGuidRequest{ + ProcessGuid: x.ProcessGuid, + } + return copysafe +} + +func ActualLRPGroupsByProcessGuidRequestToProtoSlice(values []*ActualLRPGroupsByProcessGuidRequest) []*ProtoActualLRPGroupsByProcessGuidRequest { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPGroupsByProcessGuidRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPGroupsByProcessGuidRequestFromProtoSlice(values []*ProtoActualLRPGroupsByProcessGuidRequest) []*ActualLRPGroupsByProcessGuidRequest { + if values == nil { + return nil + } + result := make([]*ActualLRPGroupsByProcessGuidRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Deprecated: marked deprecated in actual_lrp_requests.proto +// Prevent copylock errors when using ProtoActualLRPGroupByProcessGuidAndIndexRequest directly +type ActualLRPGroupByProcessGuidAndIndexRequest struct { + ProcessGuid string `json:"process_guid"` + Index int32 `json:"index"` +} + +func (this *ActualLRPGroupByProcessGuidAndIndexRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPGroupByProcessGuidAndIndexRequest) + if !ok { + that2, ok := that.(ActualLRPGroupByProcessGuidAndIndexRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ProcessGuid != that1.ProcessGuid { + return false + } + if this.Index != that1.Index { + return false + } + return true +} +func (m *ActualLRPGroupByProcessGuidAndIndexRequest) GetProcessGuid() string { + if m != nil { + return m.ProcessGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPGroupByProcessGuidAndIndexRequest) SetProcessGuid(value string) { + if m != nil { + m.ProcessGuid = value + } +} +func (m *ActualLRPGroupByProcessGuidAndIndexRequest) GetIndex() int32 { + if m != nil { + return m.Index + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *ActualLRPGroupByProcessGuidAndIndexRequest) SetIndex(value int32) { + if m != nil { + m.Index = value + } +} +func (x *ActualLRPGroupByProcessGuidAndIndexRequest) ToProto() *ProtoActualLRPGroupByProcessGuidAndIndexRequest { + if x == nil { + return nil + } + + proto := &ProtoActualLRPGroupByProcessGuidAndIndexRequest{ + ProcessGuid: x.ProcessGuid, + Index: x.Index, + } + return proto +} + +func (x *ProtoActualLRPGroupByProcessGuidAndIndexRequest) FromProto() *ActualLRPGroupByProcessGuidAndIndexRequest { + if x == nil { + return nil + } + + copysafe := &ActualLRPGroupByProcessGuidAndIndexRequest{ + ProcessGuid: x.ProcessGuid, + Index: x.Index, + } + return copysafe +} + +func ActualLRPGroupByProcessGuidAndIndexRequestToProtoSlice(values []*ActualLRPGroupByProcessGuidAndIndexRequest) []*ProtoActualLRPGroupByProcessGuidAndIndexRequest { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPGroupByProcessGuidAndIndexRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPGroupByProcessGuidAndIndexRequestFromProtoSlice(values []*ProtoActualLRPGroupByProcessGuidAndIndexRequest) []*ActualLRPGroupByProcessGuidAndIndexRequest { + if values == nil { + return nil + } + result := make([]*ActualLRPGroupByProcessGuidAndIndexRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoClaimActualLRPRequest directly +type ClaimActualLRPRequest struct { + ProcessGuid string `json:"process_guid"` + Index int32 `json:"index"` + ActualLrpInstanceKey *ActualLRPInstanceKey `json:"actual_lrp_instance_key,omitempty"` +} + +func (this *ClaimActualLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ClaimActualLRPRequest) + if !ok { + that2, ok := that.(ClaimActualLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ProcessGuid != that1.ProcessGuid { + return false + } + if this.Index != that1.Index { + return false + } + if this.ActualLrpInstanceKey == nil { + if that1.ActualLrpInstanceKey != nil { + return false + } + } else if !this.ActualLrpInstanceKey.Equal(*that1.ActualLrpInstanceKey) { + return false + } + return true +} +func (m *ClaimActualLRPRequest) GetProcessGuid() string { + if m != nil { + return m.ProcessGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ClaimActualLRPRequest) SetProcessGuid(value string) { + if m != nil { + m.ProcessGuid = value + } +} +func (m *ClaimActualLRPRequest) GetIndex() int32 { + if m != nil { + return m.Index + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *ClaimActualLRPRequest) SetIndex(value int32) { + if m != nil { + m.Index = value + } +} +func (m *ClaimActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { + if m != nil { + return m.ActualLrpInstanceKey + } + return nil +} +func (m *ClaimActualLRPRequest) SetActualLrpInstanceKey(value *ActualLRPInstanceKey) { + if m != nil { + m.ActualLrpInstanceKey = value + } +} +func (x *ClaimActualLRPRequest) ToProto() *ProtoClaimActualLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoClaimActualLRPRequest{ + ProcessGuid: x.ProcessGuid, + Index: x.Index, + ActualLrpInstanceKey: x.ActualLrpInstanceKey.ToProto(), + } + return proto +} + +func (x *ProtoClaimActualLRPRequest) FromProto() *ClaimActualLRPRequest { + if x == nil { + return nil + } + + copysafe := &ClaimActualLRPRequest{ + ProcessGuid: x.ProcessGuid, + Index: x.Index, + ActualLrpInstanceKey: x.ActualLrpInstanceKey.FromProto(), + } + return copysafe +} + +func ClaimActualLRPRequestToProtoSlice(values []*ClaimActualLRPRequest) []*ProtoClaimActualLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoClaimActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ClaimActualLRPRequestFromProtoSlice(values []*ProtoClaimActualLRPRequest) []*ClaimActualLRPRequest { + if values == nil { + return nil + } + result := make([]*ClaimActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoStartActualLRPRequest directly +type StartActualLRPRequest struct { + ActualLrpKey *ActualLRPKey `json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ActualLRPInstanceKey `json:"actual_lrp_instance_key,omitempty"` + ActualLrpNetInfo *ActualLRPNetInfo `json:"actual_lrp_net_info,omitempty"` + ActualLrpInternalRoutes []*ActualLRPInternalRoute `json:"actual_lrp_internal_routes,omitempty"` + MetricTags map[string]string `json:"metric_tags,omitempty"` + Routable *bool `json:"Routable,omitempty"` + AvailabilityZone string `json:"availability_zone"` +} + +func (this *StartActualLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*StartActualLRPRequest) + if !ok { + that2, ok := that.(StartActualLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ActualLrpKey == nil { + if that1.ActualLrpKey != nil { + return false + } + } else if !this.ActualLrpKey.Equal(*that1.ActualLrpKey) { + return false + } + if this.ActualLrpInstanceKey == nil { + if that1.ActualLrpInstanceKey != nil { + return false + } + } else if !this.ActualLrpInstanceKey.Equal(*that1.ActualLrpInstanceKey) { + return false + } + if this.ActualLrpNetInfo == nil { + if that1.ActualLrpNetInfo != nil { + return false + } + } else if !this.ActualLrpNetInfo.Equal(*that1.ActualLrpNetInfo) { + return false + } + if this.ActualLrpInternalRoutes == nil { + if that1.ActualLrpInternalRoutes != nil { + return false + } + } else if len(this.ActualLrpInternalRoutes) != len(that1.ActualLrpInternalRoutes) { + return false + } + for i := range this.ActualLrpInternalRoutes { + if !this.ActualLrpInternalRoutes[i].Equal(that1.ActualLrpInternalRoutes[i]) { + return false + } + } + if this.MetricTags == nil { + if that1.MetricTags != nil { + return false + } + } else if len(this.MetricTags) != len(that1.MetricTags) { + return false + } + for i := range this.MetricTags { + if this.MetricTags[i] != that1.MetricTags[i] { + return false + } + } + if this.Routable == nil { + if that1.Routable != nil { + return false + } + } else if *this.Routable != *that1.Routable { + return false + } + if this.AvailabilityZone != that1.AvailabilityZone { + return false + } + return true +} +func (m *StartActualLRPRequest) GetActualLrpKey() *ActualLRPKey { + if m != nil { + return m.ActualLrpKey + } + return nil +} +func (m *StartActualLRPRequest) SetActualLrpKey(value *ActualLRPKey) { + if m != nil { + m.ActualLrpKey = value + } +} +func (m *StartActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { + if m != nil { + return m.ActualLrpInstanceKey + } + return nil +} +func (m *StartActualLRPRequest) SetActualLrpInstanceKey(value *ActualLRPInstanceKey) { + if m != nil { + m.ActualLrpInstanceKey = value + } +} +func (m *StartActualLRPRequest) GetActualLrpNetInfo() *ActualLRPNetInfo { + if m != nil { + return m.ActualLrpNetInfo + } + return nil +} +func (m *StartActualLRPRequest) SetActualLrpNetInfo(value *ActualLRPNetInfo) { + if m != nil { + m.ActualLrpNetInfo = value + } +} +func (m *StartActualLRPRequest) GetActualLrpInternalRoutes() []*ActualLRPInternalRoute { + if m != nil { + return m.ActualLrpInternalRoutes + } + return nil +} +func (m *StartActualLRPRequest) SetActualLrpInternalRoutes(value []*ActualLRPInternalRoute) { + if m != nil { + m.ActualLrpInternalRoutes = value + } +} +func (m *StartActualLRPRequest) GetMetricTags() map[string]string { + if m != nil { + return m.MetricTags + } + return nil +} +func (m *StartActualLRPRequest) SetMetricTags(value map[string]string) { + if m != nil { + m.MetricTags = value + } +} +func (m *StartActualLRPRequest) RoutableExists() bool { + return m != nil && m.Routable != nil +} +func (m *StartActualLRPRequest) GetRoutable() *bool { + if m != nil && m.Routable != nil { + return m.Routable + } + var defaultValue bool + defaultValue = false + return &defaultValue +} +func (m *StartActualLRPRequest) SetRoutable(value *bool) { + if m != nil { + m.Routable = value + } +} +func (m *StartActualLRPRequest) GetAvailabilityZone() string { + if m != nil { + return m.AvailabilityZone + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *StartActualLRPRequest) SetAvailabilityZone(value string) { + if m != nil { + m.AvailabilityZone = value + } +} +func (x *StartActualLRPRequest) ToProto() *ProtoStartActualLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoStartActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.ToProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.ToProto(), + ActualLrpNetInfo: x.ActualLrpNetInfo.ToProto(), + ActualLrpInternalRoutes: ActualLRPInternalRouteToProtoSlice(x.ActualLrpInternalRoutes), + MetricTags: x.MetricTags, + Routable: x.Routable, + AvailabilityZone: x.AvailabilityZone, + } + return proto +} + +func (x *ProtoStartActualLRPRequest) FromProto() *StartActualLRPRequest { + if x == nil { + return nil + } + + copysafe := &StartActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.FromProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.FromProto(), + ActualLrpNetInfo: x.ActualLrpNetInfo.FromProto(), + ActualLrpInternalRoutes: ActualLRPInternalRouteFromProtoSlice(x.ActualLrpInternalRoutes), + MetricTags: x.MetricTags, + Routable: x.Routable, + AvailabilityZone: x.AvailabilityZone, + } + return copysafe +} + +func StartActualLRPRequestToProtoSlice(values []*StartActualLRPRequest) []*ProtoStartActualLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoStartActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func StartActualLRPRequestFromProtoSlice(values []*ProtoStartActualLRPRequest) []*StartActualLRPRequest { + if values == nil { + return nil + } + result := make([]*StartActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoCrashActualLRPRequest directly +type CrashActualLRPRequest struct { + ActualLrpKey *ActualLRPKey `json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ActualLRPInstanceKey `json:"actual_lrp_instance_key,omitempty"` + ErrorMessage string `json:"error_message"` +} + +func (this *CrashActualLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*CrashActualLRPRequest) + if !ok { + that2, ok := that.(CrashActualLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ActualLrpKey == nil { + if that1.ActualLrpKey != nil { + return false + } + } else if !this.ActualLrpKey.Equal(*that1.ActualLrpKey) { + return false + } + if this.ActualLrpInstanceKey == nil { + if that1.ActualLrpInstanceKey != nil { + return false + } + } else if !this.ActualLrpInstanceKey.Equal(*that1.ActualLrpInstanceKey) { + return false + } + if this.ErrorMessage != that1.ErrorMessage { + return false + } + return true +} +func (m *CrashActualLRPRequest) GetActualLrpKey() *ActualLRPKey { + if m != nil { + return m.ActualLrpKey + } + return nil +} +func (m *CrashActualLRPRequest) SetActualLrpKey(value *ActualLRPKey) { + if m != nil { + m.ActualLrpKey = value + } +} +func (m *CrashActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { + if m != nil { + return m.ActualLrpInstanceKey + } + return nil +} +func (m *CrashActualLRPRequest) SetActualLrpInstanceKey(value *ActualLRPInstanceKey) { + if m != nil { + m.ActualLrpInstanceKey = value + } +} +func (m *CrashActualLRPRequest) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CrashActualLRPRequest) SetErrorMessage(value string) { + if m != nil { + m.ErrorMessage = value + } +} +func (x *CrashActualLRPRequest) ToProto() *ProtoCrashActualLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoCrashActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.ToProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.ToProto(), + ErrorMessage: x.ErrorMessage, + } + return proto +} + +func (x *ProtoCrashActualLRPRequest) FromProto() *CrashActualLRPRequest { + if x == nil { + return nil + } + + copysafe := &CrashActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.FromProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.FromProto(), + ErrorMessage: x.ErrorMessage, + } + return copysafe +} + +func CrashActualLRPRequestToProtoSlice(values []*CrashActualLRPRequest) []*ProtoCrashActualLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoCrashActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func CrashActualLRPRequestFromProtoSlice(values []*ProtoCrashActualLRPRequest) []*CrashActualLRPRequest { + if values == nil { + return nil + } + result := make([]*CrashActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoFailActualLRPRequest directly +type FailActualLRPRequest struct { + ActualLrpKey *ActualLRPKey `json:"actual_lrp_key,omitempty"` + ErrorMessage string `json:"error_message"` +} + +func (this *FailActualLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*FailActualLRPRequest) + if !ok { + that2, ok := that.(FailActualLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ActualLrpKey == nil { + if that1.ActualLrpKey != nil { + return false + } + } else if !this.ActualLrpKey.Equal(*that1.ActualLrpKey) { + return false + } + if this.ErrorMessage != that1.ErrorMessage { + return false + } + return true +} +func (m *FailActualLRPRequest) GetActualLrpKey() *ActualLRPKey { + if m != nil { + return m.ActualLrpKey + } + return nil +} +func (m *FailActualLRPRequest) SetActualLrpKey(value *ActualLRPKey) { + if m != nil { + m.ActualLrpKey = value + } +} +func (m *FailActualLRPRequest) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *FailActualLRPRequest) SetErrorMessage(value string) { + if m != nil { + m.ErrorMessage = value + } +} +func (x *FailActualLRPRequest) ToProto() *ProtoFailActualLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoFailActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.ToProto(), + ErrorMessage: x.ErrorMessage, + } + return proto +} + +func (x *ProtoFailActualLRPRequest) FromProto() *FailActualLRPRequest { + if x == nil { + return nil + } + + copysafe := &FailActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.FromProto(), + ErrorMessage: x.ErrorMessage, + } + return copysafe +} + +func FailActualLRPRequestToProtoSlice(values []*FailActualLRPRequest) []*ProtoFailActualLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoFailActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func FailActualLRPRequestFromProtoSlice(values []*ProtoFailActualLRPRequest) []*FailActualLRPRequest { + if values == nil { + return nil + } + result := make([]*FailActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoRetireActualLRPRequest directly +type RetireActualLRPRequest struct { + ActualLrpKey *ActualLRPKey `json:"actual_lrp_key,omitempty"` +} + +func (this *RetireActualLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*RetireActualLRPRequest) + if !ok { + that2, ok := that.(RetireActualLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ActualLrpKey == nil { + if that1.ActualLrpKey != nil { + return false + } + } else if !this.ActualLrpKey.Equal(*that1.ActualLrpKey) { + return false + } + return true +} +func (m *RetireActualLRPRequest) GetActualLrpKey() *ActualLRPKey { + if m != nil { + return m.ActualLrpKey + } + return nil +} +func (m *RetireActualLRPRequest) SetActualLrpKey(value *ActualLRPKey) { + if m != nil { + m.ActualLrpKey = value + } +} +func (x *RetireActualLRPRequest) ToProto() *ProtoRetireActualLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoRetireActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.ToProto(), + } + return proto +} + +func (x *ProtoRetireActualLRPRequest) FromProto() *RetireActualLRPRequest { + if x == nil { + return nil + } + + copysafe := &RetireActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.FromProto(), + } + return copysafe +} + +func RetireActualLRPRequestToProtoSlice(values []*RetireActualLRPRequest) []*ProtoRetireActualLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoRetireActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func RetireActualLRPRequestFromProtoSlice(values []*ProtoRetireActualLRPRequest) []*RetireActualLRPRequest { + if values == nil { + return nil + } + result := make([]*RetireActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoRemoveActualLRPRequest directly +type RemoveActualLRPRequest struct { + ProcessGuid string `json:"process_guid"` + Index int32 `json:"index"` + ActualLrpInstanceKey *ActualLRPInstanceKey `json:"actual_lrp_instance_key,omitempty"` +} + +func (this *RemoveActualLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*RemoveActualLRPRequest) + if !ok { + that2, ok := that.(RemoveActualLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ProcessGuid != that1.ProcessGuid { + return false + } + if this.Index != that1.Index { + return false + } + if this.ActualLrpInstanceKey == nil { + if that1.ActualLrpInstanceKey != nil { + return false + } + } else if !this.ActualLrpInstanceKey.Equal(*that1.ActualLrpInstanceKey) { + return false + } + return true +} +func (m *RemoveActualLRPRequest) GetProcessGuid() string { + if m != nil { + return m.ProcessGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *RemoveActualLRPRequest) SetProcessGuid(value string) { + if m != nil { + m.ProcessGuid = value + } +} +func (m *RemoveActualLRPRequest) GetIndex() int32 { + if m != nil { + return m.Index + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *RemoveActualLRPRequest) SetIndex(value int32) { + if m != nil { + m.Index = value + } +} +func (m *RemoveActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { + if m != nil { + return m.ActualLrpInstanceKey + } + return nil +} +func (m *RemoveActualLRPRequest) SetActualLrpInstanceKey(value *ActualLRPInstanceKey) { + if m != nil { + m.ActualLrpInstanceKey = value + } +} +func (x *RemoveActualLRPRequest) ToProto() *ProtoRemoveActualLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoRemoveActualLRPRequest{ + ProcessGuid: x.ProcessGuid, + Index: x.Index, + ActualLrpInstanceKey: x.ActualLrpInstanceKey.ToProto(), + } + return proto +} + +func (x *ProtoRemoveActualLRPRequest) FromProto() *RemoveActualLRPRequest { + if x == nil { + return nil + } + + copysafe := &RemoveActualLRPRequest{ + ProcessGuid: x.ProcessGuid, + Index: x.Index, + ActualLrpInstanceKey: x.ActualLrpInstanceKey.FromProto(), + } + return copysafe +} + +func RemoveActualLRPRequestToProtoSlice(values []*RemoveActualLRPRequest) []*ProtoRemoveActualLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoRemoveActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func RemoveActualLRPRequestFromProtoSlice(values []*ProtoRemoveActualLRPRequest) []*RemoveActualLRPRequest { + if values == nil { + return nil + } + result := make([]*RemoveActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoActualLRPsResponse directly +type ActualLRPsResponse struct { + Error *Error `json:"error,omitempty"` + ActualLrps []*ActualLRP `json:"actual_lrps,omitempty"` +} + +func (this *ActualLRPsResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPsResponse) + if !ok { + that2, ok := that.(ActualLRPsResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + if this.ActualLrps == nil { + if that1.ActualLrps != nil { + return false + } + } else if len(this.ActualLrps) != len(that1.ActualLrps) { + return false + } + for i := range this.ActualLrps { + if !this.ActualLrps[i].Equal(that1.ActualLrps[i]) { + return false + } + } + return true +} +func (m *ActualLRPsResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *ActualLRPsResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (m *ActualLRPsResponse) GetActualLrps() []*ActualLRP { + if m != nil { + return m.ActualLrps + } + return nil +} +func (m *ActualLRPsResponse) SetActualLrps(value []*ActualLRP) { + if m != nil { + m.ActualLrps = value + } +} +func (x *ActualLRPsResponse) ToProto() *ProtoActualLRPsResponse { + if x == nil { + return nil + } + + proto := &ProtoActualLRPsResponse{ + Error: x.Error.ToProto(), + ActualLrps: ActualLRPToProtoSlice(x.ActualLrps), + } + return proto +} + +func (x *ProtoActualLRPsResponse) FromProto() *ActualLRPsResponse { + if x == nil { + return nil + } + + copysafe := &ActualLRPsResponse{ + Error: x.Error.FromProto(), + ActualLrps: ActualLRPFromProtoSlice(x.ActualLrps), + } + return copysafe +} + +func ActualLRPsResponseToProtoSlice(values []*ActualLRPsResponse) []*ProtoActualLRPsResponse { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPsResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPsResponseFromProtoSlice(values []*ProtoActualLRPsResponse) []*ActualLRPsResponse { + if values == nil { + return nil + } + result := make([]*ActualLRPsResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoActualLRPsRequest directly +type ActualLRPsRequest struct { + Domain string `json:"domain"` + CellId string `json:"cell_id"` + ProcessGuid string `json:"process_guid"` + Index *int32 `json:"index"` +} + +func (this *ActualLRPsRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPsRequest) + if !ok { + that2, ok := that.(ActualLRPsRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Domain != that1.Domain { + return false + } + if this.CellId != that1.CellId { + return false + } + if this.ProcessGuid != that1.ProcessGuid { + return false + } + if this.Index == nil { + if that1.Index != nil { + return false + } + } else if *this.Index != *that1.Index { + return false + } + return true +} +func (m *ActualLRPsRequest) GetDomain() string { + if m != nil { + return m.Domain + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPsRequest) SetDomain(value string) { + if m != nil { + m.Domain = value + } +} +func (m *ActualLRPsRequest) GetCellId() string { + if m != nil { + return m.CellId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPsRequest) SetCellId(value string) { + if m != nil { + m.CellId = value + } +} +func (m *ActualLRPsRequest) GetProcessGuid() string { + if m != nil { + return m.ProcessGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPsRequest) SetProcessGuid(value string) { + if m != nil { + m.ProcessGuid = value + } +} +func (m *ActualLRPsRequest) IndexExists() bool { + return m != nil && m.Index != nil +} +func (m *ActualLRPsRequest) GetIndex() *int32 { + if m != nil && m.Index != nil { + return m.Index + } + var defaultValue int32 + defaultValue = 0 + return &defaultValue +} +func (m *ActualLRPsRequest) SetIndex(value *int32) { + if m != nil { + m.Index = value + } +} +func (x *ActualLRPsRequest) ToProto() *ProtoActualLRPsRequest { + if x == nil { + return nil + } + + proto := &ProtoActualLRPsRequest{ + Domain: x.Domain, + CellId: x.CellId, + ProcessGuid: x.ProcessGuid, + Index: x.Index, + } + return proto +} + +func (x *ProtoActualLRPsRequest) FromProto() *ActualLRPsRequest { + if x == nil { + return nil + } + + copysafe := &ActualLRPsRequest{ + Domain: x.Domain, + CellId: x.CellId, + ProcessGuid: x.ProcessGuid, + Index: x.Index, + } + return copysafe +} + +func ActualLRPsRequestToProtoSlice(values []*ActualLRPsRequest) []*ProtoActualLRPsRequest { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPsRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPsRequestFromProtoSlice(values []*ProtoActualLRPsRequest) []*ActualLRPsRequest { + if values == nil { + return nil + } + result := make([]*ActualLRPsRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/actual_lrp_requests_test.go b/models/actual_lrp_requests_test.go index b54faf67..9573a6e1 100644 --- a/models/actual_lrp_requests_test.go +++ b/models/actual_lrp_requests_test.go @@ -36,7 +36,8 @@ var _ = Describe("ActualLRP Requests", func() { CellId: "abc123", ProcessGuid: "def456", } - request.SetIndex(3) + index := int32(3) + request.SetIndex(&index) expectedJSON = `{ "domain": "cfapps", diff --git a/models/actual_lrp_test.go b/models/actual_lrp_test.go index 751eef5c..6d80f323 100644 --- a/models/actual_lrp_test.go +++ b/models/actual_lrp_test.go @@ -11,8 +11,9 @@ import ( ) func defaultCrashedActual(crashCount int32, lastCrashed int64) *models.ActualLRP { + actualLrpKey := models.NewActualLRPKey("p-guid", 0, "domain") return &models.ActualLRP{ - ActualLRPKey: models.NewActualLRPKey("p-guid", 0, "domain"), + ActualLrpKey: actualLrpKey, State: models.ActualLRPStateCrashed, CrashCount: crashCount, Since: lastCrashed, @@ -178,25 +179,27 @@ var _ = Describe("ActualLRP", func() { Context("when Routable is false", func() { BeforeEach(func() { - actualLRPInfo.SetRoutable(false) + routable := false + actualLRPInfo.SetRoutable(&routable) }) It("sets routable to provided value", func() { actualLRP := actualLRPInfo.ToActualLRP(models.NewActualLRPKey("p-guid", 0, "domain"), models.NewActualLRPInstanceKey("i-1", "cell-1")) Expect(actualLRP.RoutableExists()).To(Equal(true)) - Expect(actualLRP.GetRoutable()).To(Equal(false)) + Expect(*actualLRP.GetRoutable()).To(Equal(false)) }) }) Context("when Routable is true", func() { BeforeEach(func() { - actualLRPInfo.SetRoutable(true) + routable := true + actualLRPInfo.SetRoutable(&routable) }) It("sets routable to provided value", func() { actualLRP := actualLRPInfo.ToActualLRP(models.NewActualLRPKey("p-guid", 0, "domain"), models.NewActualLRPInstanceKey("i-1", "cell-1")) Expect(actualLRP.RoutableExists()).To(Equal(true)) - Expect(actualLRP.GetRoutable()).To(Equal(true)) + Expect(*actualLRP.GetRoutable()).To(Equal(true)) }) }) }) @@ -366,11 +369,11 @@ var _ = Describe("ActualLRP", func() { BeforeEach(func() { lrpKey := models.NewActualLRPKey("process-guid", 1, "domain") instanceLRP = &models.ActualLRP{ - ActualLRPKey: lrpKey, + ActualLrpKey: lrpKey, Since: 1138, } evacuatingLRP = &models.ActualLRP{ - ActualLRPKey: lrpKey, + ActualLrpKey: lrpKey, Since: 3417, } }) @@ -497,9 +500,9 @@ var _ = Describe("ActualLRP", func() { netInfo = models.NewActualLRPNetInfo("1.2.3.4", "2.2.2.2", models.ActualLRPNetInfo_PreferredAddressUnknown, models.NewPortMapping(5678, 8080), models.NewPortMapping(1234, 8081)) lrp = models.ActualLRP{ - ActualLRPKey: lrpKey, - ActualLRPInstanceKey: instanceKey, - ActualLRPNetInfo: netInfo, + ActualLrpKey: lrpKey, + ActualLrpInstanceKey: instanceKey, + ActualLrpNetInfo: netInfo, CrashCount: 1, State: models.ActualLRPStateRunning, Since: 1138, @@ -517,43 +520,44 @@ var _ = Describe("ActualLRP", func() { ) BeforeEach(func() { + actualLrpKey := models.NewActualLRPKey("fake-process-guid", 1, "fake-domain") before = &models.ActualLRP{ - ActualLRPKey: models.NewActualLRPKey("fake-process-guid", 1, "fake-domain"), + ActualLrpKey: actualLrpKey, } afterKey = models.ActualLRPKey{} - afterKey = before.ActualLRPKey + afterKey = before.ActualLrpKey }) Context("when the ProcessGuid fields differ", func() { BeforeEach(func() { - before.ProcessGuid = "some-process-guid" + before.ActualLrpKey.ProcessGuid = "some-process-guid" afterKey.ProcessGuid = "another-process-guid" }) It("is not allowed", func() { - Expect(before.AllowsTransitionTo(&afterKey, &before.ActualLRPInstanceKey, before.GetState())).To(BeFalse()) + Expect(before.AllowsTransitionTo(&afterKey, &before.ActualLrpInstanceKey, before.GetState())).To(BeFalse()) }) }) Context("when the Index fields differ", func() { BeforeEach(func() { - before.Index = 1138 + before.ActualLrpKey.Index = 1138 afterKey.Index = 3417 }) It("is not allowed", func() { - Expect(before.AllowsTransitionTo(&afterKey, &before.ActualLRPInstanceKey, before.GetState())).To(BeFalse()) + Expect(before.AllowsTransitionTo(&afterKey, &before.ActualLrpInstanceKey, before.GetState())).To(BeFalse()) }) }) Context("when the Domain fields differ", func() { BeforeEach(func() { - before.Domain = "some-domain" + before.ActualLrpKey.Domain = "some-domain" afterKey.Domain = "another-domain" }) It("is not allowed", func() { - Expect(before.AllowsTransitionTo(&afterKey, &before.ActualLRPInstanceKey, before.GetState())).To(BeFalse()) + Expect(before.AllowsTransitionTo(&afterKey, &before.ActualLrpInstanceKey, before.GetState())).To(BeFalse()) }) }) @@ -629,8 +633,8 @@ var _ = Describe("ActualLRP", func() { entry := entry It(EntryToString(entry), func() { before.State = entry.BeforeState - before.ActualLRPInstanceKey = entry.BeforeInstanceKey - Expect(before.AllowsTransitionTo(&before.ActualLRPKey, &entry.AfterInstanceKey, entry.AfterState)).To(Equal(entry.Allowed)) + before.ActualLrpInstanceKey = entry.BeforeInstanceKey + Expect(before.AllowsTransitionTo(&before.ActualLrpKey, &entry.AfterInstanceKey, entry.AfterState)).To(Equal(entry.Allowed)) }) } }) @@ -640,7 +644,7 @@ var _ = Describe("ActualLRP", func() { Context("when state is unclaimed", func() { BeforeEach(func() { lrp = models.ActualLRP{ - ActualLRPKey: lrpKey, + ActualLrpKey: lrpKey, State: models.ActualLRPStateUnclaimed, Since: 1138, } @@ -656,8 +660,8 @@ var _ = Describe("ActualLRP", func() { Context("when state is claimed", func() { BeforeEach(func() { lrp = models.ActualLRP{ - ActualLRPKey: lrpKey, - ActualLRPInstanceKey: instanceKey, + ActualLrpKey: lrpKey, + ActualLrpInstanceKey: instanceKey, State: models.ActualLRPStateClaimed, Since: 1138, } @@ -672,9 +676,9 @@ var _ = Describe("ActualLRP", func() { Context("when state is running", func() { BeforeEach(func() { lrp = models.ActualLRP{ - ActualLRPKey: lrpKey, - ActualLRPInstanceKey: instanceKey, - ActualLRPNetInfo: netInfo, + ActualLrpKey: lrpKey, + ActualLrpInstanceKey: instanceKey, + ActualLrpNetInfo: netInfo, State: models.ActualLRPStateRunning, Since: 1138, } @@ -689,7 +693,7 @@ var _ = Describe("ActualLRP", func() { Context("when state is not set", func() { BeforeEach(func() { lrp = models.ActualLRP{ - ActualLRPKey: lrpKey, + ActualLrpKey: lrpKey, State: "", Since: 1138, } @@ -706,7 +710,7 @@ var _ = Describe("ActualLRP", func() { Context("when since is not set", func() { BeforeEach(func() { lrp = models.ActualLRP{ - ActualLRPKey: lrpKey, + ActualLrpKey: lrpKey, State: models.ActualLRPStateUnclaimed, Since: 0, } @@ -722,7 +726,7 @@ var _ = Describe("ActualLRP", func() { Context("when state is crashed", func() { BeforeEach(func() { lrp = models.ActualLRP{ - ActualLRPKey: lrpKey, + ActualLrpKey: lrpKey, State: models.ActualLRPStateCrashed, Since: 1138, } @@ -738,15 +742,19 @@ var _ = Describe("ActualLRP", func() { Describe("ResolveActualLRPGroups", func() { It("returns ordinary ActualLRPs in the instance slot of ActualLRPGroups", func() { + actualLrpKey1 := models.NewActualLRPKey("process-guid-0", 0, "domain-0") + actualLrpInstanceKey1 := models.NewActualLRPInstanceKey("instance-guid-0", "cell-id-0") lrp1 := &models.ActualLRP{ - ActualLRPKey: models.NewActualLRPKey("process-guid-0", 0, "domain-0"), - ActualLRPInstanceKey: models.NewActualLRPInstanceKey("instance-guid-0", "cell-id-0"), + ActualLrpKey: actualLrpKey1, + ActualLrpInstanceKey: actualLrpInstanceKey1, Presence: models.ActualLRP_Ordinary, State: models.ActualLRPStateRunning, } + actualLrpKey2 := models.NewActualLRPKey("process-guid-1", 1, "domain-1") + actualLrpInstanceKey2 := models.NewActualLRPInstanceKey("instance-guid-1", "cell-id-0") lrp2 := &models.ActualLRP{ - ActualLRPKey: models.NewActualLRPKey("process-guid-1", 1, "domain-1"), - ActualLRPInstanceKey: models.NewActualLRPInstanceKey("instance-guid-1", "cell-id-0"), + ActualLrpKey: actualLrpKey2, + ActualLrpInstanceKey: actualLrpInstanceKey2, Presence: models.ActualLRP_Ordinary, State: models.ActualLRPStateRunning, } @@ -758,15 +766,19 @@ var _ = Describe("ActualLRP", func() { }) It("returns evacuating ActualLRPs in the evacuating slot of ActualLRPGroups", func() { + actualLrpKey1 := models.NewActualLRPKey("process-guid-0", 0, "domain-0") + actualLrpInstanceKey1 := models.NewActualLRPInstanceKey("instance-guid-0", "cell-id-0") lrp1 := &models.ActualLRP{ - ActualLRPKey: models.NewActualLRPKey("process-guid-0", 0, "domain-0"), - ActualLRPInstanceKey: models.NewActualLRPInstanceKey("instance-guid-0", "cell-id-0"), + ActualLrpKey: actualLrpKey1, + ActualLrpInstanceKey: actualLrpInstanceKey1, Presence: models.ActualLRP_Evacuating, State: models.ActualLRPStateRunning, } + actualLrpKey2 := models.NewActualLRPKey("process-guid-0", 0, "domain-0") + actualLrpInstanceKey2 := models.NewActualLRPInstanceKey("instance-guid-1", "cell-id-1") lrp2 := &models.ActualLRP{ - ActualLRPKey: models.NewActualLRPKey("process-guid-0", 0, "domain-0"), - ActualLRPInstanceKey: models.NewActualLRPInstanceKey("instance-guid-1", "cell-id-1"), + ActualLrpKey: actualLrpKey2, + ActualLrpInstanceKey: actualLrpInstanceKey2, Presence: models.ActualLRP_Ordinary, State: models.ActualLRPStateRunning, } @@ -782,15 +794,19 @@ var _ = Describe("ActualLRP", func() { supLRPState string, supLRPPresence models.ActualLRP_Presence, infLRPState string, infLRPPresence models.ActualLRP_Presence, ) { + actualLrpKey1 := models.NewActualLRPKey("process-guid-0", 0, "domain-0") + actualLrpInstanceKey1 := models.NewActualLRPInstanceKey("instance-guid-0", "cell-id-0") supLRP := &models.ActualLRP{ - ActualLRPKey: models.NewActualLRPKey("process-guid-0", 0, "domain-0"), - ActualLRPInstanceKey: models.NewActualLRPInstanceKey("instance-guid-0", "cell-id-0"), + ActualLrpKey: actualLrpKey1, + ActualLrpInstanceKey: actualLrpInstanceKey1, Presence: supLRPPresence, State: supLRPState, } + actualLrpKey2 := models.NewActualLRPKey("process-guid-0", 0, "domain-0") + actualLrpInstanceKey2 := models.NewActualLRPInstanceKey("instance-guid-1", "cell-id-1") infLRP := &models.ActualLRP{ - ActualLRPKey: models.NewActualLRPKey("process-guid-0", 0, "domain-0"), - ActualLRPInstanceKey: models.NewActualLRPInstanceKey("instance-guid-1", "cell-id-1"), + ActualLrpKey: actualLrpKey2, + ActualLrpInstanceKey: actualLrpInstanceKey2, Presence: infLRPPresence, State: infLRPState, } @@ -854,7 +870,8 @@ var _ = Describe("ActualLRP", func() { func itValidatesPresenceOfTheLRPKey(lrp *models.ActualLRP) { Context("when the lrp key is set", func() { BeforeEach(func() { - lrp.ActualLRPKey = models.NewActualLRPKey("some-guid", 1, "domain") + actualLrpKey := models.NewActualLRPKey("some-guid", 1, "domain") + lrp.ActualLrpKey = actualLrpKey }) It("validate does not return an error", func() { @@ -864,7 +881,7 @@ func itValidatesPresenceOfTheLRPKey(lrp *models.ActualLRP) { Context("when the lrp key is not set", func() { BeforeEach(func() { - lrp.ActualLRPKey = models.ActualLRPKey{} + lrp.ActualLrpKey = models.ActualLRPKey{} }) It("validate returns an error", func() { @@ -878,7 +895,8 @@ func itValidatesPresenceOfTheLRPKey(lrp *models.ActualLRP) { func itValidatesPresenceOfTheInstanceKey(lrp *models.ActualLRP) { Context("when the instance key is set", func() { BeforeEach(func() { - lrp.ActualLRPInstanceKey = models.NewActualLRPInstanceKey("some-instance", "some-cell") + actualLrpInstanceKey := models.NewActualLRPInstanceKey("some-instance", "some-cell") + lrp.ActualLrpInstanceKey = actualLrpInstanceKey }) It("validate does not return an error", func() { @@ -888,7 +906,7 @@ func itValidatesPresenceOfTheInstanceKey(lrp *models.ActualLRP) { Context("when the instance key is not set", func() { BeforeEach(func() { - lrp.ActualLRPInstanceKey = models.ActualLRPInstanceKey{} + lrp.ActualLrpInstanceKey = models.ActualLRPInstanceKey{} }) It("validate returns an error", func() { @@ -902,7 +920,8 @@ func itValidatesPresenceOfTheInstanceKey(lrp *models.ActualLRP) { func itValidatesAbsenceOfTheInstanceKey(lrp *models.ActualLRP) { Context("when the instance key is set", func() { BeforeEach(func() { - lrp.ActualLRPInstanceKey = models.NewActualLRPInstanceKey("some-instance", "some-cell") + actualLrpInstanceKey := models.NewActualLRPInstanceKey("some-instance", "some-cell") + lrp.ActualLrpInstanceKey = actualLrpInstanceKey }) It("validate returns an error", func() { @@ -914,7 +933,7 @@ func itValidatesAbsenceOfTheInstanceKey(lrp *models.ActualLRP) { Context("when the instance key is not set", func() { BeforeEach(func() { - lrp.ActualLRPInstanceKey = models.ActualLRPInstanceKey{} + lrp.ActualLrpInstanceKey = models.ActualLRPInstanceKey{} }) It("validate does not return an error", func() { @@ -926,7 +945,8 @@ func itValidatesAbsenceOfTheInstanceKey(lrp *models.ActualLRP) { func itValidatesPresenceOfNetInfo(lrp *models.ActualLRP) { Context("when net info is set", func() { BeforeEach(func() { - lrp.ActualLRPNetInfo = models.NewActualLRPNetInfo("1.2.3.4", "2.2.2.2", models.ActualLRPNetInfo_PreferredAddressUnknown) + actualLrpNetInfo := models.NewActualLRPNetInfo("1.2.3.4", "2.2.2.2", models.ActualLRPNetInfo_PreferredAddressUnknown) + lrp.ActualLrpNetInfo = actualLrpNetInfo }) It("validate does not return an error", func() { @@ -936,7 +956,7 @@ func itValidatesPresenceOfNetInfo(lrp *models.ActualLRP) { Context("when net info is not set", func() { BeforeEach(func() { - lrp.ActualLRPNetInfo = models.ActualLRPNetInfo{} + lrp.ActualLrpNetInfo = models.ActualLRPNetInfo{} }) It("validate returns an error", func() { @@ -950,7 +970,8 @@ func itValidatesPresenceOfNetInfo(lrp *models.ActualLRP) { func itValidatesAbsenceOfNetInfo(lrp *models.ActualLRP) { Context("when net info is set", func() { BeforeEach(func() { - lrp.ActualLRPNetInfo = models.NewActualLRPNetInfo("1.2.3.4", "2.2.2.2", models.ActualLRPNetInfo_PreferredAddressUnknown) + actualLrpNetInfo := models.NewActualLRPNetInfo("1.2.3.4", "2.2.2.2", models.ActualLRPNetInfo_PreferredAddressUnknown) + lrp.ActualLrpNetInfo = actualLrpNetInfo }) It("validate returns an error", func() { @@ -962,7 +983,7 @@ func itValidatesAbsenceOfNetInfo(lrp *models.ActualLRP) { Context("when net info is not set", func() { BeforeEach(func() { - lrp.ActualLRPNetInfo = models.ActualLRPNetInfo{} + lrp.ActualLrpNetInfo = models.ActualLRPNetInfo{} }) It("validate does not return an error", func() { diff --git a/models/bbs.pb.go b/models/bbs.pb.go new file mode 100644 index 00000000..50a4cab3 --- /dev/null +++ b/models/bbs.pb.go @@ -0,0 +1,148 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 +// source: bbs.proto + +package models + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var file_bbs_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 1000, + Name: "bbs.bbs_json_always_emit", + Tag: "varint,1000,opt,name=bbs_json_always_emit", + Filename: "bbs.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 1010, + Name: "bbs.bbs_by_value", + Tag: "varint,1010,opt,name=bbs_by_value", + Filename: "bbs.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 1020, + Name: "bbs.bbs_exclude_from_equal", + Tag: "varint,1020,opt,name=bbs_exclude_from_equal", + Filename: "bbs.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 1030, + Name: "bbs.bbs_custom_type", + Tag: "bytes,1030,opt,name=bbs_custom_type", + Filename: "bbs.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 1040, + Name: "bbs.bbs_default_value", + Tag: "bytes,1040,opt,name=bbs_default_value", + Filename: "bbs.proto", + }, + { + ExtendedType: (*descriptorpb.EnumValueOptions)(nil), + ExtensionType: (*string)(nil), + Field: 2000, + Name: "bbs.bbs_enumvalue_customname", + Tag: "bytes,2000,opt,name=bbs_enumvalue_customname", + Filename: "bbs.proto", + }, +} + +// Extension fields to descriptorpb.FieldOptions. +var ( + // optional bool bbs_json_always_emit = 1000; + E_BbsJsonAlwaysEmit = &file_bbs_proto_extTypes[0] + // optional bool bbs_by_value = 1010; + E_BbsByValue = &file_bbs_proto_extTypes[1] + // optional bool bbs_exclude_from_equal = 1020; + E_BbsExcludeFromEqual = &file_bbs_proto_extTypes[2] + // optional string bbs_custom_type = 1030; + E_BbsCustomType = &file_bbs_proto_extTypes[3] + // optional string bbs_default_value = 1040; + E_BbsDefaultValue = &file_bbs_proto_extTypes[4] +) + +// Extension fields to descriptorpb.EnumValueOptions. +var ( + // optional string bbs_enumvalue_customname = 2000; + E_BbsEnumvalueCustomname = &file_bbs_proto_extTypes[5] +) + +var File_bbs_proto protoreflect.FileDescriptor + +const file_bbs_proto_rawDesc = "" + + "\n" + + "\tbbs.proto\x12\x03bbs\x1a google/protobuf/descriptor.proto:R\n" + + "\x14bbs_json_always_emit\x12\x1d.google.protobuf.FieldOptions\x18\xe8\a \x01(\bR\x11bbsJsonAlwaysEmit\x88\x01\x01:C\n" + + "\fbbs_by_value\x12\x1d.google.protobuf.FieldOptions\x18\xf2\a \x01(\bR\n" + + "bbsByValue\x88\x01\x01:V\n" + + "\x16bbs_exclude_from_equal\x12\x1d.google.protobuf.FieldOptions\x18\xfc\a \x01(\bR\x13bbsExcludeFromEqual\x88\x01\x01:I\n" + + "\x0fbbs_custom_type\x12\x1d.google.protobuf.FieldOptions\x18\x86\b \x01(\tR\rbbsCustomType\x88\x01\x01:M\n" + + "\x11bbs_default_value\x12\x1d.google.protobuf.FieldOptions\x18\x90\b \x01(\tR\x0fbbsDefaultValue\x88\x01\x01:_\n" + + "\x18bbs_enumvalue_customname\x12!.google.protobuf.EnumValueOptions\x18\xd0\x0f \x01(\tR\x16bbsEnumvalueCustomname\x88\x01\x01B\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" + +var file_bbs_proto_goTypes = []any{ + (*descriptorpb.FieldOptions)(nil), // 0: google.protobuf.FieldOptions + (*descriptorpb.EnumValueOptions)(nil), // 1: google.protobuf.EnumValueOptions +} +var file_bbs_proto_depIdxs = []int32{ + 0, // 0: bbs.bbs_json_always_emit:extendee -> google.protobuf.FieldOptions + 0, // 1: bbs.bbs_by_value:extendee -> google.protobuf.FieldOptions + 0, // 2: bbs.bbs_exclude_from_equal:extendee -> google.protobuf.FieldOptions + 0, // 3: bbs.bbs_custom_type:extendee -> google.protobuf.FieldOptions + 0, // 4: bbs.bbs_default_value:extendee -> google.protobuf.FieldOptions + 1, // 5: bbs.bbs_enumvalue_customname:extendee -> google.protobuf.EnumValueOptions + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 0, // [0:6] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_bbs_proto_init() } +func file_bbs_proto_init() { + if File_bbs_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_bbs_proto_rawDesc), len(file_bbs_proto_rawDesc)), + NumEnums: 0, + NumMessages: 0, + NumExtensions: 6, + NumServices: 0, + }, + GoTypes: file_bbs_proto_goTypes, + DependencyIndexes: file_bbs_proto_depIdxs, + ExtensionInfos: file_bbs_proto_extTypes, + }.Build() + File_bbs_proto = out.File + file_bbs_proto_goTypes = nil + file_bbs_proto_depIdxs = nil +} diff --git a/models/cached_dependency.pb.go b/models/cached_dependency.pb.go index 2bd79438..b874bd65 100644 --- a/models/cached_dependency.pb.go +++ b/models/cached_dependency.pb.go @@ -1,723 +1,179 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: cached_dependency.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -type CachedDependency struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` - From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from"` - To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to"` - CacheKey string `protobuf:"bytes,4,opt,name=cache_key,json=cacheKey,proto3" json:"cache_key"` - LogSource string `protobuf:"bytes,5,opt,name=log_source,json=logSource,proto3" json:"log_source"` - ChecksumAlgorithm string `protobuf:"bytes,6,opt,name=checksum_algorithm,json=checksumAlgorithm,proto3" json:"checksum_algorithm,omitempty"` - ChecksumValue string `protobuf:"bytes,7,opt,name=checksum_value,json=checksumValue,proto3" json:"checksum_value,omitempty"` +type ProtoCachedDependency struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` + To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` + CacheKey string `protobuf:"bytes,4,opt,name=cache_key,proto3" json:"cache_key,omitempty"` + LogSource string `protobuf:"bytes,5,opt,name=log_source,proto3" json:"log_source,omitempty"` + ChecksumAlgorithm string `protobuf:"bytes,6,opt,name=checksum_algorithm,proto3" json:"checksum_algorithm,omitempty"` + ChecksumValue string `protobuf:"bytes,7,opt,name=checksum_value,proto3" json:"checksum_value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CachedDependency) Reset() { *m = CachedDependency{} } -func (*CachedDependency) ProtoMessage() {} -func (*CachedDependency) Descriptor() ([]byte, []int) { - return fileDescriptor_936e0e6e1c3697fa, []int{0} -} -func (m *CachedDependency) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CachedDependency) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CachedDependency.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CachedDependency) XXX_Merge(src proto.Message) { - xxx_messageInfo_CachedDependency.Merge(m, src) -} -func (m *CachedDependency) XXX_Size() int { - return m.Size() +func (x *ProtoCachedDependency) Reset() { + *x = ProtoCachedDependency{} + mi := &file_cached_dependency_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CachedDependency) XXX_DiscardUnknown() { - xxx_messageInfo_CachedDependency.DiscardUnknown(m) + +func (x *ProtoCachedDependency) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_CachedDependency proto.InternalMessageInfo +func (*ProtoCachedDependency) ProtoMessage() {} -func (m *CachedDependency) GetName() string { - if m != nil { - return m.Name +func (x *ProtoCachedDependency) ProtoReflect() protoreflect.Message { + mi := &file_cached_dependency_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -func (m *CachedDependency) GetFrom() string { - if m != nil { - return m.From - } - return "" +// Deprecated: Use ProtoCachedDependency.ProtoReflect.Descriptor instead. +func (*ProtoCachedDependency) Descriptor() ([]byte, []int) { + return file_cached_dependency_proto_rawDescGZIP(), []int{0} } -func (m *CachedDependency) GetTo() string { - if m != nil { - return m.To +func (x *ProtoCachedDependency) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *CachedDependency) GetCacheKey() string { - if m != nil { - return m.CacheKey +func (x *ProtoCachedDependency) GetFrom() string { + if x != nil { + return x.From } return "" } -func (m *CachedDependency) GetLogSource() string { - if m != nil { - return m.LogSource +func (x *ProtoCachedDependency) GetTo() string { + if x != nil { + return x.To } return "" } -func (m *CachedDependency) GetChecksumAlgorithm() string { - if m != nil { - return m.ChecksumAlgorithm +func (x *ProtoCachedDependency) GetCacheKey() string { + if x != nil { + return x.CacheKey } return "" } -func (m *CachedDependency) GetChecksumValue() string { - if m != nil { - return m.ChecksumValue +func (x *ProtoCachedDependency) GetLogSource() string { + if x != nil { + return x.LogSource } return "" } -func init() { - proto.RegisterType((*CachedDependency)(nil), "models.CachedDependency") -} - -func init() { proto.RegisterFile("cached_dependency.proto", fileDescriptor_936e0e6e1c3697fa) } - -var fileDescriptor_936e0e6e1c3697fa = []byte{ - // 326 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xc1, 0x4a, 0xeb, 0x40, - 0x14, 0x86, 0x33, 0xb9, 0xbd, 0xb9, 0xed, 0x40, 0xcb, 0xbd, 0xb3, 0xb8, 0x0e, 0x22, 0x27, 0x22, - 0x08, 0x22, 0xb4, 0x5d, 0xe8, 0x0b, 0x58, 0xdd, 0xb9, 0x8b, 0xe0, 0x36, 0xa4, 0x93, 0x69, 0x52, - 0x9a, 0xf4, 0x94, 0x34, 0x11, 0xba, 0xf3, 0x11, 0xdc, 0xf9, 0x0a, 0x3e, 0x8a, 0xcb, 0x2e, 0xbb, - 0x0a, 0x76, 0xba, 0x91, 0xac, 0xfa, 0x08, 0x92, 0x23, 0x6d, 0xdd, 0x1c, 0xfe, 0xff, 0xff, 0xfe, - 0x73, 0x18, 0x86, 0x1f, 0xa9, 0x40, 0xc5, 0x3a, 0xf4, 0x43, 0x3d, 0xd3, 0xd3, 0x50, 0x4f, 0xd5, - 0xa2, 0x37, 0xcb, 0x30, 0x47, 0xe1, 0xa4, 0x18, 0xea, 0x64, 0x7e, 0xdc, 0x8d, 0xc6, 0x79, 0x5c, - 0x0c, 0x7b, 0x0a, 0xd3, 0x7e, 0x84, 0x11, 0xf6, 0x09, 0x0f, 0x8b, 0x11, 0x39, 0x32, 0xa4, 0xbe, - 0xd7, 0xce, 0x5e, 0x6d, 0xfe, 0xf7, 0x96, 0x4e, 0xde, 0xed, 0x2f, 0x8a, 0x13, 0xde, 0x98, 0x06, - 0xa9, 0x96, 0xec, 0x94, 0x5d, 0xb4, 0x06, 0xcd, 0xaa, 0x74, 0xc9, 0x7b, 0x34, 0x6b, 0x3a, 0xca, - 0x30, 0x95, 0xf6, 0x81, 0xd6, 0xde, 0xa3, 0x29, 0xfe, 0x73, 0x3b, 0x47, 0xf9, 0x8b, 0x98, 0x53, - 0x95, 0xae, 0x9d, 0xa3, 0x67, 0xe7, 0x28, 0x2e, 0x79, 0x8b, 0x9e, 0xee, 0x4f, 0xf4, 0x42, 0x36, - 0x08, 0xb7, 0xab, 0xd2, 0x3d, 0x84, 0x5e, 0x93, 0xe4, 0xbd, 0x5e, 0x88, 0x2e, 0xe7, 0x09, 0x46, - 0xfe, 0x1c, 0x8b, 0x4c, 0x69, 0xf9, 0x9b, 0xca, 0x9d, 0xaa, 0x74, 0x7f, 0xa4, 0x5e, 0x2b, 0xc1, - 0xe8, 0x81, 0xa4, 0xe8, 0x72, 0xa1, 0x62, 0xad, 0x26, 0xf3, 0x22, 0xf5, 0x83, 0x24, 0xc2, 0x6c, - 0x9c, 0xc7, 0xa9, 0x74, 0xea, 0x35, 0xef, 0xdf, 0x8e, 0xdc, 0xec, 0x80, 0x38, 0xe7, 0x9d, 0x7d, - 0xfd, 0x29, 0x48, 0x0a, 0x2d, 0xff, 0x50, 0xb5, 0xbd, 0x4b, 0x1f, 0xeb, 0x70, 0x70, 0xbd, 0x5c, - 0x03, 0x5b, 0xad, 0xc1, 0xda, 0xae, 0x81, 0x3d, 0x1b, 0x60, 0x6f, 0x06, 0xd8, 0xbb, 0x01, 0xb6, - 0x34, 0xc0, 0x3e, 0x0c, 0xb0, 0x4f, 0x03, 0xd6, 0xd6, 0x00, 0x7b, 0xd9, 0x80, 0xb5, 0xdc, 0x80, - 0xb5, 0xda, 0x80, 0x35, 0x74, 0xe8, 0x5b, 0xaf, 0xbe, 0x02, 0x00, 0x00, 0xff, 0xff, 0x10, 0xce, - 0x51, 0x13, 0xa8, 0x01, 0x00, 0x00, -} - -func (this *CachedDependency) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*CachedDependency) - if !ok { - that2, ok := that.(CachedDependency) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.From != that1.From { - return false - } - if this.To != that1.To { - return false - } - if this.CacheKey != that1.CacheKey { - return false - } - if this.LogSource != that1.LogSource { - return false - } - if this.ChecksumAlgorithm != that1.ChecksumAlgorithm { - return false - } - if this.ChecksumValue != that1.ChecksumValue { - return false - } - return true -} -func (this *CachedDependency) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&models.CachedDependency{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "From: "+fmt.Sprintf("%#v", this.From)+",\n") - s = append(s, "To: "+fmt.Sprintf("%#v", this.To)+",\n") - s = append(s, "CacheKey: "+fmt.Sprintf("%#v", this.CacheKey)+",\n") - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - s = append(s, "ChecksumAlgorithm: "+fmt.Sprintf("%#v", this.ChecksumAlgorithm)+",\n") - s = append(s, "ChecksumValue: "+fmt.Sprintf("%#v", this.ChecksumValue)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringCachedDependency(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *CachedDependency) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CachedDependency) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CachedDependency) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChecksumValue) > 0 { - i -= len(m.ChecksumValue) - copy(dAtA[i:], m.ChecksumValue) - i = encodeVarintCachedDependency(dAtA, i, uint64(len(m.ChecksumValue))) - i-- - dAtA[i] = 0x3a - } - if len(m.ChecksumAlgorithm) > 0 { - i -= len(m.ChecksumAlgorithm) - copy(dAtA[i:], m.ChecksumAlgorithm) - i = encodeVarintCachedDependency(dAtA, i, uint64(len(m.ChecksumAlgorithm))) - i-- - dAtA[i] = 0x32 - } - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintCachedDependency(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x2a - } - if len(m.CacheKey) > 0 { - i -= len(m.CacheKey) - copy(dAtA[i:], m.CacheKey) - i = encodeVarintCachedDependency(dAtA, i, uint64(len(m.CacheKey))) - i-- - dAtA[i] = 0x22 - } - if len(m.To) > 0 { - i -= len(m.To) - copy(dAtA[i:], m.To) - i = encodeVarintCachedDependency(dAtA, i, uint64(len(m.To))) - i-- - dAtA[i] = 0x1a +func (x *ProtoCachedDependency) GetChecksumAlgorithm() string { + if x != nil { + return x.ChecksumAlgorithm } - if len(m.From) > 0 { - i -= len(m.From) - copy(dAtA[i:], m.From) - i = encodeVarintCachedDependency(dAtA, i, uint64(len(m.From))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintCachedDependency(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return "" } -func encodeVarintCachedDependency(dAtA []byte, offset int, v uint64) int { - offset -= sovCachedDependency(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *CachedDependency) Size() (n int) { - if m == nil { - return 0 +func (x *ProtoCachedDependency) GetChecksumValue() string { + if x != nil { + return x.ChecksumValue } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovCachedDependency(uint64(l)) - } - l = len(m.From) - if l > 0 { - n += 1 + l + sovCachedDependency(uint64(l)) - } - l = len(m.To) - if l > 0 { - n += 1 + l + sovCachedDependency(uint64(l)) - } - l = len(m.CacheKey) - if l > 0 { - n += 1 + l + sovCachedDependency(uint64(l)) - } - l = len(m.LogSource) - if l > 0 { - n += 1 + l + sovCachedDependency(uint64(l)) - } - l = len(m.ChecksumAlgorithm) - if l > 0 { - n += 1 + l + sovCachedDependency(uint64(l)) - } - l = len(m.ChecksumValue) - if l > 0 { - n += 1 + l + sovCachedDependency(uint64(l)) - } - return n + return "" } -func sovCachedDependency(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCachedDependency(x uint64) (n int) { - return sovCachedDependency(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *CachedDependency) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CachedDependency{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `From:` + fmt.Sprintf("%v", this.From) + `,`, - `To:` + fmt.Sprintf("%v", this.To) + `,`, - `CacheKey:` + fmt.Sprintf("%v", this.CacheKey) + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `ChecksumAlgorithm:` + fmt.Sprintf("%v", this.ChecksumAlgorithm) + `,`, - `ChecksumValue:` + fmt.Sprintf("%v", this.ChecksumValue) + `,`, - `}`, - }, "") - return s -} -func valueToStringCachedDependency(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *CachedDependency) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachedDependency - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CachedDependency: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CachedDependency: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachedDependency - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCachedDependency - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCachedDependency - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachedDependency - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCachedDependency - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCachedDependency - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.From = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachedDependency - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCachedDependency - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCachedDependency - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.To = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CacheKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachedDependency - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCachedDependency - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCachedDependency - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CacheKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachedDependency - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCachedDependency - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCachedDependency - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChecksumAlgorithm", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachedDependency - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCachedDependency - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCachedDependency - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChecksumAlgorithm = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChecksumValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachedDependency - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCachedDependency - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCachedDependency - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChecksumValue = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCachedDependency(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCachedDependency - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var File_cached_dependency_proto protoreflect.FileDescriptor - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCachedDependency(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCachedDependency - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCachedDependency - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCachedDependency - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthCachedDependency - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCachedDependency - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthCachedDependency - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +const file_cached_dependency_proto_rawDesc = "" + + "\n" + + "\x17cached_dependency.proto\x12\x06models\x1a\tbbs.proto\"\xfe\x01\n" + + "\x15ProtoCachedDependency\x12\x17\n" + + "\x04name\x18\x01 \x01(\tB\x03\xc0>\x01R\x04name\x12\x17\n" + + "\x04from\x18\x02 \x01(\tB\x03\xc0>\x01R\x04from\x12\x13\n" + + "\x02to\x18\x03 \x01(\tB\x03\xc0>\x01R\x02to\x12!\n" + + "\tcache_key\x18\x04 \x01(\tB\x03\xc0>\x01R\tcache_key\x12#\n" + + "\n" + + "log_source\x18\x05 \x01(\tB\x03\xc0>\x01R\n" + + "log_source\x12.\n" + + "\x12checksum_algorithm\x18\x06 \x01(\tR\x12checksum_algorithm\x12&\n" + + "\x0echecksum_value\x18\a \x01(\tR\x0echecksum_valueB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthCachedDependency = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCachedDependency = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCachedDependency = fmt.Errorf("proto: unexpected end of group") + file_cached_dependency_proto_rawDescOnce sync.Once + file_cached_dependency_proto_rawDescData []byte ) + +func file_cached_dependency_proto_rawDescGZIP() []byte { + file_cached_dependency_proto_rawDescOnce.Do(func() { + file_cached_dependency_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cached_dependency_proto_rawDesc), len(file_cached_dependency_proto_rawDesc))) + }) + return file_cached_dependency_proto_rawDescData +} + +var file_cached_dependency_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cached_dependency_proto_goTypes = []any{ + (*ProtoCachedDependency)(nil), // 0: models.ProtoCachedDependency +} +var file_cached_dependency_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cached_dependency_proto_init() } +func file_cached_dependency_proto_init() { + if File_cached_dependency_proto != nil { + return + } + file_bbs_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_cached_dependency_proto_rawDesc), len(file_cached_dependency_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cached_dependency_proto_goTypes, + DependencyIndexes: file_cached_dependency_proto_depIdxs, + MessageInfos: file_cached_dependency_proto_msgTypes, + }.Build() + File_cached_dependency_proto = out.File + file_cached_dependency_proto_goTypes = nil + file_cached_dependency_proto_depIdxs = nil +} diff --git a/models/cached_dependency.proto b/models/cached_dependency.proto index daea97e2..57c50848 100644 --- a/models/cached_dependency.proto +++ b/models/cached_dependency.proto @@ -1,17 +1,16 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; -option (gogoproto.goproto_enum_prefix_all) = true; - -message CachedDependency { - string name = 1 [(gogoproto.jsontag) = "name"]; - string from = 2 [(gogoproto.jsontag) = "from"]; - string to = 3 [(gogoproto.jsontag) = "to"]; - string cache_key = 4 [(gogoproto.jsontag) = "cache_key"]; - string log_source = 5 [(gogoproto.jsontag) = "log_source"]; - string checksum_algorithm = 6; - string checksum_value = 7; +message ProtoCachedDependency { + string name = 1 [json_name = "name", (bbs.bbs_json_always_emit) = true]; + string from = 2 [json_name = "from", (bbs.bbs_json_always_emit) = true]; + string to = 3 [json_name = "to", (bbs.bbs_json_always_emit) = true]; + string cache_key = 4 [json_name = "cache_key", (bbs.bbs_json_always_emit) = true]; + string log_source = 5 [json_name = "log_source", (bbs.bbs_json_always_emit) = true]; + string checksum_algorithm = 6 [json_name = "checksum_algorithm"]; + string checksum_value = 7 [json_name = "checksum_value"]; } diff --git a/models/cached_dependency_bbs.pb.go b/models/cached_dependency_bbs.pb.go new file mode 100644 index 00000000..a7dafdc7 --- /dev/null +++ b/models/cached_dependency_bbs.pb.go @@ -0,0 +1,210 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: cached_dependency.proto + +package models + +// Prevent copylock errors when using ProtoCachedDependency directly +type CachedDependency struct { + Name string `json:"name"` + From string `json:"from"` + To string `json:"to"` + CacheKey string `json:"cache_key"` + LogSource string `json:"log_source"` + ChecksumAlgorithm string `json:"checksum_algorithm,omitempty"` + ChecksumValue string `json:"checksum_value,omitempty"` +} + +func (this *CachedDependency) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*CachedDependency) + if !ok { + that2, ok := that.(CachedDependency) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Name != that1.Name { + return false + } + if this.From != that1.From { + return false + } + if this.To != that1.To { + return false + } + if this.CacheKey != that1.CacheKey { + return false + } + if this.LogSource != that1.LogSource { + return false + } + if this.ChecksumAlgorithm != that1.ChecksumAlgorithm { + return false + } + if this.ChecksumValue != that1.ChecksumValue { + return false + } + return true +} +func (m *CachedDependency) GetName() string { + if m != nil { + return m.Name + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CachedDependency) SetName(value string) { + if m != nil { + m.Name = value + } +} +func (m *CachedDependency) GetFrom() string { + if m != nil { + return m.From + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CachedDependency) SetFrom(value string) { + if m != nil { + m.From = value + } +} +func (m *CachedDependency) GetTo() string { + if m != nil { + return m.To + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CachedDependency) SetTo(value string) { + if m != nil { + m.To = value + } +} +func (m *CachedDependency) GetCacheKey() string { + if m != nil { + return m.CacheKey + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CachedDependency) SetCacheKey(value string) { + if m != nil { + m.CacheKey = value + } +} +func (m *CachedDependency) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CachedDependency) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} +func (m *CachedDependency) GetChecksumAlgorithm() string { + if m != nil { + return m.ChecksumAlgorithm + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CachedDependency) SetChecksumAlgorithm(value string) { + if m != nil { + m.ChecksumAlgorithm = value + } +} +func (m *CachedDependency) GetChecksumValue() string { + if m != nil { + return m.ChecksumValue + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CachedDependency) SetChecksumValue(value string) { + if m != nil { + m.ChecksumValue = value + } +} +func (x *CachedDependency) ToProto() *ProtoCachedDependency { + if x == nil { + return nil + } + + proto := &ProtoCachedDependency{ + Name: x.Name, + From: x.From, + To: x.To, + CacheKey: x.CacheKey, + LogSource: x.LogSource, + ChecksumAlgorithm: x.ChecksumAlgorithm, + ChecksumValue: x.ChecksumValue, + } + return proto +} + +func (x *ProtoCachedDependency) FromProto() *CachedDependency { + if x == nil { + return nil + } + + copysafe := &CachedDependency{ + Name: x.Name, + From: x.From, + To: x.To, + CacheKey: x.CacheKey, + LogSource: x.LogSource, + ChecksumAlgorithm: x.ChecksumAlgorithm, + ChecksumValue: x.ChecksumValue, + } + return copysafe +} + +func CachedDependencyToProtoSlice(values []*CachedDependency) []*ProtoCachedDependency { + if values == nil { + return nil + } + result := make([]*ProtoCachedDependency, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func CachedDependencyFromProtoSlice(values []*ProtoCachedDependency) []*CachedDependency { + if values == nil { + return nil + } + result := make([]*CachedDependency, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/cells.pb.go b/models/cells.pb.go index 36d9d7b7..a8a3164d 100644 --- a/models/cells.pb.go +++ b/models/cells.pb.go @@ -1,1703 +1,373 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: cells.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -type CellCapacity struct { - MemoryMb int32 `protobuf:"varint,1,opt,name=memory_mb,json=memoryMb,proto3" json:"memory_mb"` - DiskMb int32 `protobuf:"varint,2,opt,name=disk_mb,json=diskMb,proto3" json:"disk_mb"` - Containers int32 `protobuf:"varint,3,opt,name=containers,proto3" json:"containers"` +type ProtoCellCapacity struct { + state protoimpl.MessageState `protogen:"open.v1"` + MemoryMb int32 `protobuf:"varint,1,opt,name=memory_mb,proto3" json:"memory_mb,omitempty"` + DiskMb int32 `protobuf:"varint,2,opt,name=disk_mb,proto3" json:"disk_mb,omitempty"` + Containers int32 `protobuf:"varint,3,opt,name=containers,proto3" json:"containers,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CellCapacity) Reset() { *m = CellCapacity{} } -func (*CellCapacity) ProtoMessage() {} -func (*CellCapacity) Descriptor() ([]byte, []int) { - return fileDescriptor_842e821272d22ff7, []int{0} +func (x *ProtoCellCapacity) Reset() { + *x = ProtoCellCapacity{} + mi := &file_cells_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CellCapacity) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoCellCapacity) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CellCapacity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CellCapacity.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoCellCapacity) ProtoMessage() {} + +func (x *ProtoCellCapacity) ProtoReflect() protoreflect.Message { + mi := &file_cells_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *CellCapacity) XXX_Merge(src proto.Message) { - xxx_messageInfo_CellCapacity.Merge(m, src) -} -func (m *CellCapacity) XXX_Size() int { - return m.Size() -} -func (m *CellCapacity) XXX_DiscardUnknown() { - xxx_messageInfo_CellCapacity.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_CellCapacity proto.InternalMessageInfo +// Deprecated: Use ProtoCellCapacity.ProtoReflect.Descriptor instead. +func (*ProtoCellCapacity) Descriptor() ([]byte, []int) { + return file_cells_proto_rawDescGZIP(), []int{0} +} -func (m *CellCapacity) GetMemoryMb() int32 { - if m != nil { - return m.MemoryMb +func (x *ProtoCellCapacity) GetMemoryMb() int32 { + if x != nil { + return x.MemoryMb } return 0 } -func (m *CellCapacity) GetDiskMb() int32 { - if m != nil { - return m.DiskMb +func (x *ProtoCellCapacity) GetDiskMb() int32 { + if x != nil { + return x.DiskMb } return 0 } -func (m *CellCapacity) GetContainers() int32 { - if m != nil { - return m.Containers +func (x *ProtoCellCapacity) GetContainers() int32 { + if x != nil { + return x.Containers } return 0 } -type CellPresence struct { - CellId string `protobuf:"bytes,1,opt,name=cell_id,json=cellId,proto3" json:"cell_id"` - RepAddress string `protobuf:"bytes,2,opt,name=rep_address,json=repAddress,proto3" json:"rep_address"` - Zone string `protobuf:"bytes,3,opt,name=zone,proto3" json:"zone"` - Capacity *CellCapacity `protobuf:"bytes,4,opt,name=capacity,proto3" json:"capacity,omitempty"` - RootfsProviders []*Provider `protobuf:"bytes,5,rep,name=rootfs_providers,json=rootfsProviders,proto3" json:"rootfs_provider_list,omitempty"` - PlacementTags []string `protobuf:"bytes,6,rep,name=placement_tags,json=placementTags,proto3" json:"placement_tags,omitempty"` - OptionalPlacementTags []string `protobuf:"bytes,7,rep,name=optional_placement_tags,json=optionalPlacementTags,proto3" json:"optional_placement_tags,omitempty"` - RepUrl string `protobuf:"bytes,8,opt,name=rep_url,json=repUrl,proto3" json:"rep_url"` +type ProtoCellPresence struct { + state protoimpl.MessageState `protogen:"open.v1"` + CellId string `protobuf:"bytes,1,opt,name=cell_id,proto3" json:"cell_id,omitempty"` + RepAddress string `protobuf:"bytes,2,opt,name=rep_address,proto3" json:"rep_address,omitempty"` + Zone string `protobuf:"bytes,3,opt,name=zone,proto3" json:"zone,omitempty"` + Capacity *ProtoCellCapacity `protobuf:"bytes,4,opt,name=capacity,proto3" json:"capacity,omitempty"` + RootfsProviders []*ProtoProvider `protobuf:"bytes,5,rep,name=rootfs_providers,json=rootfs_provider_list,proto3" json:"rootfs_providers,omitempty"` + PlacementTags []string `protobuf:"bytes,6,rep,name=placement_tags,proto3" json:"placement_tags,omitempty"` + OptionalPlacementTags []string `protobuf:"bytes,7,rep,name=optional_placement_tags,proto3" json:"optional_placement_tags,omitempty"` + RepUrl string `protobuf:"bytes,8,opt,name=rep_url,proto3" json:"rep_url,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CellPresence) Reset() { *m = CellPresence{} } -func (*CellPresence) ProtoMessage() {} -func (*CellPresence) Descriptor() ([]byte, []int) { - return fileDescriptor_842e821272d22ff7, []int{1} -} -func (m *CellPresence) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CellPresence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CellPresence.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CellPresence) XXX_Merge(src proto.Message) { - xxx_messageInfo_CellPresence.Merge(m, src) -} -func (m *CellPresence) XXX_Size() int { - return m.Size() +func (x *ProtoCellPresence) Reset() { + *x = ProtoCellPresence{} + mi := &file_cells_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CellPresence) XXX_DiscardUnknown() { - xxx_messageInfo_CellPresence.DiscardUnknown(m) -} - -var xxx_messageInfo_CellPresence proto.InternalMessageInfo -func (m *CellPresence) GetCellId() string { - if m != nil { - return m.CellId - } - return "" -} - -func (m *CellPresence) GetRepAddress() string { - if m != nil { - return m.RepAddress - } - return "" +func (x *ProtoCellPresence) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CellPresence) GetZone() string { - if m != nil { - return m.Zone - } - return "" -} +func (*ProtoCellPresence) ProtoMessage() {} -func (m *CellPresence) GetCapacity() *CellCapacity { - if m != nil { - return m.Capacity - } - return nil -} - -func (m *CellPresence) GetRootfsProviders() []*Provider { - if m != nil { - return m.RootfsProviders - } - return nil -} - -func (m *CellPresence) GetPlacementTags() []string { - if m != nil { - return m.PlacementTags +func (x *ProtoCellPresence) ProtoReflect() protoreflect.Message { + mi := &file_cells_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (m *CellPresence) GetOptionalPlacementTags() []string { - if m != nil { - return m.OptionalPlacementTags - } - return nil +// Deprecated: Use ProtoCellPresence.ProtoReflect.Descriptor instead. +func (*ProtoCellPresence) Descriptor() ([]byte, []int) { + return file_cells_proto_rawDescGZIP(), []int{1} } -func (m *CellPresence) GetRepUrl() string { - if m != nil { - return m.RepUrl +func (x *ProtoCellPresence) GetCellId() string { + if x != nil { + return x.CellId } return "" } -type Provider struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` - Properties []string `protobuf:"bytes,2,rep,name=properties,proto3" json:"properties,omitempty"` -} - -func (m *Provider) Reset() { *m = Provider{} } -func (*Provider) ProtoMessage() {} -func (*Provider) Descriptor() ([]byte, []int) { - return fileDescriptor_842e821272d22ff7, []int{2} -} -func (m *Provider) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Provider) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Provider.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ProtoCellPresence) GetRepAddress() string { + if x != nil { + return x.RepAddress } -} -func (m *Provider) XXX_Merge(src proto.Message) { - xxx_messageInfo_Provider.Merge(m, src) -} -func (m *Provider) XXX_Size() int { - return m.Size() -} -func (m *Provider) XXX_DiscardUnknown() { - xxx_messageInfo_Provider.DiscardUnknown(m) + return "" } -var xxx_messageInfo_Provider proto.InternalMessageInfo - -func (m *Provider) GetName() string { - if m != nil { - return m.Name +func (x *ProtoCellPresence) GetZone() string { + if x != nil { + return x.Zone } return "" } -func (m *Provider) GetProperties() []string { - if m != nil { - return m.Properties +func (x *ProtoCellPresence) GetCapacity() *ProtoCellCapacity { + if x != nil { + return x.Capacity } return nil } -type CellsResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - Cells []*CellPresence `protobuf:"bytes,2,rep,name=cells,proto3" json:"cells,omitempty"` -} - -func (m *CellsResponse) Reset() { *m = CellsResponse{} } -func (*CellsResponse) ProtoMessage() {} -func (*CellsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_842e821272d22ff7, []int{3} -} -func (m *CellsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CellsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CellsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CellsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CellsResponse.Merge(m, src) -} -func (m *CellsResponse) XXX_Size() int { - return m.Size() -} -func (m *CellsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CellsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CellsResponse proto.InternalMessageInfo - -func (m *CellsResponse) GetError() *Error { - if m != nil { - return m.Error +func (x *ProtoCellPresence) GetRootfsProviders() []*ProtoProvider { + if x != nil { + return x.RootfsProviders } return nil } -func (m *CellsResponse) GetCells() []*CellPresence { - if m != nil { - return m.Cells +func (x *ProtoCellPresence) GetPlacementTags() []string { + if x != nil { + return x.PlacementTags } return nil } -func init() { - proto.RegisterType((*CellCapacity)(nil), "models.CellCapacity") - proto.RegisterType((*CellPresence)(nil), "models.CellPresence") - proto.RegisterType((*Provider)(nil), "models.Provider") - proto.RegisterType((*CellsResponse)(nil), "models.CellsResponse") -} - -func init() { proto.RegisterFile("cells.proto", fileDescriptor_842e821272d22ff7) } - -var fileDescriptor_842e821272d22ff7 = []byte{ - // 548 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x53, 0x4f, 0x6f, 0xd3, 0x30, - 0x14, 0x4f, 0xe8, 0x9a, 0xb5, 0x0e, 0xdd, 0x26, 0x0b, 0x44, 0x35, 0x21, 0xa7, 0x2a, 0x43, 0xaa, - 0x26, 0xe8, 0xa6, 0x81, 0xb8, 0xd3, 0x09, 0x09, 0x0e, 0x93, 0x26, 0x0b, 0xce, 0x21, 0x7f, 0xde, - 0x4a, 0x44, 0x12, 0x5b, 0xb6, 0x8b, 0x54, 0x4e, 0x7c, 0x84, 0x7d, 0x00, 0x3e, 0x00, 0x1f, 0x85, - 0x63, 0x8f, 0x3b, 0x45, 0x34, 0xbd, 0xa0, 0x9c, 0xf6, 0x11, 0x90, 0x9d, 0x66, 0x2b, 0xbd, 0x58, - 0xbf, 0xf7, 0x7b, 0xbf, 0x67, 0x3f, 0xff, 0x9e, 0x8d, 0xdc, 0x08, 0xd2, 0x54, 0x8e, 0xb9, 0x60, - 0x8a, 0x61, 0x27, 0x63, 0x31, 0xa4, 0xf2, 0xf0, 0xe5, 0x34, 0x51, 0x5f, 0x66, 0xe1, 0x38, 0x62, - 0xd9, 0xc9, 0x94, 0x4d, 0xd9, 0x89, 0x49, 0x87, 0xb3, 0x2b, 0x13, 0x99, 0xc0, 0xa0, 0xba, 0xec, - 0xd0, 0x05, 0x21, 0x98, 0xa8, 0x83, 0xe1, 0xb5, 0x8d, 0x1e, 0x9e, 0x43, 0x9a, 0x9e, 0x07, 0x3c, - 0x88, 0x12, 0x35, 0xc7, 0xc7, 0xa8, 0x9b, 0x41, 0xc6, 0xc4, 0xdc, 0xcf, 0xc2, 0xbe, 0x3d, 0xb0, - 0x47, 0xed, 0x49, 0xaf, 0x2a, 0xbc, 0x7b, 0x92, 0x76, 0x6a, 0x78, 0x11, 0xe2, 0x23, 0xb4, 0x1b, - 0x27, 0xf2, 0xab, 0x56, 0x3e, 0x30, 0x4a, 0xb7, 0x2a, 0xbc, 0x86, 0xa2, 0x8e, 0x06, 0x17, 0x21, - 0x1e, 0x23, 0x14, 0xb1, 0x5c, 0x05, 0x49, 0x0e, 0x42, 0xf6, 0x5b, 0x46, 0xb8, 0x57, 0x15, 0xde, - 0x06, 0x4b, 0x37, 0xf0, 0xf0, 0x67, 0xab, 0x6e, 0xe9, 0x52, 0x80, 0x84, 0x3c, 0x02, 0x7d, 0x8c, - 0xbe, 0xb6, 0x9f, 0xc4, 0xa6, 0xa1, 0x6e, 0x7d, 0xcc, 0x9a, 0xa2, 0x8e, 0x06, 0x1f, 0x62, 0x7c, - 0x8a, 0x5c, 0x01, 0xdc, 0x0f, 0xe2, 0x58, 0x80, 0x94, 0xa6, 0xa1, 0xee, 0x64, 0xbf, 0x2a, 0xbc, - 0x4d, 0x9a, 0x22, 0x01, 0xfc, 0x6d, 0x8d, 0xf1, 0x53, 0xb4, 0xf3, 0x9d, 0xe5, 0x60, 0x5a, 0xea, - 0x4e, 0x3a, 0x55, 0xe1, 0x99, 0x98, 0x9a, 0x15, 0x9f, 0xa2, 0x4e, 0xb4, 0x36, 0xa5, 0xbf, 0x33, - 0xb0, 0x47, 0xee, 0xd9, 0xa3, 0x71, 0x6d, 0xf8, 0x78, 0xd3, 0x30, 0x7a, 0xa7, 0xc2, 0x3e, 0x3a, - 0x10, 0x8c, 0xa9, 0x2b, 0xe9, 0x73, 0xc1, 0xbe, 0x25, 0xb1, 0xbe, 0x6e, 0x7b, 0xd0, 0x1a, 0xb9, - 0x67, 0x07, 0x4d, 0xe5, 0xe5, 0x3a, 0x31, 0x19, 0x56, 0x85, 0x47, 0xb6, 0xd4, 0x7e, 0x9a, 0x48, - 0xf5, 0x82, 0x65, 0x89, 0x82, 0x8c, 0xab, 0x39, 0xdd, 0xaf, 0xf3, 0x4d, 0x8d, 0xc4, 0xcf, 0xd1, - 0x1e, 0x4f, 0x83, 0x08, 0x32, 0xc8, 0x95, 0xaf, 0x82, 0xa9, 0xec, 0x3b, 0x83, 0xd6, 0xa8, 0x4b, - 0x7b, 0x77, 0xec, 0xc7, 0x60, 0x2a, 0xf1, 0x1b, 0xf4, 0x84, 0x71, 0x95, 0xb0, 0x3c, 0x48, 0xfd, - 0x2d, 0xfd, 0xae, 0xd1, 0x3f, 0x6e, 0xd2, 0x97, 0xff, 0xd5, 0x1d, 0xa1, 0x5d, 0x6d, 0xd5, 0x4c, - 0xa4, 0xfd, 0xce, 0xbd, 0xcf, 0x6b, 0x8a, 0x3a, 0x02, 0xf8, 0x27, 0x91, 0x0e, 0xdf, 0xa3, 0x4e, - 0xd3, 0x91, 0x76, 0x30, 0x0f, 0x32, 0x58, 0x8f, 0xc5, 0x38, 0xa8, 0x63, 0x6a, 0x56, 0x4c, 0x10, - 0xe2, 0x82, 0x71, 0x10, 0x2a, 0x01, 0x3d, 0x10, 0x7d, 0xf4, 0x06, 0x33, 0xfc, 0x8c, 0x7a, 0xda, - 0x49, 0x49, 0x41, 0x72, 0x96, 0x4b, 0xc0, 0xcf, 0x50, 0xdb, 0xbc, 0x4d, 0xb3, 0x9f, 0x7b, 0xd6, - 0x6b, 0x5c, 0x7b, 0xa7, 0x49, 0x5a, 0xe7, 0xf0, 0x31, 0x6a, 0x9b, 0x4f, 0x60, 0x36, 0xdc, 0x1a, - 0x4a, 0xf3, 0x64, 0x68, 0x2d, 0x99, 0xbc, 0x5e, 0x2c, 0x89, 0x75, 0xb3, 0x24, 0xd6, 0xed, 0x92, - 0xd8, 0x3f, 0x4a, 0x62, 0xff, 0x2a, 0x89, 0xfd, 0xbb, 0x24, 0xf6, 0xa2, 0x24, 0xf6, 0x9f, 0x92, - 0xd8, 0x7f, 0x4b, 0x62, 0xdd, 0x96, 0xc4, 0xbe, 0x5e, 0x11, 0x6b, 0xb1, 0x22, 0xd6, 0xcd, 0x8a, - 0x58, 0xa1, 0x63, 0xbe, 0xc6, 0xab, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x12, 0x8c, 0x77, 0x8d, - 0x6d, 0x03, 0x00, 0x00, -} - -func (this *CellCapacity) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*CellCapacity) - if !ok { - that2, ok := that.(CellCapacity) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.MemoryMb != that1.MemoryMb { - return false - } - if this.DiskMb != that1.DiskMb { - return false - } - if this.Containers != that1.Containers { - return false - } - return true -} -func (this *CellPresence) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*CellPresence) - if !ok { - that2, ok := that.(CellPresence) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.CellId != that1.CellId { - return false - } - if this.RepAddress != that1.RepAddress { - return false - } - if this.Zone != that1.Zone { - return false - } - if !this.Capacity.Equal(that1.Capacity) { - return false - } - if len(this.RootfsProviders) != len(that1.RootfsProviders) { - return false - } - for i := range this.RootfsProviders { - if !this.RootfsProviders[i].Equal(that1.RootfsProviders[i]) { - return false - } - } - if len(this.PlacementTags) != len(that1.PlacementTags) { - return false +func (x *ProtoCellPresence) GetOptionalPlacementTags() []string { + if x != nil { + return x.OptionalPlacementTags } - for i := range this.PlacementTags { - if this.PlacementTags[i] != that1.PlacementTags[i] { - return false - } - } - if len(this.OptionalPlacementTags) != len(that1.OptionalPlacementTags) { - return false - } - for i := range this.OptionalPlacementTags { - if this.OptionalPlacementTags[i] != that1.OptionalPlacementTags[i] { - return false - } - } - if this.RepUrl != that1.RepUrl { - return false - } - return true -} -func (this *Provider) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Provider) - if !ok { - that2, ok := that.(Provider) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if len(this.Properties) != len(that1.Properties) { - return false - } - for i := range this.Properties { - if this.Properties[i] != that1.Properties[i] { - return false - } - } - return true + return nil } -func (this *CellsResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*CellsResponse) - if !ok { - that2, ok := that.(CellsResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Error.Equal(that1.Error) { - return false - } - if len(this.Cells) != len(that1.Cells) { - return false - } - for i := range this.Cells { - if !this.Cells[i].Equal(that1.Cells[i]) { - return false - } - } - return true -} -func (this *CellCapacity) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&models.CellCapacity{") - s = append(s, "MemoryMb: "+fmt.Sprintf("%#v", this.MemoryMb)+",\n") - s = append(s, "DiskMb: "+fmt.Sprintf("%#v", this.DiskMb)+",\n") - s = append(s, "Containers: "+fmt.Sprintf("%#v", this.Containers)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *CellPresence) GoString() string { - if this == nil { - return "nil" +func (x *ProtoCellPresence) GetRepUrl() string { + if x != nil { + return x.RepUrl } - s := make([]string, 0, 12) - s = append(s, "&models.CellPresence{") - s = append(s, "CellId: "+fmt.Sprintf("%#v", this.CellId)+",\n") - s = append(s, "RepAddress: "+fmt.Sprintf("%#v", this.RepAddress)+",\n") - s = append(s, "Zone: "+fmt.Sprintf("%#v", this.Zone)+",\n") - if this.Capacity != nil { - s = append(s, "Capacity: "+fmt.Sprintf("%#v", this.Capacity)+",\n") - } - if this.RootfsProviders != nil { - s = append(s, "RootfsProviders: "+fmt.Sprintf("%#v", this.RootfsProviders)+",\n") - } - s = append(s, "PlacementTags: "+fmt.Sprintf("%#v", this.PlacementTags)+",\n") - s = append(s, "OptionalPlacementTags: "+fmt.Sprintf("%#v", this.OptionalPlacementTags)+",\n") - s = append(s, "RepUrl: "+fmt.Sprintf("%#v", this.RepUrl)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Provider) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.Provider{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "Properties: "+fmt.Sprintf("%#v", this.Properties)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *CellsResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.CellsResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - if this.Cells != nil { - s = append(s, "Cells: "+fmt.Sprintf("%#v", this.Cells)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringCells(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *CellCapacity) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + return "" } -func (m *CellCapacity) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type ProtoProvider struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Properties []string `protobuf:"bytes,2,rep,name=properties,proto3" json:"properties,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CellCapacity) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Containers != 0 { - i = encodeVarintCells(dAtA, i, uint64(m.Containers)) - i-- - dAtA[i] = 0x18 - } - if m.DiskMb != 0 { - i = encodeVarintCells(dAtA, i, uint64(m.DiskMb)) - i-- - dAtA[i] = 0x10 - } - if m.MemoryMb != 0 { - i = encodeVarintCells(dAtA, i, uint64(m.MemoryMb)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil +func (x *ProtoProvider) Reset() { + *x = ProtoProvider{} + mi := &file_cells_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CellPresence) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *ProtoProvider) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CellPresence) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func (*ProtoProvider) ProtoMessage() {} -func (m *CellPresence) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RepUrl) > 0 { - i -= len(m.RepUrl) - copy(dAtA[i:], m.RepUrl) - i = encodeVarintCells(dAtA, i, uint64(len(m.RepUrl))) - i-- - dAtA[i] = 0x42 - } - if len(m.OptionalPlacementTags) > 0 { - for iNdEx := len(m.OptionalPlacementTags) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.OptionalPlacementTags[iNdEx]) - copy(dAtA[i:], m.OptionalPlacementTags[iNdEx]) - i = encodeVarintCells(dAtA, i, uint64(len(m.OptionalPlacementTags[iNdEx]))) - i-- - dAtA[i] = 0x3a - } - } - if len(m.PlacementTags) > 0 { - for iNdEx := len(m.PlacementTags) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PlacementTags[iNdEx]) - copy(dAtA[i:], m.PlacementTags[iNdEx]) - i = encodeVarintCells(dAtA, i, uint64(len(m.PlacementTags[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.RootfsProviders) > 0 { - for iNdEx := len(m.RootfsProviders) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RootfsProviders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCells(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.Capacity != nil { - { - size, err := m.Capacity.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCells(dAtA, i, uint64(size)) +func (x *ProtoProvider) ProtoReflect() protoreflect.Message { + mi := &file_cells_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - i-- - dAtA[i] = 0x22 - } - if len(m.Zone) > 0 { - i -= len(m.Zone) - copy(dAtA[i:], m.Zone) - i = encodeVarintCells(dAtA, i, uint64(len(m.Zone))) - i-- - dAtA[i] = 0x1a + return ms } - if len(m.RepAddress) > 0 { - i -= len(m.RepAddress) - copy(dAtA[i:], m.RepAddress) - i = encodeVarintCells(dAtA, i, uint64(len(m.RepAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.CellId) > 0 { - i -= len(m.CellId) - copy(dAtA[i:], m.CellId) - i = encodeVarintCells(dAtA, i, uint64(len(m.CellId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *Provider) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +// Deprecated: Use ProtoProvider.ProtoReflect.Descriptor instead. +func (*ProtoProvider) Descriptor() ([]byte, []int) { + return file_cells_proto_rawDescGZIP(), []int{2} } -func (m *Provider) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Provider) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Properties) > 0 { - for iNdEx := len(m.Properties) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Properties[iNdEx]) - copy(dAtA[i:], m.Properties[iNdEx]) - i = encodeVarintCells(dAtA, i, uint64(len(m.Properties[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintCells(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa +func (x *ProtoProvider) GetName() string { + if x != nil { + return x.Name } - return len(dAtA) - i, nil + return "" } -func (m *CellsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoProvider) GetProperties() []string { + if x != nil { + return x.Properties } - return dAtA[:n], nil -} - -func (m *CellsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return nil } -func (m *CellsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Cells) > 0 { - for iNdEx := len(m.Cells) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Cells[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCells(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCells(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +type ProtoCellsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Cells []*ProtoCellPresence `protobuf:"bytes,2,rep,name=cells,proto3" json:"cells,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func encodeVarintCells(dAtA []byte, offset int, v uint64) int { - offset -= sovCells(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *CellCapacity) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MemoryMb != 0 { - n += 1 + sovCells(uint64(m.MemoryMb)) - } - if m.DiskMb != 0 { - n += 1 + sovCells(uint64(m.DiskMb)) - } - if m.Containers != 0 { - n += 1 + sovCells(uint64(m.Containers)) - } - return n +func (x *ProtoCellsResponse) Reset() { + *x = ProtoCellsResponse{} + mi := &file_cells_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CellPresence) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.CellId) - if l > 0 { - n += 1 + l + sovCells(uint64(l)) - } - l = len(m.RepAddress) - if l > 0 { - n += 1 + l + sovCells(uint64(l)) - } - l = len(m.Zone) - if l > 0 { - n += 1 + l + sovCells(uint64(l)) - } - if m.Capacity != nil { - l = m.Capacity.Size() - n += 1 + l + sovCells(uint64(l)) - } - if len(m.RootfsProviders) > 0 { - for _, e := range m.RootfsProviders { - l = e.Size() - n += 1 + l + sovCells(uint64(l)) - } - } - if len(m.PlacementTags) > 0 { - for _, s := range m.PlacementTags { - l = len(s) - n += 1 + l + sovCells(uint64(l)) - } - } - if len(m.OptionalPlacementTags) > 0 { - for _, s := range m.OptionalPlacementTags { - l = len(s) - n += 1 + l + sovCells(uint64(l)) - } - } - l = len(m.RepUrl) - if l > 0 { - n += 1 + l + sovCells(uint64(l)) - } - return n +func (x *ProtoCellsResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Provider) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovCells(uint64(l)) - } - if len(m.Properties) > 0 { - for _, s := range m.Properties { - l = len(s) - n += 1 + l + sovCells(uint64(l)) - } - } - return n -} +func (*ProtoCellsResponse) ProtoMessage() {} -func (m *CellsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovCells(uint64(l)) - } - if len(m.Cells) > 0 { - for _, e := range m.Cells { - l = e.Size() - n += 1 + l + sovCells(uint64(l)) +func (x *ProtoCellsResponse) ProtoReflect() protoreflect.Message { + mi := &file_cells_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return n + return mi.MessageOf(x) } -func sovCells(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCells(x uint64) (n int) { - return sovCells(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *CellCapacity) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CellCapacity{`, - `MemoryMb:` + fmt.Sprintf("%v", this.MemoryMb) + `,`, - `DiskMb:` + fmt.Sprintf("%v", this.DiskMb) + `,`, - `Containers:` + fmt.Sprintf("%v", this.Containers) + `,`, - `}`, - }, "") - return s -} -func (this *CellPresence) String() string { - if this == nil { - return "nil" - } - repeatedStringForRootfsProviders := "[]*Provider{" - for _, f := range this.RootfsProviders { - repeatedStringForRootfsProviders += strings.Replace(f.String(), "Provider", "Provider", 1) + "," - } - repeatedStringForRootfsProviders += "}" - s := strings.Join([]string{`&CellPresence{`, - `CellId:` + fmt.Sprintf("%v", this.CellId) + `,`, - `RepAddress:` + fmt.Sprintf("%v", this.RepAddress) + `,`, - `Zone:` + fmt.Sprintf("%v", this.Zone) + `,`, - `Capacity:` + strings.Replace(this.Capacity.String(), "CellCapacity", "CellCapacity", 1) + `,`, - `RootfsProviders:` + repeatedStringForRootfsProviders + `,`, - `PlacementTags:` + fmt.Sprintf("%v", this.PlacementTags) + `,`, - `OptionalPlacementTags:` + fmt.Sprintf("%v", this.OptionalPlacementTags) + `,`, - `RepUrl:` + fmt.Sprintf("%v", this.RepUrl) + `,`, - `}`, - }, "") - return s +// Deprecated: Use ProtoCellsResponse.ProtoReflect.Descriptor instead. +func (*ProtoCellsResponse) Descriptor() ([]byte, []int) { + return file_cells_proto_rawDescGZIP(), []int{3} } -func (this *Provider) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Provider{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Properties:` + fmt.Sprintf("%v", this.Properties) + `,`, - `}`, - }, "") - return s -} -func (this *CellsResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForCells := "[]*CellPresence{" - for _, f := range this.Cells { - repeatedStringForCells += strings.Replace(f.String(), "CellPresence", "CellPresence", 1) + "," - } - repeatedStringForCells += "}" - s := strings.Join([]string{`&CellsResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `Cells:` + repeatedStringForCells + `,`, - `}`, - }, "") - return s -} -func valueToStringCells(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *CellCapacity) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CellCapacity: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CellCapacity: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemoryMb", wireType) - } - m.MemoryMb = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MemoryMb |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskMb", wireType) - } - m.DiskMb = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DiskMb |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Containers", wireType) - } - m.Containers = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Containers |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipCells(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCells - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoCellsResponse) GetError() *ProtoError { + if x != nil { + return x.Error } return nil } -func (m *CellPresence) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CellPresence: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CellPresence: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CellId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCells - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCells - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CellId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RepAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCells - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCells - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RepAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Zone", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCells - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCells - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Zone = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCells - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCells - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Capacity == nil { - m.Capacity = &CellCapacity{} - } - if err := m.Capacity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RootfsProviders", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCells - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCells - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RootfsProviders = append(m.RootfsProviders, &Provider{}) - if err := m.RootfsProviders[len(m.RootfsProviders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlacementTags", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCells - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCells - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PlacementTags = append(m.PlacementTags, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OptionalPlacementTags", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCells - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCells - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OptionalPlacementTags = append(m.OptionalPlacementTags, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RepUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCells - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCells - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RepUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCells(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCells - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Provider) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Provider: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Provider: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCells - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCells - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Properties", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCells - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCells - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Properties = append(m.Properties, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCells(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCells - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoCellsResponse) GetCells() []*ProtoCellPresence { + if x != nil { + return x.Cells } return nil } -func (m *CellsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CellsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CellsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCells - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCells - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cells", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCells - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCells - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCells - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cells = append(m.Cells, &CellPresence{}) - if err := m.Cells[len(m.Cells)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCells(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCells - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCells(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCells - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCells - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCells - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthCells - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCells - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthCells - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +var File_cells_proto protoreflect.FileDescriptor + +const file_cells_proto_rawDesc = "" + + "\n" + + "\vcells.proto\x12\x06models\x1a\tbbs.proto\x1a\verror.proto\"z\n" + + "\x11ProtoCellCapacity\x12!\n" + + "\tmemory_mb\x18\x01 \x01(\x05B\x03\xc0>\x01R\tmemory_mb\x12\x1d\n" + + "\adisk_mb\x18\x02 \x01(\x05B\x03\xc0>\x01R\adisk_mb\x12#\n" + + "\n" + + "containers\x18\x03 \x01(\x05B\x03\xc0>\x01R\n" + + "containers\"\xf1\x02\n" + + "\x11ProtoCellPresence\x12\x1d\n" + + "\acell_id\x18\x01 \x01(\tB\x03\xc0>\x01R\acell_id\x12%\n" + + "\vrep_address\x18\x02 \x01(\tB\x03\xc0>\x01R\vrep_address\x12\x17\n" + + "\x04zone\x18\x03 \x01(\tB\x03\xc0>\x01R\x04zone\x125\n" + + "\bcapacity\x18\x04 \x01(\v2\x19.models.ProtoCellCapacityR\bcapacity\x12E\n" + + "\x10rootfs_providers\x18\x05 \x03(\v2\x15.models.ProtoProviderR\x14rootfs_provider_list\x12&\n" + + "\x0eplacement_tags\x18\x06 \x03(\tR\x0eplacement_tags\x128\n" + + "\x17optional_placement_tags\x18\a \x03(\tR\x17optional_placement_tags\x12\x1d\n" + + "\arep_url\x18\b \x01(\tB\x03\xc0>\x01R\arep_url\"H\n" + + "\rProtoProvider\x12\x17\n" + + "\x04name\x18\x01 \x01(\tB\x03\xc0>\x01R\x04name\x12\x1e\n" + + "\n" + + "properties\x18\x02 \x03(\tR\n" + + "properties\"o\n" + + "\x12ProtoCellsResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\x12/\n" + + "\x05cells\x18\x02 \x03(\v2\x19.models.ProtoCellPresenceR\x05cellsB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthCells = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCells = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCells = fmt.Errorf("proto: unexpected end of group") + file_cells_proto_rawDescOnce sync.Once + file_cells_proto_rawDescData []byte ) + +func file_cells_proto_rawDescGZIP() []byte { + file_cells_proto_rawDescOnce.Do(func() { + file_cells_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cells_proto_rawDesc), len(file_cells_proto_rawDesc))) + }) + return file_cells_proto_rawDescData +} + +var file_cells_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cells_proto_goTypes = []any{ + (*ProtoCellCapacity)(nil), // 0: models.ProtoCellCapacity + (*ProtoCellPresence)(nil), // 1: models.ProtoCellPresence + (*ProtoProvider)(nil), // 2: models.ProtoProvider + (*ProtoCellsResponse)(nil), // 3: models.ProtoCellsResponse + (*ProtoError)(nil), // 4: models.ProtoError +} +var file_cells_proto_depIdxs = []int32{ + 0, // 0: models.ProtoCellPresence.capacity:type_name -> models.ProtoCellCapacity + 2, // 1: models.ProtoCellPresence.rootfs_providers:type_name -> models.ProtoProvider + 4, // 2: models.ProtoCellsResponse.error:type_name -> models.ProtoError + 1, // 3: models.ProtoCellsResponse.cells:type_name -> models.ProtoCellPresence + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_cells_proto_init() } +func file_cells_proto_init() { + if File_cells_proto != nil { + return + } + file_bbs_proto_init() + file_error_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_cells_proto_rawDesc), len(file_cells_proto_rawDesc)), + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cells_proto_goTypes, + DependencyIndexes: file_cells_proto_depIdxs, + MessageInfos: file_cells_proto_msgTypes, + }.Build() + File_cells_proto = out.File + file_cells_proto_goTypes = nil + file_cells_proto_depIdxs = nil +} diff --git a/models/cells.proto b/models/cells.proto index e73a028a..6d8d6a52 100644 --- a/models/cells.proto +++ b/models/cells.proto @@ -1,33 +1,34 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; import "error.proto"; -message CellCapacity { - int32 memory_mb = 1 [(gogoproto.jsontag) = "memory_mb"]; - int32 disk_mb = 2 [(gogoproto.jsontag) = "disk_mb"]; - int32 containers = 3 [(gogoproto.jsontag) = "containers"]; +message ProtoCellCapacity { + int32 memory_mb = 1 [json_name = "memory_mb", (bbs.bbs_json_always_emit) = true]; + int32 disk_mb = 2 [json_name = "disk_mb", (bbs.bbs_json_always_emit) = true]; + int32 containers = 3 [json_name = "containers", (bbs.bbs_json_always_emit) = true]; } -message CellPresence { - string cell_id = 1 [(gogoproto.jsontag) = "cell_id"]; - string rep_address = 2 [(gogoproto.jsontag) = "rep_address"]; - string zone = 3 [(gogoproto.jsontag) = "zone"]; - CellCapacity capacity = 4; - repeated Provider rootfs_providers = 5 [(gogoproto.jsontag) = "rootfs_provider_list,omitempty"]; - repeated string placement_tags = 6; - repeated string optional_placement_tags = 7; - string rep_url = 8 [(gogoproto.jsontag) = "rep_url"]; +message ProtoCellPresence { + string cell_id = 1 [json_name = "cell_id", (bbs.bbs_json_always_emit) = true]; + string rep_address = 2 [json_name = "rep_address", (bbs.bbs_json_always_emit) = true]; + string zone = 3 [json_name = "zone", (bbs.bbs_json_always_emit) = true]; + ProtoCellCapacity capacity = 4; + repeated ProtoProvider rootfs_providers = 5 [json_name = "rootfs_provider_list"]; + repeated string placement_tags = 6 [json_name = "placement_tags"]; + repeated string optional_placement_tags = 7 [json_name = "optional_placement_tags"]; + string rep_url = 8 [json_name = "rep_url", (bbs.bbs_json_always_emit) = true]; } -message Provider { - string name = 1 [(gogoproto.jsontag) = "name"]; +message ProtoProvider { + string name = 1 [json_name = "name", (bbs.bbs_json_always_emit) = true]; repeated string properties = 2; } -message CellsResponse { - Error error = 1; - repeated CellPresence cells = 2; +message ProtoCellsResponse { + ProtoError error = 1; + repeated ProtoCellPresence cells = 2; } diff --git a/models/cells_bbs.pb.go b/models/cells_bbs.pb.go new file mode 100644 index 00000000..2be018f5 --- /dev/null +++ b/models/cells_bbs.pb.go @@ -0,0 +1,611 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: cells.proto + +package models + +// Prevent copylock errors when using ProtoCellCapacity directly +type CellCapacity struct { + MemoryMb int32 `json:"memory_mb"` + DiskMb int32 `json:"disk_mb"` + Containers int32 `json:"containers"` +} + +func (this *CellCapacity) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*CellCapacity) + if !ok { + that2, ok := that.(CellCapacity) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.MemoryMb != that1.MemoryMb { + return false + } + if this.DiskMb != that1.DiskMb { + return false + } + if this.Containers != that1.Containers { + return false + } + return true +} +func (m *CellCapacity) GetMemoryMb() int32 { + if m != nil { + return m.MemoryMb + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *CellCapacity) SetMemoryMb(value int32) { + if m != nil { + m.MemoryMb = value + } +} +func (m *CellCapacity) GetDiskMb() int32 { + if m != nil { + return m.DiskMb + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *CellCapacity) SetDiskMb(value int32) { + if m != nil { + m.DiskMb = value + } +} +func (m *CellCapacity) GetContainers() int32 { + if m != nil { + return m.Containers + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *CellCapacity) SetContainers(value int32) { + if m != nil { + m.Containers = value + } +} +func (x *CellCapacity) ToProto() *ProtoCellCapacity { + if x == nil { + return nil + } + + proto := &ProtoCellCapacity{ + MemoryMb: x.MemoryMb, + DiskMb: x.DiskMb, + Containers: x.Containers, + } + return proto +} + +func (x *ProtoCellCapacity) FromProto() *CellCapacity { + if x == nil { + return nil + } + + copysafe := &CellCapacity{ + MemoryMb: x.MemoryMb, + DiskMb: x.DiskMb, + Containers: x.Containers, + } + return copysafe +} + +func CellCapacityToProtoSlice(values []*CellCapacity) []*ProtoCellCapacity { + if values == nil { + return nil + } + result := make([]*ProtoCellCapacity, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func CellCapacityFromProtoSlice(values []*ProtoCellCapacity) []*CellCapacity { + if values == nil { + return nil + } + result := make([]*CellCapacity, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoCellPresence directly +type CellPresence struct { + CellId string `json:"cell_id"` + RepAddress string `json:"rep_address"` + Zone string `json:"zone"` + Capacity *CellCapacity `json:"capacity,omitempty"` + RootfsProviders []*Provider `json:"rootfs_provider_list,omitempty"` + PlacementTags []string `json:"placement_tags,omitempty"` + OptionalPlacementTags []string `json:"optional_placement_tags,omitempty"` + RepUrl string `json:"rep_url"` +} + +func (this *CellPresence) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*CellPresence) + if !ok { + that2, ok := that.(CellPresence) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.CellId != that1.CellId { + return false + } + if this.RepAddress != that1.RepAddress { + return false + } + if this.Zone != that1.Zone { + return false + } + if this.Capacity == nil { + if that1.Capacity != nil { + return false + } + } else if !this.Capacity.Equal(*that1.Capacity) { + return false + } + if this.RootfsProviders == nil { + if that1.RootfsProviders != nil { + return false + } + } else if len(this.RootfsProviders) != len(that1.RootfsProviders) { + return false + } + for i := range this.RootfsProviders { + if !this.RootfsProviders[i].Equal(that1.RootfsProviders[i]) { + return false + } + } + if this.PlacementTags == nil { + if that1.PlacementTags != nil { + return false + } + } else if len(this.PlacementTags) != len(that1.PlacementTags) { + return false + } + for i := range this.PlacementTags { + if this.PlacementTags[i] != that1.PlacementTags[i] { + return false + } + } + if this.OptionalPlacementTags == nil { + if that1.OptionalPlacementTags != nil { + return false + } + } else if len(this.OptionalPlacementTags) != len(that1.OptionalPlacementTags) { + return false + } + for i := range this.OptionalPlacementTags { + if this.OptionalPlacementTags[i] != that1.OptionalPlacementTags[i] { + return false + } + } + if this.RepUrl != that1.RepUrl { + return false + } + return true +} +func (m *CellPresence) GetCellId() string { + if m != nil { + return m.CellId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CellPresence) SetCellId(value string) { + if m != nil { + m.CellId = value + } +} +func (m *CellPresence) GetRepAddress() string { + if m != nil { + return m.RepAddress + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CellPresence) SetRepAddress(value string) { + if m != nil { + m.RepAddress = value + } +} +func (m *CellPresence) GetZone() string { + if m != nil { + return m.Zone + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CellPresence) SetZone(value string) { + if m != nil { + m.Zone = value + } +} +func (m *CellPresence) GetCapacity() *CellCapacity { + if m != nil { + return m.Capacity + } + return nil +} +func (m *CellPresence) SetCapacity(value *CellCapacity) { + if m != nil { + m.Capacity = value + } +} +func (m *CellPresence) GetRootfsProviders() []*Provider { + if m != nil { + return m.RootfsProviders + } + return nil +} +func (m *CellPresence) SetRootfsProviders(value []*Provider) { + if m != nil { + m.RootfsProviders = value + } +} +func (m *CellPresence) GetPlacementTags() []string { + if m != nil { + return m.PlacementTags + } + return nil +} +func (m *CellPresence) SetPlacementTags(value []string) { + if m != nil { + m.PlacementTags = value + } +} +func (m *CellPresence) GetOptionalPlacementTags() []string { + if m != nil { + return m.OptionalPlacementTags + } + return nil +} +func (m *CellPresence) SetOptionalPlacementTags(value []string) { + if m != nil { + m.OptionalPlacementTags = value + } +} +func (m *CellPresence) GetRepUrl() string { + if m != nil { + return m.RepUrl + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CellPresence) SetRepUrl(value string) { + if m != nil { + m.RepUrl = value + } +} +func (x *CellPresence) ToProto() *ProtoCellPresence { + if x == nil { + return nil + } + + proto := &ProtoCellPresence{ + CellId: x.CellId, + RepAddress: x.RepAddress, + Zone: x.Zone, + Capacity: x.Capacity.ToProto(), + RootfsProviders: ProviderToProtoSlice(x.RootfsProviders), + PlacementTags: x.PlacementTags, + OptionalPlacementTags: x.OptionalPlacementTags, + RepUrl: x.RepUrl, + } + return proto +} + +func (x *ProtoCellPresence) FromProto() *CellPresence { + if x == nil { + return nil + } + + copysafe := &CellPresence{ + CellId: x.CellId, + RepAddress: x.RepAddress, + Zone: x.Zone, + Capacity: x.Capacity.FromProto(), + RootfsProviders: ProviderFromProtoSlice(x.RootfsProviders), + PlacementTags: x.PlacementTags, + OptionalPlacementTags: x.OptionalPlacementTags, + RepUrl: x.RepUrl, + } + return copysafe +} + +func CellPresenceToProtoSlice(values []*CellPresence) []*ProtoCellPresence { + if values == nil { + return nil + } + result := make([]*ProtoCellPresence, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func CellPresenceFromProtoSlice(values []*ProtoCellPresence) []*CellPresence { + if values == nil { + return nil + } + result := make([]*CellPresence, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoProvider directly +type Provider struct { + Name string `json:"name"` + Properties []string `json:"properties,omitempty"` +} + +func (this *Provider) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*Provider) + if !ok { + that2, ok := that.(Provider) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Name != that1.Name { + return false + } + if this.Properties == nil { + if that1.Properties != nil { + return false + } + } else if len(this.Properties) != len(that1.Properties) { + return false + } + for i := range this.Properties { + if this.Properties[i] != that1.Properties[i] { + return false + } + } + return true +} +func (m *Provider) GetName() string { + if m != nil { + return m.Name + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *Provider) SetName(value string) { + if m != nil { + m.Name = value + } +} +func (m *Provider) GetProperties() []string { + if m != nil { + return m.Properties + } + return nil +} +func (m *Provider) SetProperties(value []string) { + if m != nil { + m.Properties = value + } +} +func (x *Provider) ToProto() *ProtoProvider { + if x == nil { + return nil + } + + proto := &ProtoProvider{ + Name: x.Name, + Properties: x.Properties, + } + return proto +} + +func (x *ProtoProvider) FromProto() *Provider { + if x == nil { + return nil + } + + copysafe := &Provider{ + Name: x.Name, + Properties: x.Properties, + } + return copysafe +} + +func ProviderToProtoSlice(values []*Provider) []*ProtoProvider { + if values == nil { + return nil + } + result := make([]*ProtoProvider, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ProviderFromProtoSlice(values []*ProtoProvider) []*Provider { + if values == nil { + return nil + } + result := make([]*Provider, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoCellsResponse directly +type CellsResponse struct { + Error *Error `json:"error,omitempty"` + Cells []*CellPresence `json:"cells,omitempty"` +} + +func (this *CellsResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*CellsResponse) + if !ok { + that2, ok := that.(CellsResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + if this.Cells == nil { + if that1.Cells != nil { + return false + } + } else if len(this.Cells) != len(that1.Cells) { + return false + } + for i := range this.Cells { + if !this.Cells[i].Equal(that1.Cells[i]) { + return false + } + } + return true +} +func (m *CellsResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *CellsResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (m *CellsResponse) GetCells() []*CellPresence { + if m != nil { + return m.Cells + } + return nil +} +func (m *CellsResponse) SetCells(value []*CellPresence) { + if m != nil { + m.Cells = value + } +} +func (x *CellsResponse) ToProto() *ProtoCellsResponse { + if x == nil { + return nil + } + + proto := &ProtoCellsResponse{ + Error: x.Error.ToProto(), + Cells: CellPresenceToProtoSlice(x.Cells), + } + return proto +} + +func (x *ProtoCellsResponse) FromProto() *CellsResponse { + if x == nil { + return nil + } + + copysafe := &CellsResponse{ + Error: x.Error.FromProto(), + Cells: CellPresenceFromProtoSlice(x.Cells), + } + return copysafe +} + +func CellsResponseToProtoSlice(values []*CellsResponse) []*ProtoCellsResponse { + if values == nil { + return nil + } + result := make([]*ProtoCellsResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func CellsResponseFromProtoSlice(values []*ProtoCellsResponse) []*CellsResponse { + if values == nil { + return nil + } + result := make([]*CellsResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/certificate_properties.pb.go b/models/certificate_properties.pb.go index 7815f28f..70429688 100644 --- a/models/certificate_properties.pb.go +++ b/models/certificate_properties.pb.go @@ -1,385 +1,122 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: certificate_properties.proto package models import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type CertificateProperties struct { - OrganizationalUnit []string `protobuf:"bytes,1,rep,name=organizational_unit,json=organizationalUnit,proto3" json:"organizational_unit,omitempty"` -} - -func (m *CertificateProperties) Reset() { *m = CertificateProperties{} } -func (*CertificateProperties) ProtoMessage() {} -func (*CertificateProperties) Descriptor() ([]byte, []int) { - return fileDescriptor_9291b57c1fe01997, []int{0} -} -func (m *CertificateProperties) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CertificateProperties) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CertificateProperties.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CertificateProperties) XXX_Merge(src proto.Message) { - xxx_messageInfo_CertificateProperties.Merge(m, src) -} -func (m *CertificateProperties) XXX_Size() int { - return m.Size() -} -func (m *CertificateProperties) XXX_DiscardUnknown() { - xxx_messageInfo_CertificateProperties.DiscardUnknown(m) -} - -var xxx_messageInfo_CertificateProperties proto.InternalMessageInfo +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -func (m *CertificateProperties) GetOrganizationalUnit() []string { - if m != nil { - return m.OrganizationalUnit - } - return nil +type ProtoCertificateProperties struct { + state protoimpl.MessageState `protogen:"open.v1"` + OrganizationalUnit []string `protobuf:"bytes,1,rep,name=organizational_unit,proto3" json:"organizational_unit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { - proto.RegisterType((*CertificateProperties)(nil), "models.CertificateProperties") +func (x *ProtoCertificateProperties) Reset() { + *x = ProtoCertificateProperties{} + mi := &file_certificate_properties_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func init() { proto.RegisterFile("certificate_properties.proto", fileDescriptor_9291b57c1fe01997) } - -var fileDescriptor_9291b57c1fe01997 = []byte{ - // 169 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0x4e, 0x2d, 0x2a, - 0xc9, 0x4c, 0xcb, 0x4c, 0x4e, 0x2c, 0x49, 0x8d, 0x2f, 0x28, 0xca, 0x2f, 0x00, 0x71, 0x53, 0x8b, - 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xd8, 0x72, 0xf3, 0x53, 0x52, 0x73, 0x8a, 0x95, 0x3c, - 0xb8, 0x44, 0x9d, 0x11, 0xea, 0x02, 0xe0, 0xca, 0x84, 0xf4, 0xb9, 0x84, 0xf3, 0x8b, 0xd2, 0x13, - 0xf3, 0x32, 0xab, 0x12, 0x4b, 0x32, 0xf3, 0xf3, 0x12, 0x73, 0xe2, 0x4b, 0xf3, 0x32, 0x4b, 0x24, - 0x18, 0x15, 0x98, 0x35, 0x38, 0x83, 0x84, 0x50, 0xa5, 0x42, 0xf3, 0x32, 0x4b, 0x9c, 0x4c, 0x2e, - 0x3c, 0x94, 0x63, 0xb8, 0xf1, 0x50, 0x8e, 0xe1, 0xc3, 0x43, 0x39, 0xc6, 0x86, 0x47, 0x72, 0x8c, - 0x2b, 0x1e, 0xc9, 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, - 0x8c, 0x2f, 0x1e, 0xc9, 0x31, 0x7c, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, - 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x24, 0xb1, 0x81, 0x9d, 0x63, 0x0c, 0x08, 0x00, 0x00, 0xff, - 0xff, 0x07, 0xe2, 0x02, 0xdf, 0xae, 0x00, 0x00, 0x00, +func (x *ProtoCertificateProperties) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *CertificateProperties) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoCertificateProperties) ProtoMessage() {} - that1, ok := that.(*CertificateProperties) - if !ok { - that2, ok := that.(CertificateProperties) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.OrganizationalUnit) != len(that1.OrganizationalUnit) { - return false - } - for i := range this.OrganizationalUnit { - if this.OrganizationalUnit[i] != that1.OrganizationalUnit[i] { - return false +func (x *ProtoCertificateProperties) ProtoReflect() protoreflect.Message { + mi := &file_certificate_properties_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return true -} -func (this *CertificateProperties) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.CertificateProperties{") - s = append(s, "OrganizationalUnit: "+fmt.Sprintf("%#v", this.OrganizationalUnit)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringCertificateProperties(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *CertificateProperties) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *CertificateProperties) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoCertificateProperties.ProtoReflect.Descriptor instead. +func (*ProtoCertificateProperties) Descriptor() ([]byte, []int) { + return file_certificate_properties_proto_rawDescGZIP(), []int{0} } -func (m *CertificateProperties) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.OrganizationalUnit) > 0 { - for iNdEx := len(m.OrganizationalUnit) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.OrganizationalUnit[iNdEx]) - copy(dAtA[i:], m.OrganizationalUnit[iNdEx]) - i = encodeVarintCertificateProperties(dAtA, i, uint64(len(m.OrganizationalUnit[iNdEx]))) - i-- - dAtA[i] = 0xa - } +func (x *ProtoCertificateProperties) GetOrganizationalUnit() []string { + if x != nil { + return x.OrganizationalUnit } - return len(dAtA) - i, nil -} - -func encodeVarintCertificateProperties(dAtA []byte, offset int, v uint64) int { - offset -= sovCertificateProperties(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *CertificateProperties) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.OrganizationalUnit) > 0 { - for _, s := range m.OrganizationalUnit { - l = len(s) - n += 1 + l + sovCertificateProperties(uint64(l)) - } - } - return n + return nil } -func sovCertificateProperties(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCertificateProperties(x uint64) (n int) { - return sovCertificateProperties(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *CertificateProperties) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CertificateProperties{`, - `OrganizationalUnit:` + fmt.Sprintf("%v", this.OrganizationalUnit) + `,`, - `}`, - }, "") - return s -} -func valueToStringCertificateProperties(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *CertificateProperties) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCertificateProperties - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CertificateProperties: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CertificateProperties: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OrganizationalUnit", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCertificateProperties - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCertificateProperties - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCertificateProperties - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OrganizationalUnit = append(m.OrganizationalUnit, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCertificateProperties(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCertificateProperties - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var File_certificate_properties_proto protoreflect.FileDescriptor - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCertificateProperties(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCertificateProperties - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCertificateProperties - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCertificateProperties - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthCertificateProperties - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCertificateProperties - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthCertificateProperties - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +const file_certificate_properties_proto_rawDesc = "" + + "\n" + + "\x1ccertificate_properties.proto\x12\x06models\"N\n" + + "\x1aProtoCertificateProperties\x120\n" + + "\x13organizational_unit\x18\x01 \x03(\tR\x13organizational_unitB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthCertificateProperties = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCertificateProperties = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCertificateProperties = fmt.Errorf("proto: unexpected end of group") + file_certificate_properties_proto_rawDescOnce sync.Once + file_certificate_properties_proto_rawDescData []byte ) + +func file_certificate_properties_proto_rawDescGZIP() []byte { + file_certificate_properties_proto_rawDescOnce.Do(func() { + file_certificate_properties_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_certificate_properties_proto_rawDesc), len(file_certificate_properties_proto_rawDesc))) + }) + return file_certificate_properties_proto_rawDescData +} + +var file_certificate_properties_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_certificate_properties_proto_goTypes = []any{ + (*ProtoCertificateProperties)(nil), // 0: models.ProtoCertificateProperties +} +var file_certificate_properties_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_certificate_properties_proto_init() } +func file_certificate_properties_proto_init() { + if File_certificate_properties_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_certificate_properties_proto_rawDesc), len(file_certificate_properties_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_certificate_properties_proto_goTypes, + DependencyIndexes: file_certificate_properties_proto_depIdxs, + MessageInfos: file_certificate_properties_proto_msgTypes, + }.Build() + File_certificate_properties_proto = out.File + file_certificate_properties_proto_goTypes = nil + file_certificate_properties_proto_depIdxs = nil +} diff --git a/models/certificate_properties.proto b/models/certificate_properties.proto index 9eced102..efbbee2f 100644 --- a/models/certificate_properties.proto +++ b/models/certificate_properties.proto @@ -1,8 +1,9 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -message CertificateProperties { - repeated string organizational_unit = 1; +message ProtoCertificateProperties { + repeated string organizational_unit = 1 [json_name = "organizational_unit"]; } diff --git a/models/certificate_properties_bbs.pb.go b/models/certificate_properties_bbs.pb.go new file mode 100644 index 00000000..791c5184 --- /dev/null +++ b/models/certificate_properties_bbs.pb.go @@ -0,0 +1,103 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: certificate_properties.proto + +package models + +// Prevent copylock errors when using ProtoCertificateProperties directly +type CertificateProperties struct { + OrganizationalUnit []string `json:"organizational_unit,omitempty"` +} + +func (this *CertificateProperties) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*CertificateProperties) + if !ok { + that2, ok := that.(CertificateProperties) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.OrganizationalUnit == nil { + if that1.OrganizationalUnit != nil { + return false + } + } else if len(this.OrganizationalUnit) != len(that1.OrganizationalUnit) { + return false + } + for i := range this.OrganizationalUnit { + if this.OrganizationalUnit[i] != that1.OrganizationalUnit[i] { + return false + } + } + return true +} +func (m *CertificateProperties) GetOrganizationalUnit() []string { + if m != nil { + return m.OrganizationalUnit + } + return nil +} +func (m *CertificateProperties) SetOrganizationalUnit(value []string) { + if m != nil { + m.OrganizationalUnit = value + } +} +func (x *CertificateProperties) ToProto() *ProtoCertificateProperties { + if x == nil { + return nil + } + + proto := &ProtoCertificateProperties{ + OrganizationalUnit: x.OrganizationalUnit, + } + return proto +} + +func (x *ProtoCertificateProperties) FromProto() *CertificateProperties { + if x == nil { + return nil + } + + copysafe := &CertificateProperties{ + OrganizationalUnit: x.OrganizationalUnit, + } + return copysafe +} + +func CertificatePropertiesToProtoSlice(values []*CertificateProperties) []*ProtoCertificateProperties { + if values == nil { + return nil + } + result := make([]*ProtoCertificateProperties, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func CertificatePropertiesFromProtoSlice(values []*ProtoCertificateProperties) []*CertificateProperties { + if values == nil { + return nil + } + result := make([]*CertificateProperties, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/check_definition.pb.go b/models/check_definition.pb.go index d4c6ff75..47ea15d0 100644 --- a/models/check_definition.pb.go +++ b/models/check_definition.pb.go @@ -1,1453 +1,347 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: check_definition.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -type CheckDefinition struct { - Checks []*Check `protobuf:"bytes,1,rep,name=checks,proto3" json:"checks,omitempty"` - LogSource string `protobuf:"bytes,2,opt,name=log_source,json=logSource,proto3" json:"log_source"` - ReadinessChecks []*Check `protobuf:"bytes,3,rep,name=readiness_checks,json=readinessChecks,proto3" json:"readiness_checks,omitempty"` +type ProtoCheckDefinition struct { + state protoimpl.MessageState `protogen:"open.v1"` + Checks []*ProtoCheck `protobuf:"bytes,1,rep,name=checks,proto3" json:"checks,omitempty"` + LogSource string `protobuf:"bytes,2,opt,name=log_source,proto3" json:"log_source,omitempty"` + ReadinessChecks []*ProtoCheck `protobuf:"bytes,3,rep,name=readiness_checks,proto3" json:"readiness_checks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CheckDefinition) Reset() { *m = CheckDefinition{} } -func (*CheckDefinition) ProtoMessage() {} -func (*CheckDefinition) Descriptor() ([]byte, []int) { - return fileDescriptor_048a62b88ce7913d, []int{0} +func (x *ProtoCheckDefinition) Reset() { + *x = ProtoCheckDefinition{} + mi := &file_check_definition_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CheckDefinition) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoCheckDefinition) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CheckDefinition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CheckDefinition.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoCheckDefinition) ProtoMessage() {} + +func (x *ProtoCheckDefinition) ProtoReflect() protoreflect.Message { + mi := &file_check_definition_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *CheckDefinition) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckDefinition.Merge(m, src) -} -func (m *CheckDefinition) XXX_Size() int { - return m.Size() -} -func (m *CheckDefinition) XXX_DiscardUnknown() { - xxx_messageInfo_CheckDefinition.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_CheckDefinition proto.InternalMessageInfo +// Deprecated: Use ProtoCheckDefinition.ProtoReflect.Descriptor instead. +func (*ProtoCheckDefinition) Descriptor() ([]byte, []int) { + return file_check_definition_proto_rawDescGZIP(), []int{0} +} -func (m *CheckDefinition) GetChecks() []*Check { - if m != nil { - return m.Checks +func (x *ProtoCheckDefinition) GetChecks() []*ProtoCheck { + if x != nil { + return x.Checks } return nil } -func (m *CheckDefinition) GetLogSource() string { - if m != nil { - return m.LogSource +func (x *ProtoCheckDefinition) GetLogSource() string { + if x != nil { + return x.LogSource } return "" } -func (m *CheckDefinition) GetReadinessChecks() []*Check { - if m != nil { - return m.ReadinessChecks +func (x *ProtoCheckDefinition) GetReadinessChecks() []*ProtoCheck { + if x != nil { + return x.ReadinessChecks } return nil } -type Check struct { +type ProtoCheck struct { + state protoimpl.MessageState `protogen:"open.v1"` // oneof is hard to use right now, instead we can do this check in validation // oneof check { - TcpCheck *TCPCheck `protobuf:"bytes,1,opt,name=tcp_check,json=tcpCheck,proto3" json:"tcp_check,omitempty"` - HttpCheck *HTTPCheck `protobuf:"bytes,2,opt,name=http_check,json=httpCheck,proto3" json:"http_check,omitempty"` + TcpCheck *ProtoTCPCheck `protobuf:"bytes,1,opt,name=tcp_check,proto3" json:"tcp_check,omitempty"` + HttpCheck *ProtoHTTPCheck `protobuf:"bytes,2,opt,name=http_check,proto3" json:"http_check,omitempty"` // } + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *Check) Reset() { *m = Check{} } -func (*Check) ProtoMessage() {} -func (*Check) Descriptor() ([]byte, []int) { - return fileDescriptor_048a62b88ce7913d, []int{1} -} -func (m *Check) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Check) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Check.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Check) XXX_Merge(src proto.Message) { - xxx_messageInfo_Check.Merge(m, src) -} -func (m *Check) XXX_Size() int { - return m.Size() -} -func (m *Check) XXX_DiscardUnknown() { - xxx_messageInfo_Check.DiscardUnknown(m) +func (x *ProtoCheck) Reset() { + *x = ProtoCheck{} + mi := &file_check_definition_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -var xxx_messageInfo_Check proto.InternalMessageInfo - -func (m *Check) GetTcpCheck() *TCPCheck { - if m != nil { - return m.TcpCheck - } - return nil +func (x *ProtoCheck) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Check) GetHttpCheck() *HTTPCheck { - if m != nil { - return m.HttpCheck - } - return nil -} - -type TCPCheck struct { - Port uint32 `protobuf:"varint,1,opt,name=port,proto3" json:"port"` - ConnectTimeoutMs uint64 `protobuf:"varint,2,opt,name=connect_timeout_ms,json=connectTimeoutMs,proto3" json:"connect_timeout_ms,omitempty"` - IntervalMs uint64 `protobuf:"varint,3,opt,name=interval_ms,json=intervalMs,proto3" json:"interval_ms,omitempty"` -} +func (*ProtoCheck) ProtoMessage() {} -func (m *TCPCheck) Reset() { *m = TCPCheck{} } -func (*TCPCheck) ProtoMessage() {} -func (*TCPCheck) Descriptor() ([]byte, []int) { - return fileDescriptor_048a62b88ce7913d, []int{2} -} -func (m *TCPCheck) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TCPCheck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TCPCheck.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoCheck) ProtoReflect() protoreflect.Message { + mi := &file_check_definition_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil - } -} -func (m *TCPCheck) XXX_Merge(src proto.Message) { - xxx_messageInfo_TCPCheck.Merge(m, src) -} -func (m *TCPCheck) XXX_Size() int { - return m.Size() -} -func (m *TCPCheck) XXX_DiscardUnknown() { - xxx_messageInfo_TCPCheck.DiscardUnknown(m) -} - -var xxx_messageInfo_TCPCheck proto.InternalMessageInfo - -func (m *TCPCheck) GetPort() uint32 { - if m != nil { - return m.Port + return ms } - return 0 + return mi.MessageOf(x) } -func (m *TCPCheck) GetConnectTimeoutMs() uint64 { - if m != nil { - return m.ConnectTimeoutMs - } - return 0 +// Deprecated: Use ProtoCheck.ProtoReflect.Descriptor instead. +func (*ProtoCheck) Descriptor() ([]byte, []int) { + return file_check_definition_proto_rawDescGZIP(), []int{1} } -func (m *TCPCheck) GetIntervalMs() uint64 { - if m != nil { - return m.IntervalMs +func (x *ProtoCheck) GetTcpCheck() *ProtoTCPCheck { + if x != nil { + return x.TcpCheck } - return 0 -} - -type HTTPCheck struct { - Port uint32 `protobuf:"varint,1,opt,name=port,proto3" json:"port"` - RequestTimeoutMs uint64 `protobuf:"varint,2,opt,name=request_timeout_ms,json=requestTimeoutMs,proto3" json:"request_timeout_ms,omitempty"` - Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path"` - IntervalMs uint64 `protobuf:"varint,4,opt,name=interval_ms,json=intervalMs,proto3" json:"interval_ms,omitempty"` -} - -func (m *HTTPCheck) Reset() { *m = HTTPCheck{} } -func (*HTTPCheck) ProtoMessage() {} -func (*HTTPCheck) Descriptor() ([]byte, []int) { - return fileDescriptor_048a62b88ce7913d, []int{3} -} -func (m *HTTPCheck) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HTTPCheck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HTTPCheck.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HTTPCheck) XXX_Merge(src proto.Message) { - xxx_messageInfo_HTTPCheck.Merge(m, src) -} -func (m *HTTPCheck) XXX_Size() int { - return m.Size() -} -func (m *HTTPCheck) XXX_DiscardUnknown() { - xxx_messageInfo_HTTPCheck.DiscardUnknown(m) -} - -var xxx_messageInfo_HTTPCheck proto.InternalMessageInfo - -func (m *HTTPCheck) GetPort() uint32 { - if m != nil { - return m.Port - } - return 0 -} - -func (m *HTTPCheck) GetRequestTimeoutMs() uint64 { - if m != nil { - return m.RequestTimeoutMs - } - return 0 + return nil } -func (m *HTTPCheck) GetPath() string { - if m != nil { - return m.Path +func (x *ProtoCheck) GetHttpCheck() *ProtoHTTPCheck { + if x != nil { + return x.HttpCheck } - return "" + return nil } -func (m *HTTPCheck) GetIntervalMs() uint64 { - if m != nil { - return m.IntervalMs - } - return 0 +type ProtoTCPCheck struct { + state protoimpl.MessageState `protogen:"open.v1"` + Port uint32 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"` + ConnectTimeoutMs uint64 `protobuf:"varint,2,opt,name=connect_timeout_ms,proto3" json:"connect_timeout_ms,omitempty"` + IntervalMs uint64 `protobuf:"varint,3,opt,name=interval_ms,proto3" json:"interval_ms,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { - proto.RegisterType((*CheckDefinition)(nil), "models.CheckDefinition") - proto.RegisterType((*Check)(nil), "models.Check") - proto.RegisterType((*TCPCheck)(nil), "models.TCPCheck") - proto.RegisterType((*HTTPCheck)(nil), "models.HTTPCheck") +func (x *ProtoTCPCheck) Reset() { + *x = ProtoTCPCheck{} + mi := &file_check_definition_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func init() { proto.RegisterFile("check_definition.proto", fileDescriptor_048a62b88ce7913d) } - -var fileDescriptor_048a62b88ce7913d = []byte{ - // 414 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x31, 0x8f, 0xd3, 0x40, - 0x10, 0x85, 0xbd, 0x97, 0x10, 0xc5, 0x13, 0x1d, 0x17, 0xb6, 0x40, 0x11, 0x42, 0x9b, 0xc8, 0x12, - 0x52, 0x0a, 0xe2, 0x43, 0x07, 0x05, 0x75, 0x8e, 0x82, 0xe6, 0x24, 0x64, 0xdc, 0x5b, 0xce, 0x66, - 0xcf, 0xb6, 0xb0, 0xbd, 0xc6, 0xbb, 0x86, 0x96, 0x9f, 0x40, 0x45, 0x4f, 0xc7, 0x4f, 0xa1, 0x4c, - 0x99, 0x2a, 0x22, 0x4e, 0x83, 0x52, 0xe5, 0x27, 0x20, 0x8f, 0xed, 0x80, 0xa2, 0x48, 0x34, 0xd6, - 0xcc, 0xbe, 0xef, 0xbd, 0x37, 0x85, 0xe1, 0x31, 0x0f, 0x05, 0xff, 0xe0, 0x2d, 0xc5, 0x7d, 0x94, - 0x46, 0x3a, 0x92, 0xa9, 0x9d, 0xe5, 0x52, 0x4b, 0xda, 0x4b, 0xe4, 0x52, 0xc4, 0xea, 0xc9, 0x2c, - 0x88, 0x74, 0x58, 0x2c, 0x6c, 0x2e, 0x93, 0xeb, 0x40, 0x06, 0xf2, 0x1a, 0xe5, 0x45, 0x71, 0x8f, - 0x1b, 0x2e, 0x38, 0xd5, 0x36, 0xeb, 0x3b, 0x81, 0xab, 0xdb, 0x2a, 0xf1, 0xcd, 0x31, 0x90, 0x3e, - 0x83, 0x1e, 0x96, 0xa8, 0x11, 0x99, 0x74, 0xa6, 0x83, 0x9b, 0x4b, 0xbb, 0xce, 0xb6, 0x11, 0x74, - 0x1a, 0x91, 0xce, 0x00, 0x62, 0x19, 0x78, 0x4a, 0x16, 0x39, 0x17, 0xa3, 0x8b, 0x09, 0x99, 0x9a, - 0xf3, 0x87, 0xfb, 0xcd, 0xf8, 0x9f, 0x57, 0xc7, 0x8c, 0x65, 0xf0, 0x1e, 0x47, 0xfa, 0x1a, 0x86, - 0xb9, 0xf0, 0x97, 0x51, 0x2a, 0x94, 0xf2, 0x9a, 0xfc, 0xce, 0xb9, 0xfc, 0xab, 0x23, 0x86, 0xbb, - 0xb2, 0x42, 0x78, 0x80, 0x13, 0x9d, 0x81, 0xa9, 0x79, 0x56, 0x9b, 0x47, 0x64, 0x42, 0xa6, 0x83, - 0x9b, 0x61, 0xeb, 0x75, 0x6f, 0xdf, 0xd5, 0xf6, 0xbe, 0xe6, 0x59, 0x8d, 0xbf, 0x00, 0x08, 0xb5, - 0x6e, 0xf9, 0x0b, 0xe4, 0x1f, 0xb5, 0xfc, 0x5b, 0xd7, 0x6d, 0x0c, 0x66, 0x05, 0xe1, 0x68, 0x7d, - 0x86, 0x7e, 0x9b, 0x43, 0x9f, 0x42, 0x37, 0x93, 0xb9, 0xc6, 0x9e, 0xcb, 0x79, 0x7f, 0xbf, 0x19, - 0xe3, 0xee, 0xe0, 0x97, 0x3e, 0x07, 0xca, 0x65, 0x9a, 0x0a, 0xae, 0x3d, 0x1d, 0x25, 0x42, 0x16, - 0xda, 0x4b, 0x14, 0x76, 0x74, 0x9d, 0x61, 0xa3, 0xb8, 0xb5, 0x70, 0xa7, 0xe8, 0x18, 0x06, 0x51, - 0xaa, 0x45, 0xfe, 0xc9, 0x8f, 0x2b, 0xac, 0x83, 0x18, 0xb4, 0x4f, 0x77, 0xca, 0xfa, 0x46, 0xc0, - 0x3c, 0x5e, 0xf4, 0xff, 0xea, 0x5c, 0x7c, 0x2c, 0x84, 0x3a, 0x57, 0xdd, 0x28, 0x7f, 0xab, 0xab, - 0x2c, 0x5f, 0x87, 0xd8, 0x69, 0x36, 0x59, 0xbe, 0x0e, 0x1d, 0xfc, 0x9e, 0x1e, 0xd6, 0x3d, 0x3d, - 0x6c, 0xfe, 0x6a, 0xb5, 0x65, 0xc6, 0x7a, 0xcb, 0x8c, 0xc3, 0x96, 0x91, 0x2f, 0x25, 0x23, 0x3f, - 0x4a, 0x46, 0x7e, 0x96, 0x8c, 0xac, 0x4a, 0x46, 0x7e, 0x95, 0x8c, 0xfc, 0x2e, 0x99, 0x71, 0x28, - 0x19, 0xf9, 0xba, 0x63, 0xc6, 0x6a, 0xc7, 0x8c, 0xf5, 0x8e, 0x19, 0x8b, 0x1e, 0xfe, 0x5c, 0x2f, - 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xdc, 0xc4, 0x3b, 0x86, 0xad, 0x02, 0x00, 0x00, +func (x *ProtoTCPCheck) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *CheckDefinition) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoTCPCheck) ProtoMessage() {} - that1, ok := that.(*CheckDefinition) - if !ok { - that2, ok := that.(CheckDefinition) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Checks) != len(that1.Checks) { - return false - } - for i := range this.Checks { - if !this.Checks[i].Equal(that1.Checks[i]) { - return false +func (x *ProtoTCPCheck) ProtoReflect() protoreflect.Message { + mi := &file_check_definition_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if this.LogSource != that1.LogSource { - return false - } - if len(this.ReadinessChecks) != len(that1.ReadinessChecks) { - return false - } - for i := range this.ReadinessChecks { - if !this.ReadinessChecks[i].Equal(that1.ReadinessChecks[i]) { - return false - } - } - return true + return mi.MessageOf(x) } -func (this *Check) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*Check) - if !ok { - that2, ok := that.(Check) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.TcpCheck.Equal(that1.TcpCheck) { - return false - } - if !this.HttpCheck.Equal(that1.HttpCheck) { - return false - } - return true +// Deprecated: Use ProtoTCPCheck.ProtoReflect.Descriptor instead. +func (*ProtoTCPCheck) Descriptor() ([]byte, []int) { + return file_check_definition_proto_rawDescGZIP(), []int{2} } -func (this *TCPCheck) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*TCPCheck) - if !ok { - that2, ok := that.(TCPCheck) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false +func (x *ProtoTCPCheck) GetPort() uint32 { + if x != nil { + return x.Port } - if this.Port != that1.Port { - return false - } - if this.ConnectTimeoutMs != that1.ConnectTimeoutMs { - return false - } - if this.IntervalMs != that1.IntervalMs { - return false - } - return true -} -func (this *HTTPCheck) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*HTTPCheck) - if !ok { - that2, ok := that.(HTTPCheck) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Port != that1.Port { - return false - } - if this.RequestTimeoutMs != that1.RequestTimeoutMs { - return false - } - if this.Path != that1.Path { - return false - } - if this.IntervalMs != that1.IntervalMs { - return false - } - return true -} -func (this *CheckDefinition) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&models.CheckDefinition{") - if this.Checks != nil { - s = append(s, "Checks: "+fmt.Sprintf("%#v", this.Checks)+",\n") - } - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - if this.ReadinessChecks != nil { - s = append(s, "ReadinessChecks: "+fmt.Sprintf("%#v", this.ReadinessChecks)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Check) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.Check{") - if this.TcpCheck != nil { - s = append(s, "TcpCheck: "+fmt.Sprintf("%#v", this.TcpCheck)+",\n") - } - if this.HttpCheck != nil { - s = append(s, "HttpCheck: "+fmt.Sprintf("%#v", this.HttpCheck)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TCPCheck) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&models.TCPCheck{") - s = append(s, "Port: "+fmt.Sprintf("%#v", this.Port)+",\n") - s = append(s, "ConnectTimeoutMs: "+fmt.Sprintf("%#v", this.ConnectTimeoutMs)+",\n") - s = append(s, "IntervalMs: "+fmt.Sprintf("%#v", this.IntervalMs)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *HTTPCheck) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&models.HTTPCheck{") - s = append(s, "Port: "+fmt.Sprintf("%#v", this.Port)+",\n") - s = append(s, "RequestTimeoutMs: "+fmt.Sprintf("%#v", this.RequestTimeoutMs)+",\n") - s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") - s = append(s, "IntervalMs: "+fmt.Sprintf("%#v", this.IntervalMs)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringCheckDefinition(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *CheckDefinition) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CheckDefinition) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CheckDefinition) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ReadinessChecks) > 0 { - for iNdEx := len(m.ReadinessChecks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ReadinessChecks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCheckDefinition(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintCheckDefinition(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x12 - } - if len(m.Checks) > 0 { - for iNdEx := len(m.Checks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Checks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCheckDefinition(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil + return 0 } -func (m *Check) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoTCPCheck) GetConnectTimeoutMs() uint64 { + if x != nil { + return x.ConnectTimeoutMs } - return dAtA[:n], nil -} - -func (m *Check) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return 0 } -func (m *Check) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.HttpCheck != nil { - { - size, err := m.HttpCheck.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCheckDefinition(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func (x *ProtoTCPCheck) GetIntervalMs() uint64 { + if x != nil { + return x.IntervalMs } - if m.TcpCheck != nil { - { - size, err := m.TcpCheck.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCheckDefinition(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return 0 } -func (m *TCPCheck) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +type ProtoHTTPCheck struct { + state protoimpl.MessageState `protogen:"open.v1"` + Port uint32 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"` + RequestTimeoutMs uint64 `protobuf:"varint,2,opt,name=request_timeout_ms,proto3" json:"request_timeout_ms,omitempty"` + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` + IntervalMs uint64 `protobuf:"varint,4,opt,name=interval_ms,proto3" json:"interval_ms,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *TCPCheck) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *ProtoHTTPCheck) Reset() { + *x = ProtoHTTPCheck{} + mi := &file_check_definition_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TCPCheck) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.IntervalMs != 0 { - i = encodeVarintCheckDefinition(dAtA, i, uint64(m.IntervalMs)) - i-- - dAtA[i] = 0x18 - } - if m.ConnectTimeoutMs != 0 { - i = encodeVarintCheckDefinition(dAtA, i, uint64(m.ConnectTimeoutMs)) - i-- - dAtA[i] = 0x10 - } - if m.Port != 0 { - i = encodeVarintCheckDefinition(dAtA, i, uint64(m.Port)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil +func (x *ProtoHTTPCheck) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *HTTPCheck) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} +func (*ProtoHTTPCheck) ProtoMessage() {} -func (m *HTTPCheck) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HTTPCheck) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.IntervalMs != 0 { - i = encodeVarintCheckDefinition(dAtA, i, uint64(m.IntervalMs)) - i-- - dAtA[i] = 0x20 - } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintCheckDefinition(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0x1a - } - if m.RequestTimeoutMs != 0 { - i = encodeVarintCheckDefinition(dAtA, i, uint64(m.RequestTimeoutMs)) - i-- - dAtA[i] = 0x10 - } - if m.Port != 0 { - i = encodeVarintCheckDefinition(dAtA, i, uint64(m.Port)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintCheckDefinition(dAtA []byte, offset int, v uint64) int { - offset -= sovCheckDefinition(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *CheckDefinition) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Checks) > 0 { - for _, e := range m.Checks { - l = e.Size() - n += 1 + l + sovCheckDefinition(uint64(l)) - } - } - l = len(m.LogSource) - if l > 0 { - n += 1 + l + sovCheckDefinition(uint64(l)) - } - if len(m.ReadinessChecks) > 0 { - for _, e := range m.ReadinessChecks { - l = e.Size() - n += 1 + l + sovCheckDefinition(uint64(l)) +func (x *ProtoHTTPCheck) ProtoReflect() protoreflect.Message { + mi := &file_check_definition_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return n + return mi.MessageOf(x) } -func (m *Check) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TcpCheck != nil { - l = m.TcpCheck.Size() - n += 1 + l + sovCheckDefinition(uint64(l)) - } - if m.HttpCheck != nil { - l = m.HttpCheck.Size() - n += 1 + l + sovCheckDefinition(uint64(l)) - } - return n -} - -func (m *TCPCheck) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Port != 0 { - n += 1 + sovCheckDefinition(uint64(m.Port)) - } - if m.ConnectTimeoutMs != 0 { - n += 1 + sovCheckDefinition(uint64(m.ConnectTimeoutMs)) - } - if m.IntervalMs != 0 { - n += 1 + sovCheckDefinition(uint64(m.IntervalMs)) - } - return n -} - -func (m *HTTPCheck) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Port != 0 { - n += 1 + sovCheckDefinition(uint64(m.Port)) - } - if m.RequestTimeoutMs != 0 { - n += 1 + sovCheckDefinition(uint64(m.RequestTimeoutMs)) - } - l = len(m.Path) - if l > 0 { - n += 1 + l + sovCheckDefinition(uint64(l)) - } - if m.IntervalMs != 0 { - n += 1 + sovCheckDefinition(uint64(m.IntervalMs)) - } - return n +// Deprecated: Use ProtoHTTPCheck.ProtoReflect.Descriptor instead. +func (*ProtoHTTPCheck) Descriptor() ([]byte, []int) { + return file_check_definition_proto_rawDescGZIP(), []int{3} } -func sovCheckDefinition(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCheckDefinition(x uint64) (n int) { - return sovCheckDefinition(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *CheckDefinition) String() string { - if this == nil { - return "nil" - } - repeatedStringForChecks := "[]*Check{" - for _, f := range this.Checks { - repeatedStringForChecks += strings.Replace(f.String(), "Check", "Check", 1) + "," - } - repeatedStringForChecks += "}" - repeatedStringForReadinessChecks := "[]*Check{" - for _, f := range this.ReadinessChecks { - repeatedStringForReadinessChecks += strings.Replace(f.String(), "Check", "Check", 1) + "," +func (x *ProtoHTTPCheck) GetPort() uint32 { + if x != nil { + return x.Port } - repeatedStringForReadinessChecks += "}" - s := strings.Join([]string{`&CheckDefinition{`, - `Checks:` + repeatedStringForChecks + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `ReadinessChecks:` + repeatedStringForReadinessChecks + `,`, - `}`, - }, "") - return s -} -func (this *Check) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Check{`, - `TcpCheck:` + strings.Replace(this.TcpCheck.String(), "TCPCheck", "TCPCheck", 1) + `,`, - `HttpCheck:` + strings.Replace(this.HttpCheck.String(), "HTTPCheck", "HTTPCheck", 1) + `,`, - `}`, - }, "") - return s -} -func (this *TCPCheck) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TCPCheck{`, - `Port:` + fmt.Sprintf("%v", this.Port) + `,`, - `ConnectTimeoutMs:` + fmt.Sprintf("%v", this.ConnectTimeoutMs) + `,`, - `IntervalMs:` + fmt.Sprintf("%v", this.IntervalMs) + `,`, - `}`, - }, "") - return s -} -func (this *HTTPCheck) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&HTTPCheck{`, - `Port:` + fmt.Sprintf("%v", this.Port) + `,`, - `RequestTimeoutMs:` + fmt.Sprintf("%v", this.RequestTimeoutMs) + `,`, - `Path:` + fmt.Sprintf("%v", this.Path) + `,`, - `IntervalMs:` + fmt.Sprintf("%v", this.IntervalMs) + `,`, - `}`, - }, "") - return s -} -func valueToStringCheckDefinition(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) + return 0 } -func (m *CheckDefinition) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CheckDefinition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CheckDefinition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Checks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCheckDefinition - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCheckDefinition - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Checks = append(m.Checks, &Check{}) - if err := m.Checks[len(m.Checks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCheckDefinition - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCheckDefinition - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReadinessChecks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCheckDefinition - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCheckDefinition - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ReadinessChecks = append(m.ReadinessChecks, &Check{}) - if err := m.ReadinessChecks[len(m.ReadinessChecks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCheckDefinition(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCheckDefinition - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoHTTPCheck) GetRequestTimeoutMs() uint64 { + if x != nil { + return x.RequestTimeoutMs } - return nil + return 0 } -func (m *Check) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Check: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Check: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TcpCheck", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCheckDefinition - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCheckDefinition - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TcpCheck == nil { - m.TcpCheck = &TCPCheck{} - } - if err := m.TcpCheck.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HttpCheck", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCheckDefinition - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCheckDefinition - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.HttpCheck == nil { - m.HttpCheck = &HTTPCheck{} - } - if err := m.HttpCheck.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCheckDefinition(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCheckDefinition - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoHTTPCheck) GetPath() string { + if x != nil { + return x.Path } - return nil + return "" } -func (m *TCPCheck) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TCPCheck: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TCPCheck: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - m.Port = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Port |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ConnectTimeoutMs", wireType) - } - m.ConnectTimeoutMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ConnectTimeoutMs |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IntervalMs", wireType) - } - m.IntervalMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.IntervalMs |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipCheckDefinition(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCheckDefinition - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoHTTPCheck) GetIntervalMs() uint64 { + if x != nil { + return x.IntervalMs } - return nil + return 0 } -func (m *HTTPCheck) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HTTPCheck: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HTTPCheck: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - m.Port = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Port |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestTimeoutMs", wireType) - } - m.RequestTimeoutMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RequestTimeoutMs |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCheckDefinition - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCheckDefinition - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IntervalMs", wireType) - } - m.IntervalMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.IntervalMs |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipCheckDefinition(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCheckDefinition - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCheckDefinition(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCheckDefinition - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthCheckDefinition - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCheckDefinition - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthCheckDefinition - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +var File_check_definition_proto protoreflect.FileDescriptor + +const file_check_definition_proto_rawDesc = "" + + "\n" + + "\x16check_definition.proto\x12\x06models\x1a\tbbs.proto\"\xa7\x01\n" + + "\x14ProtoCheckDefinition\x12*\n" + + "\x06checks\x18\x01 \x03(\v2\x12.models.ProtoCheckR\x06checks\x12#\n" + + "\n" + + "log_source\x18\x02 \x01(\tB\x03\xc0>\x01R\n" + + "log_source\x12>\n" + + "\x10readiness_checks\x18\x03 \x03(\v2\x12.models.ProtoCheckR\x10readiness_checks\"y\n" + + "\n" + + "ProtoCheck\x123\n" + + "\ttcp_check\x18\x01 \x01(\v2\x15.models.ProtoTCPCheckR\ttcp_check\x126\n" + + "\n" + + "http_check\x18\x02 \x01(\v2\x16.models.ProtoHTTPCheckR\n" + + "http_check\"z\n" + + "\rProtoTCPCheck\x12\x17\n" + + "\x04port\x18\x01 \x01(\rB\x03\xc0>\x01R\x04port\x12.\n" + + "\x12connect_timeout_ms\x18\x02 \x01(\x04R\x12connect_timeout_ms\x12 \n" + + "\vinterval_ms\x18\x03 \x01(\x04R\vinterval_ms\"\x94\x01\n" + + "\x0eProtoHTTPCheck\x12\x17\n" + + "\x04port\x18\x01 \x01(\rB\x03\xc0>\x01R\x04port\x12.\n" + + "\x12request_timeout_ms\x18\x02 \x01(\x04R\x12request_timeout_ms\x12\x17\n" + + "\x04path\x18\x03 \x01(\tB\x03\xc0>\x01R\x04path\x12 \n" + + "\vinterval_ms\x18\x04 \x01(\x04R\vinterval_msB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthCheckDefinition = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCheckDefinition = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCheckDefinition = fmt.Errorf("proto: unexpected end of group") + file_check_definition_proto_rawDescOnce sync.Once + file_check_definition_proto_rawDescData []byte ) + +func file_check_definition_proto_rawDescGZIP() []byte { + file_check_definition_proto_rawDescOnce.Do(func() { + file_check_definition_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_check_definition_proto_rawDesc), len(file_check_definition_proto_rawDesc))) + }) + return file_check_definition_proto_rawDescData +} + +var file_check_definition_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_check_definition_proto_goTypes = []any{ + (*ProtoCheckDefinition)(nil), // 0: models.ProtoCheckDefinition + (*ProtoCheck)(nil), // 1: models.ProtoCheck + (*ProtoTCPCheck)(nil), // 2: models.ProtoTCPCheck + (*ProtoHTTPCheck)(nil), // 3: models.ProtoHTTPCheck +} +var file_check_definition_proto_depIdxs = []int32{ + 1, // 0: models.ProtoCheckDefinition.checks:type_name -> models.ProtoCheck + 1, // 1: models.ProtoCheckDefinition.readiness_checks:type_name -> models.ProtoCheck + 2, // 2: models.ProtoCheck.tcp_check:type_name -> models.ProtoTCPCheck + 3, // 3: models.ProtoCheck.http_check:type_name -> models.ProtoHTTPCheck + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_check_definition_proto_init() } +func file_check_definition_proto_init() { + if File_check_definition_proto != nil { + return + } + file_bbs_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_check_definition_proto_rawDesc), len(file_check_definition_proto_rawDesc)), + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_check_definition_proto_goTypes, + DependencyIndexes: file_check_definition_proto_depIdxs, + MessageInfos: file_check_definition_proto_msgTypes, + }.Build() + File_check_definition_proto = out.File + file_check_definition_proto_goTypes = nil + file_check_definition_proto_depIdxs = nil +} diff --git a/models/check_definition.proto b/models/check_definition.proto index e38338d5..56aebf07 100644 --- a/models/check_definition.proto +++ b/models/check_definition.proto @@ -2,32 +2,33 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; -message CheckDefinition { - repeated Check checks = 1; - string log_source = 2 [(gogoproto.jsontag) = "log_source"]; - repeated Check readiness_checks = 3; +message ProtoCheckDefinition { + repeated ProtoCheck checks = 1; + string log_source = 2 [json_name = "log_source", (bbs.bbs_json_always_emit) = true]; + repeated ProtoCheck readiness_checks = 3 [json_name = "readiness_checks"]; } -message Check { +message ProtoCheck { // oneof is hard to use right now, instead we can do this check in validation // oneof check { - TCPCheck tcp_check = 1; - HTTPCheck http_check = 2; + ProtoTCPCheck tcp_check = 1 [json_name = "tcp_check"]; + ProtoHTTPCheck http_check = 2 [json_name = "http_check"]; // } } -message TCPCheck { - uint32 port = 1 [(gogoproto.jsontag) = "port"]; - uint64 connect_timeout_ms = 2; - uint64 interval_ms = 3; +message ProtoTCPCheck { + uint32 port = 1 [json_name = "port", (bbs.bbs_json_always_emit) = true]; + uint64 connect_timeout_ms = 2 [json_name = "connect_timeout_ms"]; + uint64 interval_ms = 3 [json_name = "interval_ms"]; } -message HTTPCheck { - uint32 port = 1 [(gogoproto.jsontag) = "port"]; - uint64 request_timeout_ms = 2; - string path = 3 [(gogoproto.jsontag) = "path"]; - uint64 interval_ms = 4; +message ProtoHTTPCheck { + uint32 port = 1 [json_name = "port", (bbs.bbs_json_always_emit) = true]; + uint64 request_timeout_ms = 2 [json_name = "request_timeout_ms"]; + string path = 3 [json_name = "path", (bbs.bbs_json_always_emit) = true]; + uint64 interval_ms = 4 [json_name = "interval_ms"]; } diff --git a/models/check_definition_bbs.pb.go b/models/check_definition_bbs.pb.go new file mode 100644 index 00000000..ff3a0596 --- /dev/null +++ b/models/check_definition_bbs.pb.go @@ -0,0 +1,533 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: check_definition.proto + +package models + +// Prevent copylock errors when using ProtoCheckDefinition directly +type CheckDefinition struct { + Checks []*Check `json:"checks,omitempty"` + LogSource string `json:"log_source"` + ReadinessChecks []*Check `json:"readiness_checks,omitempty"` +} + +func (this *CheckDefinition) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*CheckDefinition) + if !ok { + that2, ok := that.(CheckDefinition) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Checks == nil { + if that1.Checks != nil { + return false + } + } else if len(this.Checks) != len(that1.Checks) { + return false + } + for i := range this.Checks { + if !this.Checks[i].Equal(that1.Checks[i]) { + return false + } + } + if this.LogSource != that1.LogSource { + return false + } + if this.ReadinessChecks == nil { + if that1.ReadinessChecks != nil { + return false + } + } else if len(this.ReadinessChecks) != len(that1.ReadinessChecks) { + return false + } + for i := range this.ReadinessChecks { + if !this.ReadinessChecks[i].Equal(that1.ReadinessChecks[i]) { + return false + } + } + return true +} +func (m *CheckDefinition) GetChecks() []*Check { + if m != nil { + return m.Checks + } + return nil +} +func (m *CheckDefinition) SetChecks(value []*Check) { + if m != nil { + m.Checks = value + } +} +func (m *CheckDefinition) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CheckDefinition) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} +func (m *CheckDefinition) GetReadinessChecks() []*Check { + if m != nil { + return m.ReadinessChecks + } + return nil +} +func (m *CheckDefinition) SetReadinessChecks(value []*Check) { + if m != nil { + m.ReadinessChecks = value + } +} +func (x *CheckDefinition) ToProto() *ProtoCheckDefinition { + if x == nil { + return nil + } + + proto := &ProtoCheckDefinition{ + Checks: CheckToProtoSlice(x.Checks), + LogSource: x.LogSource, + ReadinessChecks: CheckToProtoSlice(x.ReadinessChecks), + } + return proto +} + +func (x *ProtoCheckDefinition) FromProto() *CheckDefinition { + if x == nil { + return nil + } + + copysafe := &CheckDefinition{ + Checks: CheckFromProtoSlice(x.Checks), + LogSource: x.LogSource, + ReadinessChecks: CheckFromProtoSlice(x.ReadinessChecks), + } + return copysafe +} + +func CheckDefinitionToProtoSlice(values []*CheckDefinition) []*ProtoCheckDefinition { + if values == nil { + return nil + } + result := make([]*ProtoCheckDefinition, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func CheckDefinitionFromProtoSlice(values []*ProtoCheckDefinition) []*CheckDefinition { + if values == nil { + return nil + } + result := make([]*CheckDefinition, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoCheck directly +type Check struct { + TcpCheck *TCPCheck `json:"tcp_check,omitempty"` + HttpCheck *HTTPCheck `json:"http_check,omitempty"` +} + +func (this *Check) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*Check) + if !ok { + that2, ok := that.(Check) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.TcpCheck == nil { + if that1.TcpCheck != nil { + return false + } + } else if !this.TcpCheck.Equal(*that1.TcpCheck) { + return false + } + if this.HttpCheck == nil { + if that1.HttpCheck != nil { + return false + } + } else if !this.HttpCheck.Equal(*that1.HttpCheck) { + return false + } + return true +} +func (m *Check) GetTcpCheck() *TCPCheck { + if m != nil { + return m.TcpCheck + } + return nil +} +func (m *Check) SetTcpCheck(value *TCPCheck) { + if m != nil { + m.TcpCheck = value + } +} +func (m *Check) GetHttpCheck() *HTTPCheck { + if m != nil { + return m.HttpCheck + } + return nil +} +func (m *Check) SetHttpCheck(value *HTTPCheck) { + if m != nil { + m.HttpCheck = value + } +} +func (x *Check) ToProto() *ProtoCheck { + if x == nil { + return nil + } + + proto := &ProtoCheck{ + TcpCheck: x.TcpCheck.ToProto(), + HttpCheck: x.HttpCheck.ToProto(), + } + return proto +} + +func (x *ProtoCheck) FromProto() *Check { + if x == nil { + return nil + } + + copysafe := &Check{ + TcpCheck: x.TcpCheck.FromProto(), + HttpCheck: x.HttpCheck.FromProto(), + } + return copysafe +} + +func CheckToProtoSlice(values []*Check) []*ProtoCheck { + if values == nil { + return nil + } + result := make([]*ProtoCheck, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func CheckFromProtoSlice(values []*ProtoCheck) []*Check { + if values == nil { + return nil + } + result := make([]*Check, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoTCPCheck directly +type TCPCheck struct { + Port uint32 `json:"port"` + ConnectTimeoutMs uint64 `json:"connect_timeout_ms,omitempty"` + IntervalMs uint64 `json:"interval_ms,omitempty"` +} + +func (this *TCPCheck) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TCPCheck) + if !ok { + that2, ok := that.(TCPCheck) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Port != that1.Port { + return false + } + if this.ConnectTimeoutMs != that1.ConnectTimeoutMs { + return false + } + if this.IntervalMs != that1.IntervalMs { + return false + } + return true +} +func (m *TCPCheck) GetPort() uint32 { + if m != nil { + return m.Port + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} +func (m *TCPCheck) SetPort(value uint32) { + if m != nil { + m.Port = value + } +} +func (m *TCPCheck) GetConnectTimeoutMs() uint64 { + if m != nil { + return m.ConnectTimeoutMs + } + var defaultValue uint64 + defaultValue = 0 + return defaultValue +} +func (m *TCPCheck) SetConnectTimeoutMs(value uint64) { + if m != nil { + m.ConnectTimeoutMs = value + } +} +func (m *TCPCheck) GetIntervalMs() uint64 { + if m != nil { + return m.IntervalMs + } + var defaultValue uint64 + defaultValue = 0 + return defaultValue +} +func (m *TCPCheck) SetIntervalMs(value uint64) { + if m != nil { + m.IntervalMs = value + } +} +func (x *TCPCheck) ToProto() *ProtoTCPCheck { + if x == nil { + return nil + } + + proto := &ProtoTCPCheck{ + Port: x.Port, + ConnectTimeoutMs: x.ConnectTimeoutMs, + IntervalMs: x.IntervalMs, + } + return proto +} + +func (x *ProtoTCPCheck) FromProto() *TCPCheck { + if x == nil { + return nil + } + + copysafe := &TCPCheck{ + Port: x.Port, + ConnectTimeoutMs: x.ConnectTimeoutMs, + IntervalMs: x.IntervalMs, + } + return copysafe +} + +func TCPCheckToProtoSlice(values []*TCPCheck) []*ProtoTCPCheck { + if values == nil { + return nil + } + result := make([]*ProtoTCPCheck, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TCPCheckFromProtoSlice(values []*ProtoTCPCheck) []*TCPCheck { + if values == nil { + return nil + } + result := make([]*TCPCheck, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoHTTPCheck directly +type HTTPCheck struct { + Port uint32 `json:"port"` + RequestTimeoutMs uint64 `json:"request_timeout_ms,omitempty"` + Path string `json:"path"` + IntervalMs uint64 `json:"interval_ms,omitempty"` +} + +func (this *HTTPCheck) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*HTTPCheck) + if !ok { + that2, ok := that.(HTTPCheck) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Port != that1.Port { + return false + } + if this.RequestTimeoutMs != that1.RequestTimeoutMs { + return false + } + if this.Path != that1.Path { + return false + } + if this.IntervalMs != that1.IntervalMs { + return false + } + return true +} +func (m *HTTPCheck) GetPort() uint32 { + if m != nil { + return m.Port + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} +func (m *HTTPCheck) SetPort(value uint32) { + if m != nil { + m.Port = value + } +} +func (m *HTTPCheck) GetRequestTimeoutMs() uint64 { + if m != nil { + return m.RequestTimeoutMs + } + var defaultValue uint64 + defaultValue = 0 + return defaultValue +} +func (m *HTTPCheck) SetRequestTimeoutMs(value uint64) { + if m != nil { + m.RequestTimeoutMs = value + } +} +func (m *HTTPCheck) GetPath() string { + if m != nil { + return m.Path + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *HTTPCheck) SetPath(value string) { + if m != nil { + m.Path = value + } +} +func (m *HTTPCheck) GetIntervalMs() uint64 { + if m != nil { + return m.IntervalMs + } + var defaultValue uint64 + defaultValue = 0 + return defaultValue +} +func (m *HTTPCheck) SetIntervalMs(value uint64) { + if m != nil { + m.IntervalMs = value + } +} +func (x *HTTPCheck) ToProto() *ProtoHTTPCheck { + if x == nil { + return nil + } + + proto := &ProtoHTTPCheck{ + Port: x.Port, + RequestTimeoutMs: x.RequestTimeoutMs, + Path: x.Path, + IntervalMs: x.IntervalMs, + } + return proto +} + +func (x *ProtoHTTPCheck) FromProto() *HTTPCheck { + if x == nil { + return nil + } + + copysafe := &HTTPCheck{ + Port: x.Port, + RequestTimeoutMs: x.RequestTimeoutMs, + Path: x.Path, + IntervalMs: x.IntervalMs, + } + return copysafe +} + +func HTTPCheckToProtoSlice(values []*HTTPCheck) []*ProtoHTTPCheck { + if values == nil { + return nil + } + result := make([]*ProtoHTTPCheck, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func HTTPCheckFromProtoSlice(values []*ProtoHTTPCheck) []*HTTPCheck { + if values == nil { + return nil + } + result := make([]*HTTPCheck, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/desired_lrp.go b/models/desired_lrp.go index 7a920ce9..6288e094 100644 --- a/models/desired_lrp.go +++ b/models/desired_lrp.go @@ -37,29 +37,28 @@ func PreloadedRootFS(stack string) string { func NewDesiredLRP(schedInfo DesiredLRPSchedulingInfo, runInfo DesiredLRPRunInfo, metricTags map[string]*MetricTagValue) DesiredLRP { environmentVariables := make([]*EnvironmentVariable, len(runInfo.EnvironmentVariables)) - for i := range runInfo.EnvironmentVariables { - environmentVariables[i] = &runInfo.EnvironmentVariables[i] - } + copy(environmentVariables, runInfo.EnvironmentVariables) volumeMountedFiles := make([]*File, len(runInfo.VolumeMountedFiles)) copy(volumeMountedFiles, runInfo.VolumeMountedFiles) egressRules := make([]*SecurityGroupRule, len(runInfo.EgressRules)) - for i := range runInfo.EgressRules { - egressRules[i] = &runInfo.EgressRules[i] - } + copy(egressRules, runInfo.EgressRules) + + desiredLrpKey := schedInfo.DesiredLrpKey + desiredLrpResource := schedInfo.DesiredLrpResource return DesiredLRP{ - ProcessGuid: schedInfo.ProcessGuid, - Domain: schedInfo.Domain, - LogGuid: schedInfo.LogGuid, - MemoryMb: schedInfo.MemoryMb, - DiskMb: schedInfo.DiskMb, - MaxPids: schedInfo.MaxPids, - RootFs: schedInfo.RootFs, + ProcessGuid: desiredLrpKey.ProcessGuid, + Domain: desiredLrpKey.Domain, + LogGuid: desiredLrpKey.LogGuid, + MemoryMb: desiredLrpResource.MemoryMb, + DiskMb: desiredLrpResource.DiskMb, + MaxPids: desiredLrpResource.MaxPids, + RootFs: desiredLrpResource.RootFs, Instances: schedInfo.Instances, Annotation: schedInfo.Annotation, - Routes: &schedInfo.Routes, + Routes: schedInfo.Routes, ModificationTag: &schedInfo.ModificationTag, EnvironmentVariables: environmentVariables, CachedDependencies: runInfo.CachedDependencies, @@ -92,17 +91,13 @@ func NewDesiredLRP(schedInfo DesiredLRPSchedulingInfo, runInfo DesiredLRPRunInfo func (desiredLRP *DesiredLRP) AddRunInfo(runInfo DesiredLRPRunInfo) { environmentVariables := make([]*EnvironmentVariable, len(runInfo.EnvironmentVariables)) - for i := range runInfo.EnvironmentVariables { - environmentVariables[i] = &runInfo.EnvironmentVariables[i] - } + copy(environmentVariables, runInfo.EnvironmentVariables) volumeMountedFiles := make([]*File, len(runInfo.VolumeMountedFiles)) copy(volumeMountedFiles, runInfo.VolumeMountedFiles) egressRules := make([]*SecurityGroupRule, len(runInfo.EgressRules)) - for i := range runInfo.EgressRules { - egressRules[i] = &runInfo.EgressRules[i] - } + copy(egressRules, runInfo.EgressRules) desiredLRP.EnvironmentVariables = environmentVariables desiredLRP.CachedDependencies = runInfo.CachedDependencies @@ -224,10 +219,6 @@ func (d *DesiredLRP) DesiredLRPResource() DesiredLRPResource { } func (d *DesiredLRP) DesiredLRPSchedulingInfo() DesiredLRPSchedulingInfo { - var routes Routes - if d.Routes != nil { - routes = *d.Routes - } var modificationTag ModificationTag if d.ModificationTag != nil { modificationTag = *d.ModificationTag @@ -244,7 +235,7 @@ func (d *DesiredLRP) DesiredLRPSchedulingInfo() DesiredLRPSchedulingInfo { d.Annotation, d.Instances, d.DesiredLRPResource(), - routes, + d.Routes, modificationTag, &volumePlacement, d.PlacementTags, @@ -272,19 +263,15 @@ func (d *DesiredLRP) DesiredLRPRoutingInfo() DesiredLRP { } func (d *DesiredLRP) DesiredLRPRunInfo(createdAt time.Time) DesiredLRPRunInfo { - environmentVariables := make([]EnvironmentVariable, len(d.EnvironmentVariables)) - for i := range d.EnvironmentVariables { - environmentVariables[i] = *d.EnvironmentVariables[i] - } + environmentVariables := make([]*EnvironmentVariable, len(d.EnvironmentVariables)) + copy(environmentVariables, d.EnvironmentVariables) + + egressRules := make([]*SecurityGroupRule, len(d.EgressRules)) + copy(egressRules, d.EgressRules) volumeMountedFiles := make([]*File, len(d.VolumeMountedFiles)) copy(volumeMountedFiles, d.VolumeMountedFiles) - egressRules := make([]SecurityGroupRule, len(d.EgressRules)) - for i := range d.EgressRules { - egressRules[i] = *d.EgressRules[i] - } - return NewDesiredLRPRunInfo( d.DesiredLRPKey(), createdAt, @@ -320,6 +307,10 @@ func (d *DesiredLRP) Copy() *DesiredLRP { return &newDesired } +func (request *ProtoDesiredLRP) Validate() error { + return request.FromProto().Validate() +} + func (desired DesiredLRP) Validate() error { var validationError ValidationError @@ -398,14 +389,18 @@ func (desired DesiredLRP) Validate() error { return validationError.ToError() } +func (request *ProtoDesiredLRPUpdate) Validate() error { + return request.FromProto().Validate() +} + func (desired *DesiredLRPUpdate) Validate() error { var validationError ValidationError - if desired.GetInstances() < 0 { + if *desired.GetInstances() < 0 { validationError = validationError.Append(ErrInvalidField{"instances"}) } - if len(desired.GetAnnotation()) > maximumAnnotationLength { + if len(*desired.GetAnnotation()) > maximumAnnotationLength { validationError = validationError.Append(ErrInvalidField{"annotation"}) } @@ -429,28 +424,6 @@ func (desired *DesiredLRPUpdate) Validate() error { return validationError.ToError() } -func (desired *DesiredLRPUpdate) SetInstances(instances int32) { - desired.OptionalInstances = &DesiredLRPUpdate_Instances{ - Instances: instances, - } -} - -func (desired DesiredLRPUpdate) InstancesExists() bool { - _, ok := desired.GetOptionalInstances().(*DesiredLRPUpdate_Instances) - return ok -} - -func (desired *DesiredLRPUpdate) SetAnnotation(annotation string) { - desired.OptionalAnnotation = &DesiredLRPUpdate_Annotation{ - Annotation: annotation, - } -} - -func (desired DesiredLRPUpdate) AnnotationExists() bool { - _, ok := desired.GetOptionalAnnotation().(*DesiredLRPUpdate_Annotation) - return ok -} - func (desired DesiredLRPUpdate) IsRoutesGroupUpdated(routes *Routes, routerGroup string) bool { if desired.Routes == nil { return false @@ -506,11 +479,11 @@ func (desired *DesiredLRPUpdate) UnmarshalJSON(data []byte) error { } if update.Instances != nil { - desired.SetInstances(*update.Instances) + desired.SetInstances(update.Instances) } desired.Routes = update.Routes if update.Annotation != nil { - desired.SetAnnotation(*update.Annotation) + desired.SetAnnotation(update.Annotation) } desired.MetricTags = update.MetricTags @@ -521,12 +494,12 @@ func (desired DesiredLRPUpdate) MarshalJSON() ([]byte, error) { var update internalDesiredLRPUpdate if desired.InstancesExists() { i := desired.GetInstances() - update.Instances = &i + update.Instances = i } update.Routes = desired.Routes if desired.AnnotationExists() { a := desired.GetAnnotation() - update.Annotation = &a + update.Annotation = a } update.MetricTags = desired.MetricTags return json.Marshal(update) @@ -540,6 +513,10 @@ func NewDesiredLRPKey(processGuid, domain, logGuid string) DesiredLRPKey { } } +func (request *ProtoDesiredLRPKey) Validate() error { + return request.FromProto().Validate() +} + func (key DesiredLRPKey) Validate() error { var validationError ValidationError if key.GetDomain() == "" { @@ -558,16 +535,16 @@ func NewDesiredLRPSchedulingInfo( annotation string, instances int32, resource DesiredLRPResource, - routes Routes, + routes *Routes, modTag ModificationTag, volumePlacement *VolumePlacement, placementTags []string, ) DesiredLRPSchedulingInfo { return DesiredLRPSchedulingInfo{ - DesiredLRPKey: key, + DesiredLrpKey: key, Annotation: annotation, Instances: instances, - DesiredLRPResource: resource, + DesiredLrpResource: resource, Routes: routes, ModificationTag: modTag, VolumePlacement: volumePlacement, @@ -595,13 +572,13 @@ func NewDesiredLRPRoutingInfo( func (s *DesiredLRPSchedulingInfo) ApplyUpdate(update *DesiredLRPUpdate) { if update.InstancesExists() { - s.Instances = update.GetInstances() + s.Instances = *update.GetInstances() } if update.Routes != nil { - s.Routes = *update.Routes + s.Routes = update.Routes } if update.AnnotationExists() { - s.Annotation = update.GetAnnotation() + s.Annotation = *update.GetAnnotation() } s.ModificationTag.Increment() } @@ -610,10 +587,14 @@ func (*DesiredLRPSchedulingInfo) Version() format.Version { return format.V0 } +func (request *ProtoDesiredLRPSchedulingInfo) Validate() error { + return request.FromProto().Validate() +} + func (s DesiredLRPSchedulingInfo) Validate() error { var validationError ValidationError - validationError = validationError.Check(s.DesiredLRPKey, s.DesiredLRPResource, s.Routes) + validationError = validationError.Check(s.DesiredLrpKey, s.DesiredLrpResource, s.Routes) if s.GetInstances() < 0 { validationError = validationError.Append(ErrInvalidField{"instances"}) @@ -635,6 +616,10 @@ func NewDesiredLRPResource(memoryMb, diskMb, maxPids int32, rootFs string) Desir } } +func (request *ProtoDesiredLRPResource) Validate() error { + return request.FromProto().Validate() +} + func (resource DesiredLRPResource) Validate() error { var validationError ValidationError @@ -661,7 +646,7 @@ func (resource DesiredLRPResource) Validate() error { func NewDesiredLRPRunInfo( key DesiredLRPKey, createdAt time.Time, - envVars []EnvironmentVariable, + envVars []*EnvironmentVariable, cacheDeps []*CachedDependency, setup, action, @@ -670,7 +655,7 @@ func NewDesiredLRPRunInfo( privileged bool, cpuWeight uint32, ports []uint32, - egressRules []SecurityGroupRule, + egressRules []*SecurityGroupRule, logSource, metricsGuid string, legacyDownloadUser string, @@ -686,7 +671,7 @@ func NewDesiredLRPRunInfo( volumeMountedFiles []*File, ) DesiredLRPRunInfo { return DesiredLRPRunInfo{ - DesiredLRPKey: key, + DesiredLrpKey: key, CreatedAt: createdAt.UnixNano(), EnvironmentVariables: envVars, CachedDependencies: cacheDeps, @@ -715,10 +700,14 @@ func NewDesiredLRPRunInfo( } } +func (request *ProtoDesiredLRPRunInfo) Validate() error { + return request.FromProto().Validate() +} + func (runInfo DesiredLRPRunInfo) Validate() error { var validationError ValidationError - validationError = validationError.Check(runInfo.DesiredLRPKey) + validationError = validationError.Check(runInfo.DesiredLrpKey) if len(runInfo.VolumeMountedFiles) > 0 { err := validateVolumeMountedFiles(runInfo.VolumeMountedFiles) @@ -808,6 +797,10 @@ func (*CertificateProperties) Version() format.Version { return format.V0 } +func (request *ProtoCertificateProperties) Validate() error { + return request.FromProto().Validate() +} + func (CertificateProperties) Validate() error { return nil } diff --git a/models/desired_lrp.pb.go b/models/desired_lrp.pb.go index 123c9d8e..9ebc041d 100644 --- a/models/desired_lrp.pb.go +++ b/models/desired_lrp.pb.go @@ -1,7407 +1,1253 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: desired_lrp.proto package models import ( - bytes "bytes" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type DesiredLRPSchedulingInfo struct { - DesiredLRPKey `protobuf:"bytes,1,opt,name=desired_lrp_key,json=desiredLrpKey,proto3,embedded=desired_lrp_key" json:""` - Annotation string `protobuf:"bytes,2,opt,name=annotation,proto3" json:"annotation"` - Instances int32 `protobuf:"varint,3,opt,name=instances,proto3" json:"instances"` - DesiredLRPResource `protobuf:"bytes,4,opt,name=desired_lrp_resource,json=desiredLrpResource,proto3,embedded=desired_lrp_resource" json:""` - Routes Routes `protobuf:"bytes,5,opt,name=routes,proto3,customtype=Routes" json:"routes"` - ModificationTag `protobuf:"bytes,6,opt,name=modification_tag,json=modificationTag,proto3,embedded=modification_tag" json:""` - VolumePlacement *VolumePlacement `protobuf:"bytes,7,opt,name=volume_placement,json=volumePlacement,proto3" json:"volume_placement,omitempty"` - PlacementTags []string `protobuf:"bytes,8,rep,name=PlacementTags,proto3" json:"placement_tags,omitempty"` +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ProtoDesiredLRPSchedulingInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + DesiredLrpKey *ProtoDesiredLRPKey `protobuf:"bytes,1,opt,name=desired_lrp_key,proto3" json:"desired_lrp_key,omitempty"` + Annotation string `protobuf:"bytes,2,opt,name=annotation,proto3" json:"annotation,omitempty"` + Instances int32 `protobuf:"varint,3,opt,name=instances,proto3" json:"instances,omitempty"` + DesiredLrpResource *ProtoDesiredLRPResource `protobuf:"bytes,4,opt,name=desired_lrp_resource,proto3" json:"desired_lrp_resource,omitempty"` + Routes *ProtoRoutes `protobuf:"bytes,5,opt,name=routes,proto3" json:"routes,omitempty"` + ModificationTag *ProtoModificationTag `protobuf:"bytes,6,opt,name=modification_tag,proto3" json:"modification_tag,omitempty"` + VolumePlacement *ProtoVolumePlacement `protobuf:"bytes,7,opt,name=volume_placement,proto3" json:"volume_placement,omitempty"` + PlacementTags []string `protobuf:"bytes,8,rep,name=PlacementTags,json=placement_tags,proto3" json:"PlacementTags,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DesiredLRPSchedulingInfo) Reset() { *m = DesiredLRPSchedulingInfo{} } -func (*DesiredLRPSchedulingInfo) ProtoMessage() {} -func (*DesiredLRPSchedulingInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_f592e9299b63d68c, []int{0} +func (x *ProtoDesiredLRPSchedulingInfo) Reset() { + *x = ProtoDesiredLRPSchedulingInfo{} + mi := &file_desired_lrp_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DesiredLRPSchedulingInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoDesiredLRPSchedulingInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DesiredLRPSchedulingInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPSchedulingInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoDesiredLRPSchedulingInfo) ProtoMessage() {} + +func (x *ProtoDesiredLRPSchedulingInfo) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *DesiredLRPSchedulingInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPSchedulingInfo.Merge(m, src) -} -func (m *DesiredLRPSchedulingInfo) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRPSchedulingInfo) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPSchedulingInfo.DiscardUnknown(m) + +// Deprecated: Use ProtoDesiredLRPSchedulingInfo.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPSchedulingInfo) Descriptor() ([]byte, []int) { + return file_desired_lrp_proto_rawDescGZIP(), []int{0} } -var xxx_messageInfo_DesiredLRPSchedulingInfo proto.InternalMessageInfo +func (x *ProtoDesiredLRPSchedulingInfo) GetDesiredLrpKey() *ProtoDesiredLRPKey { + if x != nil { + return x.DesiredLrpKey + } + return nil +} -func (m *DesiredLRPSchedulingInfo) GetAnnotation() string { - if m != nil { - return m.Annotation +func (x *ProtoDesiredLRPSchedulingInfo) GetAnnotation() string { + if x != nil { + return x.Annotation } return "" } -func (m *DesiredLRPSchedulingInfo) GetInstances() int32 { - if m != nil { - return m.Instances +func (x *ProtoDesiredLRPSchedulingInfo) GetInstances() int32 { + if x != nil { + return x.Instances } return 0 } -func (m *DesiredLRPSchedulingInfo) GetVolumePlacement() *VolumePlacement { - if m != nil { - return m.VolumePlacement +func (x *ProtoDesiredLRPSchedulingInfo) GetDesiredLrpResource() *ProtoDesiredLRPResource { + if x != nil { + return x.DesiredLrpResource } return nil } -func (m *DesiredLRPSchedulingInfo) GetPlacementTags() []string { - if m != nil { - return m.PlacementTags +func (x *ProtoDesiredLRPSchedulingInfo) GetRoutes() *ProtoRoutes { + if x != nil { + return x.Routes } return nil } -type DesiredLRPRunInfo struct { - DesiredLRPKey `protobuf:"bytes,1,opt,name=desired_lrp_key,json=desiredLrpKey,proto3,embedded=desired_lrp_key" json:""` - EnvironmentVariables []EnvironmentVariable `protobuf:"bytes,2,rep,name=environment_variables,json=environmentVariables,proto3" json:"env"` - Setup *Action `protobuf:"bytes,3,opt,name=setup,proto3" json:"setup,omitempty"` - Action *Action `protobuf:"bytes,4,opt,name=action,proto3" json:"action,omitempty"` - Monitor *Action `protobuf:"bytes,5,opt,name=monitor,proto3" json:"monitor,omitempty"` - DeprecatedStartTimeoutS uint32 `protobuf:"varint,6,opt,name=deprecated_start_timeout_s,json=deprecatedStartTimeoutS,proto3" json:"start_timeout,omitempty"` // Deprecated: Do not use. - Privileged bool `protobuf:"varint,7,opt,name=privileged,proto3" json:"privileged"` - CpuWeight uint32 `protobuf:"varint,8,opt,name=cpu_weight,json=cpuWeight,proto3" json:"cpu_weight"` - Ports []uint32 `protobuf:"varint,9,rep,name=ports,proto3" json:"ports,omitempty"` - EgressRules []SecurityGroupRule `protobuf:"bytes,10,rep,name=egress_rules,json=egressRules,proto3" json:"egress_rules"` - LogSource string `protobuf:"bytes,11,opt,name=log_source,json=logSource,proto3" json:"log_source"` - MetricsGuid string `protobuf:"bytes,12,opt,name=metrics_guid,json=metricsGuid,proto3" json:"metrics_guid"` // Deprecated: Do not use. - CreatedAt int64 `protobuf:"varint,13,opt,name=created_at,json=createdAt,proto3" json:"created_at"` - CachedDependencies []*CachedDependency `protobuf:"bytes,14,rep,name=cached_dependencies,json=cachedDependencies,proto3" json:"cached_dependencies,omitempty"` - LegacyDownloadUser string `protobuf:"bytes,15,opt,name=legacy_download_user,json=legacyDownloadUser,proto3" json:"legacy_download_user,omitempty"` // Deprecated: Do not use. - TrustedSystemCertificatesPath string `protobuf:"bytes,16,opt,name=trusted_system_certificates_path,json=trustedSystemCertificatesPath,proto3" json:"trusted_system_certificates_path,omitempty"` - VolumeMounts []*VolumeMount `protobuf:"bytes,17,rep,name=volume_mounts,json=volumeMounts,proto3" json:"volume_mounts,omitempty"` - Network *Network `protobuf:"bytes,18,opt,name=network,proto3" json:"network,omitempty"` - StartTimeoutMs int64 `protobuf:"varint,19,opt,name=start_timeout_ms,json=startTimeoutMs,proto3" json:"start_timeout_ms"` - CertificateProperties *CertificateProperties `protobuf:"bytes,20,opt,name=certificate_properties,json=certificateProperties,proto3" json:"certificate_properties,omitempty"` - ImageUsername string `protobuf:"bytes,21,opt,name=image_username,json=imageUsername,proto3" json:"image_username,omitempty"` - ImagePassword string `protobuf:"bytes,22,opt,name=image_password,json=imagePassword,proto3" json:"image_password,omitempty"` - CheckDefinition *CheckDefinition `protobuf:"bytes,23,opt,name=check_definition,json=checkDefinition,proto3" json:"check_definition,omitempty"` - ImageLayers []*ImageLayer `protobuf:"bytes,24,rep,name=image_layers,json=imageLayers,proto3" json:"image_layers,omitempty"` - MetricTags map[string]*MetricTagValue `protobuf:"bytes,25,rep,name=metric_tags,json=metricTags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Deprecated: Do not use. - Sidecars []*Sidecar `protobuf:"bytes,26,rep,name=sidecars,proto3" json:"sidecars,omitempty"` - LogRateLimit *LogRateLimit `protobuf:"bytes,27,opt,name=log_rate_limit,json=logRateLimit,proto3" json:"log_rate_limit,omitempty"` - VolumeMountedFiles []*File `protobuf:"bytes,28,rep,name=volume_mounted_files,json=volumeMountedFiles,proto3" json:"volume_mounted_files"` +func (x *ProtoDesiredLRPSchedulingInfo) GetModificationTag() *ProtoModificationTag { + if x != nil { + return x.ModificationTag + } + return nil } -func (m *DesiredLRPRunInfo) Reset() { *m = DesiredLRPRunInfo{} } -func (*DesiredLRPRunInfo) ProtoMessage() {} -func (*DesiredLRPRunInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_f592e9299b63d68c, []int{1} -} -func (m *DesiredLRPRunInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DesiredLRPRunInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPRunInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ProtoDesiredLRPSchedulingInfo) GetVolumePlacement() *ProtoVolumePlacement { + if x != nil { + return x.VolumePlacement } + return nil } -func (m *DesiredLRPRunInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPRunInfo.Merge(m, src) -} -func (m *DesiredLRPRunInfo) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRPRunInfo) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPRunInfo.DiscardUnknown(m) + +func (x *ProtoDesiredLRPSchedulingInfo) GetPlacementTags() []string { + if x != nil { + return x.PlacementTags + } + return nil } -var xxx_messageInfo_DesiredLRPRunInfo proto.InternalMessageInfo +type ProtoDesiredLRPRunInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + DesiredLrpKey *ProtoDesiredLRPKey `protobuf:"bytes,1,opt,name=desired_lrp_key,proto3" json:"desired_lrp_key,omitempty"` + EnvironmentVariables []*ProtoEnvironmentVariable `protobuf:"bytes,2,rep,name=environment_variables,json=env,proto3" json:"environment_variables,omitempty"` + Setup *ProtoAction `protobuf:"bytes,3,opt,name=setup,proto3" json:"setup,omitempty"` + Action *ProtoAction `protobuf:"bytes,4,opt,name=action,proto3" json:"action,omitempty"` + Monitor *ProtoAction `protobuf:"bytes,5,opt,name=monitor,proto3" json:"monitor,omitempty"` + // Deprecated: Marked as deprecated in desired_lrp.proto. + DeprecatedStartTimeoutS uint32 `protobuf:"varint,6,opt,name=deprecated_start_timeout_s,json=start_timeout,proto3" json:"deprecated_start_timeout_s,omitempty"` + Privileged bool `protobuf:"varint,7,opt,name=privileged,proto3" json:"privileged,omitempty"` + CpuWeight uint32 `protobuf:"varint,8,opt,name=cpu_weight,proto3" json:"cpu_weight,omitempty"` + Ports []uint32 `protobuf:"varint,9,rep,name=ports,proto3" json:"ports,omitempty"` + EgressRules []*ProtoSecurityGroupRule `protobuf:"bytes,10,rep,name=egress_rules,proto3" json:"egress_rules,omitempty"` + LogSource string `protobuf:"bytes,11,opt,name=log_source,proto3" json:"log_source,omitempty"` + // Deprecated: Marked as deprecated in desired_lrp.proto. + MetricsGuid string `protobuf:"bytes,12,opt,name=metrics_guid,proto3" json:"metrics_guid,omitempty"` + CreatedAt int64 `protobuf:"varint,13,opt,name=created_at,proto3" json:"created_at,omitempty"` + CachedDependencies []*ProtoCachedDependency `protobuf:"bytes,14,rep,name=cached_dependencies,json=cachedDependencies,proto3" json:"cached_dependencies,omitempty"` + // Deprecated: Marked as deprecated in desired_lrp.proto. + LegacyDownloadUser string `protobuf:"bytes,15,opt,name=legacy_download_user,proto3" json:"legacy_download_user,omitempty"` + TrustedSystemCertificatesPath string `protobuf:"bytes,16,opt,name=trusted_system_certificates_path,proto3" json:"trusted_system_certificates_path,omitempty"` + VolumeMounts []*ProtoVolumeMount `protobuf:"bytes,17,rep,name=volume_mounts,proto3" json:"volume_mounts,omitempty"` + Network *ProtoNetwork `protobuf:"bytes,18,opt,name=network,proto3" json:"network,omitempty"` + StartTimeoutMs int64 `protobuf:"varint,19,opt,name=start_timeout_ms,proto3" json:"start_timeout_ms,omitempty"` + CertificateProperties *ProtoCertificateProperties `protobuf:"bytes,20,opt,name=certificate_properties,proto3,oneof" json:"certificate_properties,omitempty"` + ImageUsername string `protobuf:"bytes,21,opt,name=image_username,proto3" json:"image_username,omitempty"` + ImagePassword string `protobuf:"bytes,22,opt,name=image_password,proto3" json:"image_password,omitempty"` + CheckDefinition *ProtoCheckDefinition `protobuf:"bytes,23,opt,name=check_definition,proto3" json:"check_definition,omitempty"` + ImageLayers []*ProtoImageLayer `protobuf:"bytes,24,rep,name=image_layers,proto3" json:"image_layers,omitempty"` + // Deprecated: Marked as deprecated in desired_lrp.proto. + MetricTags map[string]*ProtoMetricTagValue `protobuf:"bytes,25,rep,name=metric_tags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Sidecars []*ProtoSidecar `protobuf:"bytes,26,rep,name=sidecars,proto3" json:"sidecars,omitempty"` + LogRateLimit *ProtoLogRateLimit `protobuf:"bytes,27,opt,name=log_rate_limit,proto3" json:"log_rate_limit,omitempty"` + VolumeMountedFiles []*ProtoFile `protobuf:"bytes,28,rep,name=volume_mounted_files,proto3" json:"volume_mounted_files,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProtoDesiredLRPRunInfo) Reset() { + *x = ProtoDesiredLRPRunInfo{} + mi := &file_desired_lrp_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProtoDesiredLRPRunInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProtoDesiredLRPRunInfo) ProtoMessage() {} + +func (x *ProtoDesiredLRPRunInfo) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProtoDesiredLRPRunInfo.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPRunInfo) Descriptor() ([]byte, []int) { + return file_desired_lrp_proto_rawDescGZIP(), []int{1} +} + +func (x *ProtoDesiredLRPRunInfo) GetDesiredLrpKey() *ProtoDesiredLRPKey { + if x != nil { + return x.DesiredLrpKey + } + return nil +} -func (m *DesiredLRPRunInfo) GetEnvironmentVariables() []EnvironmentVariable { - if m != nil { - return m.EnvironmentVariables +func (x *ProtoDesiredLRPRunInfo) GetEnvironmentVariables() []*ProtoEnvironmentVariable { + if x != nil { + return x.EnvironmentVariables } return nil } -func (m *DesiredLRPRunInfo) GetSetup() *Action { - if m != nil { - return m.Setup +func (x *ProtoDesiredLRPRunInfo) GetSetup() *ProtoAction { + if x != nil { + return x.Setup } return nil } -func (m *DesiredLRPRunInfo) GetAction() *Action { - if m != nil { - return m.Action +func (x *ProtoDesiredLRPRunInfo) GetAction() *ProtoAction { + if x != nil { + return x.Action } return nil } -func (m *DesiredLRPRunInfo) GetMonitor() *Action { - if m != nil { - return m.Monitor +func (x *ProtoDesiredLRPRunInfo) GetMonitor() *ProtoAction { + if x != nil { + return x.Monitor } return nil } -// Deprecated: Do not use. -func (m *DesiredLRPRunInfo) GetDeprecatedStartTimeoutS() uint32 { - if m != nil { - return m.DeprecatedStartTimeoutS +// Deprecated: Marked as deprecated in desired_lrp.proto. +func (x *ProtoDesiredLRPRunInfo) GetDeprecatedStartTimeoutS() uint32 { + if x != nil { + return x.DeprecatedStartTimeoutS } return 0 } -func (m *DesiredLRPRunInfo) GetPrivileged() bool { - if m != nil { - return m.Privileged +func (x *ProtoDesiredLRPRunInfo) GetPrivileged() bool { + if x != nil { + return x.Privileged } return false } -func (m *DesiredLRPRunInfo) GetCpuWeight() uint32 { - if m != nil { - return m.CpuWeight +func (x *ProtoDesiredLRPRunInfo) GetCpuWeight() uint32 { + if x != nil { + return x.CpuWeight } return 0 } -func (m *DesiredLRPRunInfo) GetPorts() []uint32 { - if m != nil { - return m.Ports +func (x *ProtoDesiredLRPRunInfo) GetPorts() []uint32 { + if x != nil { + return x.Ports } return nil } -func (m *DesiredLRPRunInfo) GetEgressRules() []SecurityGroupRule { - if m != nil { - return m.EgressRules +func (x *ProtoDesiredLRPRunInfo) GetEgressRules() []*ProtoSecurityGroupRule { + if x != nil { + return x.EgressRules } return nil } -func (m *DesiredLRPRunInfo) GetLogSource() string { - if m != nil { - return m.LogSource +func (x *ProtoDesiredLRPRunInfo) GetLogSource() string { + if x != nil { + return x.LogSource } return "" } -// Deprecated: Do not use. -func (m *DesiredLRPRunInfo) GetMetricsGuid() string { - if m != nil { - return m.MetricsGuid +// Deprecated: Marked as deprecated in desired_lrp.proto. +func (x *ProtoDesiredLRPRunInfo) GetMetricsGuid() string { + if x != nil { + return x.MetricsGuid } return "" } -func (m *DesiredLRPRunInfo) GetCreatedAt() int64 { - if m != nil { - return m.CreatedAt +func (x *ProtoDesiredLRPRunInfo) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt } return 0 } -func (m *DesiredLRPRunInfo) GetCachedDependencies() []*CachedDependency { - if m != nil { - return m.CachedDependencies +func (x *ProtoDesiredLRPRunInfo) GetCachedDependencies() []*ProtoCachedDependency { + if x != nil { + return x.CachedDependencies } return nil } -// Deprecated: Do not use. -func (m *DesiredLRPRunInfo) GetLegacyDownloadUser() string { - if m != nil { - return m.LegacyDownloadUser +// Deprecated: Marked as deprecated in desired_lrp.proto. +func (x *ProtoDesiredLRPRunInfo) GetLegacyDownloadUser() string { + if x != nil { + return x.LegacyDownloadUser } return "" } -func (m *DesiredLRPRunInfo) GetTrustedSystemCertificatesPath() string { - if m != nil { - return m.TrustedSystemCertificatesPath +func (x *ProtoDesiredLRPRunInfo) GetTrustedSystemCertificatesPath() string { + if x != nil { + return x.TrustedSystemCertificatesPath } return "" } -func (m *DesiredLRPRunInfo) GetVolumeMounts() []*VolumeMount { - if m != nil { - return m.VolumeMounts +func (x *ProtoDesiredLRPRunInfo) GetVolumeMounts() []*ProtoVolumeMount { + if x != nil { + return x.VolumeMounts } return nil } -func (m *DesiredLRPRunInfo) GetNetwork() *Network { - if m != nil { - return m.Network +func (x *ProtoDesiredLRPRunInfo) GetNetwork() *ProtoNetwork { + if x != nil { + return x.Network } return nil } -func (m *DesiredLRPRunInfo) GetStartTimeoutMs() int64 { - if m != nil { - return m.StartTimeoutMs +func (x *ProtoDesiredLRPRunInfo) GetStartTimeoutMs() int64 { + if x != nil { + return x.StartTimeoutMs } return 0 } -func (m *DesiredLRPRunInfo) GetCertificateProperties() *CertificateProperties { - if m != nil { - return m.CertificateProperties +func (x *ProtoDesiredLRPRunInfo) GetCertificateProperties() *ProtoCertificateProperties { + if x != nil { + return x.CertificateProperties } return nil } -func (m *DesiredLRPRunInfo) GetImageUsername() string { - if m != nil { - return m.ImageUsername +func (x *ProtoDesiredLRPRunInfo) GetImageUsername() string { + if x != nil { + return x.ImageUsername } return "" } -func (m *DesiredLRPRunInfo) GetImagePassword() string { - if m != nil { - return m.ImagePassword +func (x *ProtoDesiredLRPRunInfo) GetImagePassword() string { + if x != nil { + return x.ImagePassword } return "" } -func (m *DesiredLRPRunInfo) GetCheckDefinition() *CheckDefinition { - if m != nil { - return m.CheckDefinition +func (x *ProtoDesiredLRPRunInfo) GetCheckDefinition() *ProtoCheckDefinition { + if x != nil { + return x.CheckDefinition } return nil } -func (m *DesiredLRPRunInfo) GetImageLayers() []*ImageLayer { - if m != nil { - return m.ImageLayers +func (x *ProtoDesiredLRPRunInfo) GetImageLayers() []*ProtoImageLayer { + if x != nil { + return x.ImageLayers } return nil } -// Deprecated: Do not use. -func (m *DesiredLRPRunInfo) GetMetricTags() map[string]*MetricTagValue { - if m != nil { - return m.MetricTags +// Deprecated: Marked as deprecated in desired_lrp.proto. +func (x *ProtoDesiredLRPRunInfo) GetMetricTags() map[string]*ProtoMetricTagValue { + if x != nil { + return x.MetricTags } return nil } -func (m *DesiredLRPRunInfo) GetSidecars() []*Sidecar { - if m != nil { - return m.Sidecars +func (x *ProtoDesiredLRPRunInfo) GetSidecars() []*ProtoSidecar { + if x != nil { + return x.Sidecars } return nil } -func (m *DesiredLRPRunInfo) GetLogRateLimit() *LogRateLimit { - if m != nil { - return m.LogRateLimit +func (x *ProtoDesiredLRPRunInfo) GetLogRateLimit() *ProtoLogRateLimit { + if x != nil { + return x.LogRateLimit } return nil } -func (m *DesiredLRPRunInfo) GetVolumeMountedFiles() []*File { - if m != nil { - return m.VolumeMountedFiles +func (x *ProtoDesiredLRPRunInfo) GetVolumeMountedFiles() []*ProtoFile { + if x != nil { + return x.VolumeMountedFiles } return nil } // helper message for marshalling routes type ProtoRoutes struct { - Routes map[string][]byte `protobuf:"bytes,1,rep,name=routes,proto3" json:"routes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + state protoimpl.MessageState `protogen:"open.v1"` + Routes map[string][]byte `protobuf:"bytes,1,rep,name=routes,proto3" json:"routes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ProtoRoutes) Reset() { *m = ProtoRoutes{} } -func (*ProtoRoutes) ProtoMessage() {} -func (*ProtoRoutes) Descriptor() ([]byte, []int) { - return fileDescriptor_f592e9299b63d68c, []int{2} +func (x *ProtoRoutes) Reset() { + *x = ProtoRoutes{} + mi := &file_desired_lrp_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ProtoRoutes) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoRoutes) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ProtoRoutes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProtoRoutes.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoRoutes) ProtoMessage() {} + +func (x *ProtoRoutes) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ProtoRoutes) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProtoRoutes.Merge(m, src) -} -func (m *ProtoRoutes) XXX_Size() int { - return m.Size() -} -func (m *ProtoRoutes) XXX_DiscardUnknown() { - xxx_messageInfo_ProtoRoutes.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ProtoRoutes proto.InternalMessageInfo +// Deprecated: Use ProtoRoutes.ProtoReflect.Descriptor instead. +func (*ProtoRoutes) Descriptor() ([]byte, []int) { + return file_desired_lrp_proto_rawDescGZIP(), []int{2} +} -func (m *ProtoRoutes) GetRoutes() map[string][]byte { - if m != nil { - return m.Routes +func (x *ProtoRoutes) GetRoutes() map[string][]byte { + if x != nil { + return x.Routes } return nil } -type DesiredLRPUpdate struct { - // Types that are valid to be assigned to OptionalInstances: - // - // *DesiredLRPUpdate_Instances - OptionalInstances isDesiredLRPUpdate_OptionalInstances `protobuf_oneof:"optional_instances"` - Routes *Routes `protobuf:"bytes,2,opt,name=routes,proto3,customtype=Routes" json:"routes,omitempty"` - // Types that are valid to be assigned to OptionalAnnotation: - // - // *DesiredLRPUpdate_Annotation - OptionalAnnotation isDesiredLRPUpdate_OptionalAnnotation `protobuf_oneof:"optional_annotation"` - MetricTags map[string]*MetricTagValue `protobuf:"bytes,4,rep,name=metric_tags,json=metricTags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +type ProtoDesiredLRPUpdate struct { + state protoimpl.MessageState `protogen:"open.v1"` + Instances *int32 `protobuf:"varint,1,opt,name=instances,proto3,oneof" json:"instances,omitempty"` + Routes *ProtoRoutes `protobuf:"bytes,2,opt,name=routes,proto3,oneof" json:"routes,omitempty"` + Annotation *string `protobuf:"bytes,3,opt,name=annotation,proto3,oneof" json:"annotation,omitempty"` + MetricTags map[string]*ProtoMetricTagValue `protobuf:"bytes,4,rep,name=metric_tags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DesiredLRPUpdate) Reset() { *m = DesiredLRPUpdate{} } -func (*DesiredLRPUpdate) ProtoMessage() {} -func (*DesiredLRPUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_f592e9299b63d68c, []int{3} -} -func (m *DesiredLRPUpdate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DesiredLRPUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPUpdate.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DesiredLRPUpdate) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPUpdate.Merge(m, src) -} -func (m *DesiredLRPUpdate) XXX_Size() int { - return m.Size() +func (x *ProtoDesiredLRPUpdate) Reset() { + *x = ProtoDesiredLRPUpdate{} + mi := &file_desired_lrp_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DesiredLRPUpdate) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPUpdate.DiscardUnknown(m) + +func (x *ProtoDesiredLRPUpdate) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_DesiredLRPUpdate proto.InternalMessageInfo +func (*ProtoDesiredLRPUpdate) ProtoMessage() {} -type isDesiredLRPUpdate_OptionalInstances interface { - isDesiredLRPUpdate_OptionalInstances() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int -} -type isDesiredLRPUpdate_OptionalAnnotation interface { - isDesiredLRPUpdate_OptionalAnnotation() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int +func (x *ProtoDesiredLRPUpdate) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type DesiredLRPUpdate_Instances struct { - Instances int32 `protobuf:"varint,1,opt,name=instances,proto3,oneof" json:"instances,omitempty"` +// Deprecated: Use ProtoDesiredLRPUpdate.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPUpdate) Descriptor() ([]byte, []int) { + return file_desired_lrp_proto_rawDescGZIP(), []int{3} } -type DesiredLRPUpdate_Annotation struct { - Annotation string `protobuf:"bytes,3,opt,name=annotation,proto3,oneof" json:"annotation,omitempty"` -} - -func (*DesiredLRPUpdate_Instances) isDesiredLRPUpdate_OptionalInstances() {} -func (*DesiredLRPUpdate_Annotation) isDesiredLRPUpdate_OptionalAnnotation() {} -func (m *DesiredLRPUpdate) GetOptionalInstances() isDesiredLRPUpdate_OptionalInstances { - if m != nil { - return m.OptionalInstances - } - return nil -} -func (m *DesiredLRPUpdate) GetOptionalAnnotation() isDesiredLRPUpdate_OptionalAnnotation { - if m != nil { - return m.OptionalAnnotation +func (x *ProtoDesiredLRPUpdate) GetInstances() int32 { + if x != nil && x.Instances != nil { + return *x.Instances } - return nil + return 0 } -func (m *DesiredLRPUpdate) GetInstances() int32 { - if x, ok := m.GetOptionalInstances().(*DesiredLRPUpdate_Instances); ok { - return x.Instances +func (x *ProtoDesiredLRPUpdate) GetRoutes() *ProtoRoutes { + if x != nil { + return x.Routes } - return 0 + return nil } -func (m *DesiredLRPUpdate) GetAnnotation() string { - if x, ok := m.GetOptionalAnnotation().(*DesiredLRPUpdate_Annotation); ok { - return x.Annotation +func (x *ProtoDesiredLRPUpdate) GetAnnotation() string { + if x != nil && x.Annotation != nil { + return *x.Annotation } return "" } -func (m *DesiredLRPUpdate) GetMetricTags() map[string]*MetricTagValue { - if m != nil { - return m.MetricTags +func (x *ProtoDesiredLRPUpdate) GetMetricTags() map[string]*ProtoMetricTagValue { + if x != nil { + return x.MetricTags } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*DesiredLRPUpdate) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*DesiredLRPUpdate_Instances)(nil), - (*DesiredLRPUpdate_Annotation)(nil), - } +type ProtoDesiredLRPKey struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,proto3" json:"process_guid,omitempty"` + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` + LogGuid string `protobuf:"bytes,3,opt,name=log_guid,proto3" json:"log_guid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -type DesiredLRPKey struct { - ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,json=processGuid,proto3" json:"process_guid"` - Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain"` - LogGuid string `protobuf:"bytes,3,opt,name=log_guid,json=logGuid,proto3" json:"log_guid"` +func (x *ProtoDesiredLRPKey) Reset() { + *x = ProtoDesiredLRPKey{} + mi := &file_desired_lrp_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DesiredLRPKey) Reset() { *m = DesiredLRPKey{} } -func (*DesiredLRPKey) ProtoMessage() {} -func (*DesiredLRPKey) Descriptor() ([]byte, []int) { - return fileDescriptor_f592e9299b63d68c, []int{4} +func (x *ProtoDesiredLRPKey) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DesiredLRPKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DesiredLRPKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPKey.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoDesiredLRPKey) ProtoMessage() {} + +func (x *ProtoDesiredLRPKey) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *DesiredLRPKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPKey.Merge(m, src) -} -func (m *DesiredLRPKey) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRPKey) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPKey.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_DesiredLRPKey proto.InternalMessageInfo +// Deprecated: Use ProtoDesiredLRPKey.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPKey) Descriptor() ([]byte, []int) { + return file_desired_lrp_proto_rawDescGZIP(), []int{4} +} -func (m *DesiredLRPKey) GetProcessGuid() string { - if m != nil { - return m.ProcessGuid +func (x *ProtoDesiredLRPKey) GetProcessGuid() string { + if x != nil { + return x.ProcessGuid } return "" } -func (m *DesiredLRPKey) GetDomain() string { - if m != nil { - return m.Domain +func (x *ProtoDesiredLRPKey) GetDomain() string { + if x != nil { + return x.Domain } return "" } -func (m *DesiredLRPKey) GetLogGuid() string { - if m != nil { - return m.LogGuid +func (x *ProtoDesiredLRPKey) GetLogGuid() string { + if x != nil { + return x.LogGuid } return "" } -type DesiredLRPResource struct { - MemoryMb int32 `protobuf:"varint,1,opt,name=memory_mb,json=memoryMb,proto3" json:"memory_mb"` - DiskMb int32 `protobuf:"varint,2,opt,name=disk_mb,json=diskMb,proto3" json:"disk_mb"` - RootFs string `protobuf:"bytes,3,opt,name=root_fs,json=rootFs,proto3" json:"rootfs"` - MaxPids int32 `protobuf:"varint,4,opt,name=max_pids,json=maxPids,proto3" json:"max_pids"` +type ProtoDesiredLRPResource struct { + state protoimpl.MessageState `protogen:"open.v1"` + MemoryMb int32 `protobuf:"varint,1,opt,name=memory_mb,proto3" json:"memory_mb,omitempty"` + DiskMb int32 `protobuf:"varint,2,opt,name=disk_mb,proto3" json:"disk_mb,omitempty"` + RootFs string `protobuf:"bytes,3,opt,name=root_fs,json=rootfs,proto3" json:"root_fs,omitempty"` + MaxPids int32 `protobuf:"varint,4,opt,name=max_pids,proto3" json:"max_pids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DesiredLRPResource) Reset() { *m = DesiredLRPResource{} } -func (*DesiredLRPResource) ProtoMessage() {} -func (*DesiredLRPResource) Descriptor() ([]byte, []int) { - return fileDescriptor_f592e9299b63d68c, []int{5} +func (x *ProtoDesiredLRPResource) Reset() { + *x = ProtoDesiredLRPResource{} + mi := &file_desired_lrp_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DesiredLRPResource) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoDesiredLRPResource) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DesiredLRPResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPResource.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoDesiredLRPResource) ProtoMessage() {} + +func (x *ProtoDesiredLRPResource) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *DesiredLRPResource) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPResource.Merge(m, src) -} -func (m *DesiredLRPResource) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRPResource) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPResource.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_DesiredLRPResource proto.InternalMessageInfo +// Deprecated: Use ProtoDesiredLRPResource.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPResource) Descriptor() ([]byte, []int) { + return file_desired_lrp_proto_rawDescGZIP(), []int{5} +} -func (m *DesiredLRPResource) GetMemoryMb() int32 { - if m != nil { - return m.MemoryMb +func (x *ProtoDesiredLRPResource) GetMemoryMb() int32 { + if x != nil { + return x.MemoryMb } return 0 } -func (m *DesiredLRPResource) GetDiskMb() int32 { - if m != nil { - return m.DiskMb +func (x *ProtoDesiredLRPResource) GetDiskMb() int32 { + if x != nil { + return x.DiskMb } return 0 } -func (m *DesiredLRPResource) GetRootFs() string { - if m != nil { - return m.RootFs +func (x *ProtoDesiredLRPResource) GetRootFs() string { + if x != nil { + return x.RootFs } return "" } -func (m *DesiredLRPResource) GetMaxPids() int32 { - if m != nil { - return m.MaxPids +func (x *ProtoDesiredLRPResource) GetMaxPids() int32 { + if x != nil { + return x.MaxPids } return 0 } -type DesiredLRP struct { - ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,json=processGuid,proto3" json:"process_guid"` - Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain"` - RootFs string `protobuf:"bytes,3,opt,name=root_fs,json=rootFs,proto3" json:"rootfs"` - Instances int32 `protobuf:"varint,4,opt,name=instances,proto3" json:"instances"` - EnvironmentVariables []*EnvironmentVariable `protobuf:"bytes,5,rep,name=environment_variables,json=environmentVariables,proto3" json:"env"` - Setup *Action `protobuf:"bytes,6,opt,name=setup,proto3" json:"setup,omitempty"` - Action *Action `protobuf:"bytes,7,opt,name=action,proto3" json:"action,omitempty"` - StartTimeoutMs int64 `protobuf:"varint,27,opt,name=start_timeout_ms,json=startTimeoutMs,proto3" json:"start_timeout_ms"` - DeprecatedStartTimeoutS uint32 `protobuf:"varint,8,opt,name=deprecated_start_timeout_s,json=deprecatedStartTimeoutS,proto3" json:"deprecated_timeout_ns,omitempty"` // Deprecated: Do not use. - Monitor *Action `protobuf:"bytes,9,opt,name=monitor,proto3" json:"monitor,omitempty"` - DiskMb int32 `protobuf:"varint,10,opt,name=disk_mb,json=diskMb,proto3" json:"disk_mb"` - MemoryMb int32 `protobuf:"varint,11,opt,name=memory_mb,json=memoryMb,proto3" json:"memory_mb"` - CpuWeight uint32 `protobuf:"varint,12,opt,name=cpu_weight,json=cpuWeight,proto3" json:"cpu_weight"` - Privileged bool `protobuf:"varint,13,opt,name=privileged,proto3" json:"privileged"` - Ports []uint32 `protobuf:"varint,14,rep,name=ports,proto3" json:"ports,omitempty"` - Routes *Routes `protobuf:"bytes,15,opt,name=routes,proto3,customtype=Routes" json:"routes,omitempty"` - LogSource string `protobuf:"bytes,16,opt,name=log_source,json=logSource,proto3" json:"log_source"` - LogGuid string `protobuf:"bytes,17,opt,name=log_guid,json=logGuid,proto3" json:"log_guid"` - MetricsGuid string `protobuf:"bytes,18,opt,name=metrics_guid,json=metricsGuid,proto3" json:"metrics_guid"` // Deprecated: Do not use. - Annotation string `protobuf:"bytes,19,opt,name=annotation,proto3" json:"annotation"` - EgressRules []*SecurityGroupRule `protobuf:"bytes,20,rep,name=egress_rules,json=egressRules,proto3" json:"egress_rules,omitempty"` - ModificationTag *ModificationTag `protobuf:"bytes,21,opt,name=modification_tag,json=modificationTag,proto3" json:"modification_tag,omitempty"` - CachedDependencies []*CachedDependency `protobuf:"bytes,22,rep,name=cached_dependencies,json=cachedDependencies,proto3" json:"cached_dependencies,omitempty"` - LegacyDownloadUser string `protobuf:"bytes,23,opt,name=legacy_download_user,json=legacyDownloadUser,proto3" json:"legacy_download_user,omitempty"` // Deprecated: Do not use. - TrustedSystemCertificatesPath string `protobuf:"bytes,24,opt,name=trusted_system_certificates_path,json=trustedSystemCertificatesPath,proto3" json:"trusted_system_certificates_path,omitempty"` - VolumeMounts []*VolumeMount `protobuf:"bytes,25,rep,name=volume_mounts,json=volumeMounts,proto3" json:"volume_mounts,omitempty"` - Network *Network `protobuf:"bytes,26,opt,name=network,proto3" json:"network,omitempty"` - PlacementTags []string `protobuf:"bytes,28,rep,name=PlacementTags,proto3" json:"placement_tags,omitempty"` - MaxPids int32 `protobuf:"varint,29,opt,name=max_pids,json=maxPids,proto3" json:"max_pids"` - CertificateProperties *CertificateProperties `protobuf:"bytes,30,opt,name=certificate_properties,json=certificateProperties,proto3" json:"certificate_properties,omitempty"` - ImageUsername string `protobuf:"bytes,31,opt,name=image_username,json=imageUsername,proto3" json:"image_username,omitempty"` - ImagePassword string `protobuf:"bytes,32,opt,name=image_password,json=imagePassword,proto3" json:"image_password,omitempty"` - CheckDefinition *CheckDefinition `protobuf:"bytes,33,opt,name=check_definition,json=checkDefinition,proto3" json:"check_definition,omitempty"` - ImageLayers []*ImageLayer `protobuf:"bytes,34,rep,name=image_layers,json=imageLayers,proto3" json:"image_layers,omitempty"` - MetricTags map[string]*MetricTagValue `protobuf:"bytes,35,rep,name=metric_tags,json=metricTags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Sidecars []*Sidecar `protobuf:"bytes,36,rep,name=sidecars,proto3" json:"sidecars,omitempty"` - LogRateLimit *LogRateLimit `protobuf:"bytes,37,opt,name=log_rate_limit,json=logRateLimit,proto3" json:"log_rate_limit,omitempty"` - VolumeMountedFiles []*File `protobuf:"bytes,38,rep,name=volume_mounted_files,json=volumeMountedFiles,proto3" json:"volume_mounted_files"` -} - -func (m *DesiredLRP) Reset() { *m = DesiredLRP{} } -func (*DesiredLRP) ProtoMessage() {} -func (*DesiredLRP) Descriptor() ([]byte, []int) { - return fileDescriptor_f592e9299b63d68c, []int{6} -} -func (m *DesiredLRP) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DesiredLRP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRP.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DesiredLRP) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRP.Merge(m, src) -} -func (m *DesiredLRP) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRP) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRP.DiscardUnknown(m) -} - -var xxx_messageInfo_DesiredLRP proto.InternalMessageInfo - -func (m *DesiredLRP) GetProcessGuid() string { - if m != nil { - return m.ProcessGuid +type ProtoDesiredLRP struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,proto3" json:"process_guid,omitempty"` + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` + RootFs string `protobuf:"bytes,3,opt,name=root_fs,json=rootfs,proto3" json:"root_fs,omitempty"` + Instances int32 `protobuf:"varint,4,opt,name=instances,proto3" json:"instances,omitempty"` + EnvironmentVariables []*ProtoEnvironmentVariable `protobuf:"bytes,5,rep,name=environment_variables,json=env,proto3" json:"environment_variables,omitempty"` + Setup *ProtoAction `protobuf:"bytes,6,opt,name=setup,proto3" json:"setup,omitempty"` + Action *ProtoAction `protobuf:"bytes,7,opt,name=action,proto3" json:"action,omitempty"` + StartTimeoutMs int64 `protobuf:"varint,27,opt,name=start_timeout_ms,proto3" json:"start_timeout_ms,omitempty"` + // Deprecated: Marked as deprecated in desired_lrp.proto. + DeprecatedStartTimeoutS uint32 `protobuf:"varint,8,opt,name=deprecated_start_timeout_s,json=deprecated_timeout_ns,proto3" json:"deprecated_start_timeout_s,omitempty"` + Monitor *ProtoAction `protobuf:"bytes,9,opt,name=monitor,proto3" json:"monitor,omitempty"` + DiskMb int32 `protobuf:"varint,10,opt,name=disk_mb,proto3" json:"disk_mb,omitempty"` + MemoryMb int32 `protobuf:"varint,11,opt,name=memory_mb,proto3" json:"memory_mb,omitempty"` + CpuWeight uint32 `protobuf:"varint,12,opt,name=cpu_weight,proto3" json:"cpu_weight,omitempty"` + Privileged bool `protobuf:"varint,13,opt,name=privileged,proto3" json:"privileged,omitempty"` + Ports []uint32 `protobuf:"varint,14,rep,name=ports,proto3" json:"ports,omitempty"` + Routes *ProtoRoutes `protobuf:"bytes,15,opt,name=routes,proto3,oneof" json:"routes,omitempty"` + LogSource string `protobuf:"bytes,16,opt,name=log_source,proto3" json:"log_source,omitempty"` + LogGuid string `protobuf:"bytes,17,opt,name=log_guid,proto3" json:"log_guid,omitempty"` + // Deprecated: Marked as deprecated in desired_lrp.proto. + MetricsGuid string `protobuf:"bytes,18,opt,name=metrics_guid,proto3" json:"metrics_guid,omitempty"` + Annotation string `protobuf:"bytes,19,opt,name=annotation,proto3" json:"annotation,omitempty"` + EgressRules []*ProtoSecurityGroupRule `protobuf:"bytes,20,rep,name=egress_rules,proto3" json:"egress_rules,omitempty"` + ModificationTag *ProtoModificationTag `protobuf:"bytes,21,opt,name=modification_tag,proto3" json:"modification_tag,omitempty"` + CachedDependencies []*ProtoCachedDependency `protobuf:"bytes,22,rep,name=cached_dependencies,proto3" json:"cached_dependencies,omitempty"` + // Deprecated: Marked as deprecated in desired_lrp.proto. + LegacyDownloadUser string `protobuf:"bytes,23,opt,name=legacy_download_user,proto3" json:"legacy_download_user,omitempty"` + TrustedSystemCertificatesPath string `protobuf:"bytes,24,opt,name=trusted_system_certificates_path,proto3" json:"trusted_system_certificates_path,omitempty"` + VolumeMounts []*ProtoVolumeMount `protobuf:"bytes,25,rep,name=volume_mounts,proto3" json:"volume_mounts,omitempty"` + Network *ProtoNetwork `protobuf:"bytes,26,opt,name=network,proto3" json:"network,omitempty"` + PlacementTags []string `protobuf:"bytes,28,rep,name=PlacementTags,json=placement_tags,proto3" json:"PlacementTags,omitempty"` + MaxPids int32 `protobuf:"varint,29,opt,name=max_pids,proto3" json:"max_pids,omitempty"` + CertificateProperties *ProtoCertificateProperties `protobuf:"bytes,30,opt,name=certificate_properties,proto3,oneof" json:"certificate_properties,omitempty"` + ImageUsername string `protobuf:"bytes,31,opt,name=image_username,proto3" json:"image_username,omitempty"` + ImagePassword string `protobuf:"bytes,32,opt,name=image_password,proto3" json:"image_password,omitempty"` + CheckDefinition *ProtoCheckDefinition `protobuf:"bytes,33,opt,name=check_definition,proto3" json:"check_definition,omitempty"` + ImageLayers []*ProtoImageLayer `protobuf:"bytes,34,rep,name=image_layers,proto3" json:"image_layers,omitempty"` + MetricTags map[string]*ProtoMetricTagValue `protobuf:"bytes,35,rep,name=metric_tags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Sidecars []*ProtoSidecar `protobuf:"bytes,36,rep,name=sidecars,proto3" json:"sidecars,omitempty"` + LogRateLimit *ProtoLogRateLimit `protobuf:"bytes,37,opt,name=log_rate_limit,proto3" json:"log_rate_limit,omitempty"` + VolumeMountedFiles []*ProtoFile `protobuf:"bytes,38,rep,name=volume_mounted_files,proto3" json:"volume_mounted_files,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProtoDesiredLRP) Reset() { + *x = ProtoDesiredLRP{} + mi := &file_desired_lrp_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProtoDesiredLRP) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProtoDesiredLRP) ProtoMessage() {} + +func (x *ProtoDesiredLRP) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProtoDesiredLRP.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRP) Descriptor() ([]byte, []int) { + return file_desired_lrp_proto_rawDescGZIP(), []int{6} +} + +func (x *ProtoDesiredLRP) GetProcessGuid() string { + if x != nil { + return x.ProcessGuid } return "" } -func (m *DesiredLRP) GetDomain() string { - if m != nil { - return m.Domain +func (x *ProtoDesiredLRP) GetDomain() string { + if x != nil { + return x.Domain } return "" } -func (m *DesiredLRP) GetRootFs() string { - if m != nil { - return m.RootFs +func (x *ProtoDesiredLRP) GetRootFs() string { + if x != nil { + return x.RootFs } return "" } -func (m *DesiredLRP) GetInstances() int32 { - if m != nil { - return m.Instances +func (x *ProtoDesiredLRP) GetInstances() int32 { + if x != nil { + return x.Instances } return 0 } -func (m *DesiredLRP) GetEnvironmentVariables() []*EnvironmentVariable { - if m != nil { - return m.EnvironmentVariables +func (x *ProtoDesiredLRP) GetEnvironmentVariables() []*ProtoEnvironmentVariable { + if x != nil { + return x.EnvironmentVariables } return nil } -func (m *DesiredLRP) GetSetup() *Action { - if m != nil { - return m.Setup +func (x *ProtoDesiredLRP) GetSetup() *ProtoAction { + if x != nil { + return x.Setup } return nil } -func (m *DesiredLRP) GetAction() *Action { - if m != nil { - return m.Action +func (x *ProtoDesiredLRP) GetAction() *ProtoAction { + if x != nil { + return x.Action } return nil } -func (m *DesiredLRP) GetStartTimeoutMs() int64 { - if m != nil { - return m.StartTimeoutMs +func (x *ProtoDesiredLRP) GetStartTimeoutMs() int64 { + if x != nil { + return x.StartTimeoutMs } return 0 } -// Deprecated: Do not use. -func (m *DesiredLRP) GetDeprecatedStartTimeoutS() uint32 { - if m != nil { - return m.DeprecatedStartTimeoutS +// Deprecated: Marked as deprecated in desired_lrp.proto. +func (x *ProtoDesiredLRP) GetDeprecatedStartTimeoutS() uint32 { + if x != nil { + return x.DeprecatedStartTimeoutS } return 0 } -func (m *DesiredLRP) GetMonitor() *Action { - if m != nil { - return m.Monitor +func (x *ProtoDesiredLRP) GetMonitor() *ProtoAction { + if x != nil { + return x.Monitor } return nil } -func (m *DesiredLRP) GetDiskMb() int32 { - if m != nil { - return m.DiskMb +func (x *ProtoDesiredLRP) GetDiskMb() int32 { + if x != nil { + return x.DiskMb } return 0 } -func (m *DesiredLRP) GetMemoryMb() int32 { - if m != nil { - return m.MemoryMb +func (x *ProtoDesiredLRP) GetMemoryMb() int32 { + if x != nil { + return x.MemoryMb } return 0 } -func (m *DesiredLRP) GetCpuWeight() uint32 { - if m != nil { - return m.CpuWeight +func (x *ProtoDesiredLRP) GetCpuWeight() uint32 { + if x != nil { + return x.CpuWeight } return 0 } -func (m *DesiredLRP) GetPrivileged() bool { - if m != nil { - return m.Privileged +func (x *ProtoDesiredLRP) GetPrivileged() bool { + if x != nil { + return x.Privileged } return false } -func (m *DesiredLRP) GetPorts() []uint32 { - if m != nil { - return m.Ports +func (x *ProtoDesiredLRP) GetPorts() []uint32 { + if x != nil { + return x.Ports + } + return nil +} + +func (x *ProtoDesiredLRP) GetRoutes() *ProtoRoutes { + if x != nil { + return x.Routes } return nil } -func (m *DesiredLRP) GetLogSource() string { - if m != nil { - return m.LogSource +func (x *ProtoDesiredLRP) GetLogSource() string { + if x != nil { + return x.LogSource } return "" } -func (m *DesiredLRP) GetLogGuid() string { - if m != nil { - return m.LogGuid +func (x *ProtoDesiredLRP) GetLogGuid() string { + if x != nil { + return x.LogGuid } return "" } -// Deprecated: Do not use. -func (m *DesiredLRP) GetMetricsGuid() string { - if m != nil { - return m.MetricsGuid +// Deprecated: Marked as deprecated in desired_lrp.proto. +func (x *ProtoDesiredLRP) GetMetricsGuid() string { + if x != nil { + return x.MetricsGuid } return "" } -func (m *DesiredLRP) GetAnnotation() string { - if m != nil { - return m.Annotation +func (x *ProtoDesiredLRP) GetAnnotation() string { + if x != nil { + return x.Annotation } return "" } -func (m *DesiredLRP) GetEgressRules() []*SecurityGroupRule { - if m != nil { - return m.EgressRules +func (x *ProtoDesiredLRP) GetEgressRules() []*ProtoSecurityGroupRule { + if x != nil { + return x.EgressRules } return nil } -func (m *DesiredLRP) GetModificationTag() *ModificationTag { - if m != nil { - return m.ModificationTag +func (x *ProtoDesiredLRP) GetModificationTag() *ProtoModificationTag { + if x != nil { + return x.ModificationTag } return nil } -func (m *DesiredLRP) GetCachedDependencies() []*CachedDependency { - if m != nil { - return m.CachedDependencies +func (x *ProtoDesiredLRP) GetCachedDependencies() []*ProtoCachedDependency { + if x != nil { + return x.CachedDependencies } return nil } -// Deprecated: Do not use. -func (m *DesiredLRP) GetLegacyDownloadUser() string { - if m != nil { - return m.LegacyDownloadUser +// Deprecated: Marked as deprecated in desired_lrp.proto. +func (x *ProtoDesiredLRP) GetLegacyDownloadUser() string { + if x != nil { + return x.LegacyDownloadUser } return "" } -func (m *DesiredLRP) GetTrustedSystemCertificatesPath() string { - if m != nil { - return m.TrustedSystemCertificatesPath +func (x *ProtoDesiredLRP) GetTrustedSystemCertificatesPath() string { + if x != nil { + return x.TrustedSystemCertificatesPath } return "" } -func (m *DesiredLRP) GetVolumeMounts() []*VolumeMount { - if m != nil { - return m.VolumeMounts +func (x *ProtoDesiredLRP) GetVolumeMounts() []*ProtoVolumeMount { + if x != nil { + return x.VolumeMounts } return nil } -func (m *DesiredLRP) GetNetwork() *Network { - if m != nil { - return m.Network +func (x *ProtoDesiredLRP) GetNetwork() *ProtoNetwork { + if x != nil { + return x.Network } return nil } -func (m *DesiredLRP) GetPlacementTags() []string { - if m != nil { - return m.PlacementTags +func (x *ProtoDesiredLRP) GetPlacementTags() []string { + if x != nil { + return x.PlacementTags } return nil } -func (m *DesiredLRP) GetMaxPids() int32 { - if m != nil { - return m.MaxPids +func (x *ProtoDesiredLRP) GetMaxPids() int32 { + if x != nil { + return x.MaxPids } return 0 } -func (m *DesiredLRP) GetCertificateProperties() *CertificateProperties { - if m != nil { - return m.CertificateProperties +func (x *ProtoDesiredLRP) GetCertificateProperties() *ProtoCertificateProperties { + if x != nil { + return x.CertificateProperties } return nil } -func (m *DesiredLRP) GetImageUsername() string { - if m != nil { - return m.ImageUsername +func (x *ProtoDesiredLRP) GetImageUsername() string { + if x != nil { + return x.ImageUsername } return "" } -func (m *DesiredLRP) GetImagePassword() string { - if m != nil { - return m.ImagePassword +func (x *ProtoDesiredLRP) GetImagePassword() string { + if x != nil { + return x.ImagePassword } return "" } -func (m *DesiredLRP) GetCheckDefinition() *CheckDefinition { - if m != nil { - return m.CheckDefinition +func (x *ProtoDesiredLRP) GetCheckDefinition() *ProtoCheckDefinition { + if x != nil { + return x.CheckDefinition } return nil } -func (m *DesiredLRP) GetImageLayers() []*ImageLayer { - if m != nil { - return m.ImageLayers +func (x *ProtoDesiredLRP) GetImageLayers() []*ProtoImageLayer { + if x != nil { + return x.ImageLayers } return nil } -func (m *DesiredLRP) GetMetricTags() map[string]*MetricTagValue { - if m != nil { - return m.MetricTags +func (x *ProtoDesiredLRP) GetMetricTags() map[string]*ProtoMetricTagValue { + if x != nil { + return x.MetricTags } return nil } -func (m *DesiredLRP) GetSidecars() []*Sidecar { - if m != nil { - return m.Sidecars +func (x *ProtoDesiredLRP) GetSidecars() []*ProtoSidecar { + if x != nil { + return x.Sidecars } return nil } -func (m *DesiredLRP) GetLogRateLimit() *LogRateLimit { - if m != nil { - return m.LogRateLimit +func (x *ProtoDesiredLRP) GetLogRateLimit() *ProtoLogRateLimit { + if x != nil { + return x.LogRateLimit } return nil } -func (m *DesiredLRP) GetVolumeMountedFiles() []*File { - if m != nil { - return m.VolumeMountedFiles +func (x *ProtoDesiredLRP) GetVolumeMountedFiles() []*ProtoFile { + if x != nil { + return x.VolumeMountedFiles } return nil } -func init() { - proto.RegisterType((*DesiredLRPSchedulingInfo)(nil), "models.DesiredLRPSchedulingInfo") - proto.RegisterType((*DesiredLRPRunInfo)(nil), "models.DesiredLRPRunInfo") - proto.RegisterMapType((map[string]*MetricTagValue)(nil), "models.DesiredLRPRunInfo.MetricTagsEntry") - proto.RegisterType((*ProtoRoutes)(nil), "models.ProtoRoutes") - proto.RegisterMapType((map[string][]byte)(nil), "models.ProtoRoutes.RoutesEntry") - proto.RegisterType((*DesiredLRPUpdate)(nil), "models.DesiredLRPUpdate") - proto.RegisterMapType((map[string]*MetricTagValue)(nil), "models.DesiredLRPUpdate.MetricTagsEntry") - proto.RegisterType((*DesiredLRPKey)(nil), "models.DesiredLRPKey") - proto.RegisterType((*DesiredLRPResource)(nil), "models.DesiredLRPResource") - proto.RegisterType((*DesiredLRP)(nil), "models.DesiredLRP") - proto.RegisterMapType((map[string]*MetricTagValue)(nil), "models.DesiredLRP.MetricTagsEntry") -} - -func init() { proto.RegisterFile("desired_lrp.proto", fileDescriptor_f592e9299b63d68c) } - -var fileDescriptor_f592e9299b63d68c = []byte{ - // 1845 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x98, 0x4f, 0x6f, 0x1b, 0xc7, - 0x15, 0xc0, 0xb9, 0xfa, 0x43, 0x8a, 0x43, 0x52, 0xa2, 0x46, 0x94, 0x34, 0xa6, 0x6d, 0x2e, 0xcb, - 0xd8, 0x29, 0xd3, 0x24, 0x0a, 0xe0, 0xa4, 0x68, 0x9a, 0x16, 0x05, 0xb2, 0x76, 0xe2, 0x18, 0x96, - 0x02, 0x61, 0x64, 0xbb, 0x6d, 0x80, 0x62, 0xb1, 0xda, 0x1d, 0xad, 0x16, 0xde, 0xdd, 0x59, 0xec, - 0xcc, 0xca, 0xe1, 0xad, 0xfd, 0x06, 0xed, 0xa9, 0x5f, 0xa1, 0x1f, 0xa0, 0x40, 0xbf, 0x42, 0x8e, - 0x3e, 0x06, 0x3d, 0x10, 0xb1, 0x7c, 0x29, 0x78, 0xca, 0x47, 0x28, 0x66, 0xf6, 0x3f, 0x49, 0x53, - 0x52, 0x6c, 0x03, 0x39, 0x71, 0xe6, 0xbd, 0x37, 0x6f, 0xdf, 0xcc, 0xbc, 0x7d, 0xef, 0xb7, 0x04, - 0x9b, 0x16, 0x61, 0x4e, 0x48, 0x2c, 0xdd, 0x0d, 0x83, 0xbd, 0x20, 0xa4, 0x9c, 0xc2, 0xaa, 0x47, - 0x2d, 0xe2, 0xb2, 0xee, 0x87, 0xb6, 0xc3, 0x4f, 0xa3, 0xe3, 0x3d, 0x93, 0x7a, 0x1f, 0xd9, 0xd4, - 0xa6, 0x1f, 0x49, 0xf5, 0x71, 0x74, 0x22, 0x67, 0x72, 0x22, 0x47, 0xf1, 0xb2, 0x6e, 0xcb, 0x30, - 0xb9, 0x43, 0x7d, 0x96, 0x4c, 0x77, 0x4d, 0xc3, 0x3c, 0x25, 0x96, 0x6e, 0x91, 0x80, 0xf8, 0x16, - 0xf1, 0xcd, 0x51, 0xa2, 0xb8, 0x61, 0x92, 0x90, 0x3b, 0x27, 0x8e, 0x69, 0x70, 0xa2, 0x07, 0x21, - 0x0d, 0xc4, 0x94, 0xa4, 0xcb, 0xae, 0x13, 0xff, 0xcc, 0x09, 0xa9, 0xef, 0x11, 0x9f, 0xeb, 0x67, - 0x46, 0xe8, 0x18, 0xc7, 0x6e, 0xa6, 0xdc, 0xf1, 0xa8, 0x15, 0xaf, 0x74, 0xa8, 0xaf, 0x73, 0xc3, - 0x4e, 0x1f, 0xed, 0x13, 0xfe, 0x8c, 0x86, 0x4f, 0x93, 0x69, 0x87, 0x11, 0x33, 0x0a, 0x1d, 0x3e, - 0xd2, 0xed, 0x90, 0x46, 0xc9, 0xb6, 0xba, 0xf0, 0x8c, 0xba, 0x91, 0x47, 0x74, 0x8f, 0x46, 0x3e, - 0x4f, 0x1d, 0x9a, 0xa7, 0xc4, 0x7c, 0xaa, 0x5b, 0xe4, 0xc4, 0xf1, 0x1d, 0xe1, 0x34, 0x91, 0x6f, - 0x3a, 0x9e, 0x61, 0x13, 0xdd, 0x35, 0x46, 0x24, 0x4c, 0x45, 0x1e, 0xe1, 0xa1, 0x63, 0x8a, 0xa7, - 0xa6, 0xe1, 0xb4, 0x98, 0x63, 0x11, 0xd3, 0x48, 0x2d, 0x3a, 0x2e, 0xb5, 0xf5, 0x50, 0xec, 0xca, - 0x75, 0x3c, 0x27, 0x7d, 0x04, 0x38, 0x71, 0x5c, 0x12, 0x8f, 0x07, 0xff, 0x59, 0x01, 0xe8, 0x5e, - 0x7c, 0xde, 0xfb, 0xf8, 0xf0, 0x48, 0x9c, 0x4f, 0xe4, 0x3a, 0xbe, 0xfd, 0xc0, 0x3f, 0xa1, 0xf0, - 0x21, 0xd8, 0x28, 0xdc, 0x85, 0xfe, 0x94, 0x8c, 0x90, 0xd2, 0x57, 0x86, 0x8d, 0x3b, 0xdb, 0x7b, - 0xf1, 0x85, 0xec, 0xe5, 0x4b, 0x1f, 0x92, 0x91, 0xd6, 0xfc, 0x6e, 0xac, 0x56, 0x9e, 0x8f, 0x55, - 0x65, 0x32, 0x56, 0x2b, 0xb8, 0x95, 0xac, 0xdd, 0x0f, 0x83, 0x87, 0x64, 0x04, 0xf7, 0x00, 0x30, - 0x7c, 0x9f, 0x72, 0x79, 0x52, 0x68, 0xa9, 0xaf, 0x0c, 0xeb, 0xda, 0xfa, 0x64, 0xac, 0x16, 0xa4, - 0xb8, 0x30, 0x86, 0xef, 0x83, 0xba, 0xe3, 0x33, 0x6e, 0xf8, 0x26, 0x61, 0x68, 0xb9, 0xaf, 0x0c, - 0x57, 0xb5, 0xd6, 0x64, 0xac, 0xe6, 0x42, 0x9c, 0x0f, 0xe1, 0x37, 0xa0, 0x53, 0x8c, 0x34, 0x24, - 0x8c, 0x46, 0xa1, 0x49, 0xd0, 0x8a, 0x0c, 0xb7, 0x3b, 0x1b, 0x2e, 0x4e, 0x2c, 0xa6, 0x62, 0x86, - 0x79, 0xcc, 0xa9, 0x05, 0xfc, 0x1d, 0xa8, 0x86, 0x34, 0xe2, 0x84, 0xa1, 0x55, 0xe9, 0x6d, 0x2b, - 0xf5, 0x76, 0x28, 0x4e, 0x10, 0x4b, 0x95, 0xb6, 0x2e, 0xdc, 0xfc, 0x77, 0xac, 0x56, 0xe3, 0x39, - 0x4e, 0x96, 0xc0, 0x43, 0xd0, 0x9e, 0xce, 0x10, 0x54, 0x95, 0x6e, 0x76, 0x53, 0x37, 0x07, 0x05, - 0xfd, 0x23, 0xc3, 0x9e, 0x8a, 0x68, 0xc3, 0x2b, 0xab, 0xa1, 0x06, 0xda, 0x49, 0xda, 0x04, 0xae, - 0x61, 0x12, 0x91, 0x95, 0xa8, 0x56, 0xf6, 0xf8, 0x44, 0xea, 0x0f, 0x53, 0x35, 0xde, 0x38, 0x2b, - 0x0b, 0xa0, 0x06, 0x5a, 0xd9, 0xe4, 0x91, 0x61, 0x33, 0xb4, 0xd6, 0x5f, 0x1e, 0xd6, 0xb5, 0x1b, - 0x93, 0xb1, 0x8a, 0x32, 0xaf, 0x32, 0xaf, 0x3e, 0xa0, 0x9e, 0xc3, 0x89, 0x17, 0xf0, 0x11, 0x2e, - 0x2f, 0x19, 0xbc, 0x6c, 0x81, 0xcd, 0xc2, 0x79, 0x46, 0xfe, 0x9b, 0x4f, 0x99, 0xbf, 0x80, 0xed, - 0xb9, 0xef, 0x1e, 0x5a, 0xea, 0x2f, 0x0f, 0x1b, 0x77, 0xae, 0xa7, 0x2e, 0xbf, 0xc8, 0x8d, 0x9e, - 0x24, 0x36, 0x5a, 0x43, 0x38, 0x9e, 0x8c, 0xd5, 0x65, 0xe2, 0x9f, 0xe1, 0x0e, 0x99, 0xb5, 0x60, - 0xf0, 0x16, 0x58, 0x65, 0x84, 0x47, 0x81, 0xcc, 0xae, 0xc6, 0x9d, 0xf5, 0xd4, 0xdd, 0xe7, 0xb2, - 0x6a, 0xe0, 0x58, 0x09, 0xdf, 0x05, 0xd5, 0xb8, 0x8c, 0x24, 0xc9, 0x34, 0x6d, 0x96, 0x68, 0xe1, - 0x10, 0xd4, 0x3c, 0xea, 0x3b, 0x9c, 0x86, 0x49, 0x9e, 0x4c, 0x1b, 0xa6, 0x6a, 0xf8, 0x0d, 0xe8, - 0x5a, 0x24, 0x08, 0x89, 0x28, 0x37, 0x96, 0xce, 0xb8, 0x11, 0x72, 0x9d, 0x3b, 0x1e, 0xa1, 0x11, - 0xd7, 0x99, 0xcc, 0x8e, 0x96, 0x76, 0x73, 0x32, 0x56, 0x77, 0x4b, 0xaa, 0xfc, 0x26, 0x90, 0x82, - 0x77, 0x73, 0x07, 0x47, 0xc2, 0xe8, 0x51, 0x6c, 0x73, 0x24, 0xde, 0xb2, 0x20, 0x74, 0xce, 0x1c, - 0x97, 0xd8, 0xc4, 0x92, 0x79, 0xb1, 0x16, 0xbf, 0x65, 0xb9, 0x14, 0x17, 0xc6, 0xf0, 0x43, 0x00, - 0xcc, 0x20, 0xd2, 0x9f, 0x11, 0xc7, 0x3e, 0xe5, 0x68, 0x4d, 0x3e, 0x5b, 0xda, 0xe7, 0x52, 0x5c, - 0x37, 0x83, 0xe8, 0x8f, 0x72, 0x08, 0x11, 0x58, 0x0d, 0x68, 0xc8, 0x19, 0xaa, 0xf7, 0x97, 0x87, - 0x2d, 0x6d, 0xa9, 0x5d, 0xc1, 0xb1, 0x00, 0x6a, 0xa0, 0x49, 0xec, 0x90, 0x30, 0xa6, 0x87, 0x91, - 0xb8, 0x22, 0x20, 0xaf, 0xe8, 0x5a, 0x7a, 0x06, 0x47, 0x49, 0xfd, 0xbb, 0x2f, 0xca, 0x1f, 0x8e, - 0x5c, 0xa2, 0xad, 0x88, 0x0b, 0xc2, 0x8d, 0x78, 0x91, 0x90, 0x30, 0x11, 0x8c, 0x28, 0x58, 0xc9, - 0xbb, 0xdb, 0xc8, 0x4b, 0x44, 0x2e, 0xc5, 0x75, 0x97, 0xda, 0x47, 0xf1, 0x8b, 0xf9, 0x6b, 0xd0, - 0x8c, 0x2b, 0x20, 0xd3, 0xed, 0xc8, 0xb1, 0x50, 0x53, 0x2e, 0x80, 0x93, 0xb1, 0x5a, 0x96, 0x2b, - 0xb8, 0x91, 0xcc, 0xef, 0x47, 0x4e, 0xbc, 0xe5, 0x90, 0xc8, 0xb3, 0x37, 0x38, 0x6a, 0xf5, 0x95, - 0xe1, 0x72, 0xb2, 0xe5, 0x4c, 0x8a, 0xeb, 0xc9, 0xf8, 0x73, 0x0e, 0x1f, 0x80, 0xad, 0xe9, 0xbe, - 0xe1, 0x10, 0x86, 0xd6, 0xe5, 0xfe, 0x50, 0xba, 0xbf, 0xbb, 0xd2, 0xe4, 0x5e, 0xd6, 0x59, 0x30, - 0x34, 0xcb, 0x12, 0x87, 0x30, 0xf8, 0x09, 0xe8, 0xb8, 0xc4, 0x36, 0xcc, 0x91, 0x6e, 0xd1, 0x67, - 0xbe, 0x4b, 0x0d, 0x4b, 0x8f, 0x18, 0x09, 0xd1, 0x86, 0x0c, 0x7c, 0x09, 0x29, 0x18, 0xc6, 0xfa, - 0x7b, 0x89, 0xfa, 0x31, 0x23, 0x21, 0xbc, 0x0f, 0xfa, 0x3c, 0x8c, 0x98, 0xcc, 0x95, 0x11, 0xe3, - 0xc4, 0xd3, 0x0b, 0xed, 0x8a, 0xe9, 0x81, 0xc1, 0x4f, 0x51, 0x5b, 0x78, 0xc0, 0x37, 0x13, 0xbb, - 0x23, 0x69, 0x76, 0xb7, 0x60, 0x75, 0x68, 0xf0, 0x53, 0xf8, 0x29, 0x68, 0x15, 0x1b, 0x0e, 0x43, - 0x9b, 0x72, 0x0f, 0x5b, 0xe5, 0xb2, 0x71, 0x20, 0x74, 0xb8, 0x79, 0x96, 0x4f, 0x18, 0x7c, 0x0f, - 0xd4, 0x92, 0x7e, 0x86, 0xa0, 0xcc, 0xed, 0x8d, 0x74, 0xcd, 0xd7, 0xb1, 0x18, 0xa7, 0x7a, 0xf8, - 0x07, 0xd0, 0x2e, 0x67, 0xb4, 0xc7, 0xd0, 0x96, 0x3c, 0xe3, 0xce, 0x64, 0xac, 0xce, 0xe8, 0xf0, - 0x3a, 0x2b, 0xe4, 0xef, 0x81, 0xa8, 0xe4, 0x3b, 0xf3, 0xbb, 0x31, 0xea, 0xc8, 0x27, 0xdf, 0xcc, - 0x4e, 0x3c, 0xb7, 0x3a, 0xcc, 0x8c, 0x64, 0x56, 0x29, 0x78, 0xdb, 0x9c, 0xa7, 0x84, 0xb7, 0xc1, - 0x7a, 0xdc, 0x45, 0xc5, 0xa9, 0xfb, 0x86, 0x47, 0xd0, 0xb6, 0x3c, 0xb7, 0x96, 0x94, 0x3e, 0x4e, - 0x84, 0xb9, 0x59, 0x60, 0x30, 0xf6, 0x8c, 0x86, 0x16, 0xda, 0x29, 0x98, 0x1d, 0x26, 0x42, 0x51, - 0x88, 0xa7, 0x7b, 0x35, 0xda, 0x2d, 0x17, 0xe2, 0xbb, 0x42, 0x7f, 0x2f, 0x53, 0xe3, 0x0d, 0xb3, - 0x2c, 0x10, 0x29, 0x5c, 0xe8, 0xeb, 0x0c, 0x21, 0x79, 0x23, 0x30, 0x5d, 0xff, 0x40, 0xe8, 0xf6, - 0x85, 0x0a, 0x37, 0x9c, 0x6c, 0xcc, 0xe0, 0xd7, 0xa0, 0x51, 0xe8, 0xfd, 0xe8, 0x9a, 0x5c, 0xf5, - 0xde, 0x9c, 0x2e, 0x17, 0x57, 0xe5, 0xbd, 0x03, 0x69, 0x2c, 0xca, 0xf6, 0x17, 0x3e, 0x0f, 0x47, - 0x32, 0xd5, 0x80, 0x97, 0x09, 0xe1, 0xfb, 0x60, 0x2d, 0x01, 0x07, 0x86, 0xba, 0xd2, 0x59, 0x76, - 0xc1, 0x47, 0xb1, 0x1c, 0x67, 0x06, 0xf0, 0x33, 0xb0, 0x5e, 0xc6, 0x0a, 0x74, 0x5d, 0xee, 0xba, - 0x93, 0x2e, 0xd9, 0xa7, 0x36, 0x36, 0x38, 0xd9, 0x17, 0x3a, 0xdc, 0x74, 0x0b, 0x33, 0xf8, 0x27, - 0xd0, 0x29, 0xa6, 0x20, 0xb1, 0x74, 0xc1, 0x22, 0x0c, 0xdd, 0x90, 0x0f, 0x6d, 0xa6, 0x1e, 0xbe, - 0x74, 0x5c, 0xa2, 0xa1, 0xc9, 0x58, 0x9d, 0x6b, 0x8d, 0x61, 0x21, 0x39, 0x89, 0x25, 0x8c, 0x59, - 0xf7, 0x31, 0xd8, 0x98, 0xda, 0x25, 0x6c, 0x83, 0xe5, 0xb4, 0xff, 0xd4, 0xb1, 0x18, 0xc2, 0x0f, - 0xc0, 0xea, 0x99, 0xe1, 0x46, 0x44, 0xe2, 0x47, 0xe3, 0xce, 0x4e, 0xd6, 0x82, 0xd3, 0x95, 0x4f, - 0x84, 0x16, 0xc7, 0x46, 0x9f, 0x2d, 0x7d, 0xaa, 0x0c, 0xfe, 0xa6, 0x80, 0x46, 0xa1, 0xcf, 0xc3, - 0xdf, 0x64, 0x30, 0xa0, 0xc8, 0x90, 0xd5, 0x39, 0x30, 0xb0, 0x17, 0xff, 0xc8, 0x20, 0x52, 0x10, - 0xe8, 0xfe, 0x16, 0x34, 0x0a, 0xe2, 0x39, 0xb1, 0x75, 0x8a, 0xb1, 0x35, 0x8b, 0x31, 0xfc, 0xb0, - 0x04, 0xda, 0xf9, 0x9d, 0x3e, 0x0e, 0x2c, 0x83, 0x13, 0xd8, 0x2b, 0xe2, 0x91, 0x70, 0xb3, 0xfa, - 0x55, 0xa5, 0x48, 0x44, 0x39, 0xb5, 0x2c, 0x2d, 0xa6, 0x16, 0x65, 0x0e, 0xb5, 0xf4, 0x4b, 0xac, - 0x26, 0xda, 0x63, 0xfd, 0x2b, 0xa5, 0x44, 0x67, 0x0f, 0xca, 0x19, 0xb8, 0x22, 0x0f, 0x63, 0x38, - 0x9b, 0x81, 0x71, 0xb4, 0xd3, 0x09, 0x58, 0x4c, 0xbe, 0xb7, 0x74, 0x73, 0x5a, 0x07, 0x40, 0x1a, - 0x88, 0x58, 0x0d, 0x57, 0xcf, 0x8e, 0x45, 0xdb, 0x06, 0x5b, 0x99, 0x34, 0xdf, 0xce, 0xe0, 0x1f, - 0x0a, 0x68, 0x95, 0xc0, 0x04, 0x7e, 0x0c, 0x9a, 0x41, 0x48, 0x4d, 0xd1, 0xd0, 0xe2, 0x26, 0x22, - 0x6b, 0x74, 0x5b, 0x34, 0x97, 0xa2, 0x1c, 0x37, 0x92, 0x99, 0x6c, 0x2d, 0x03, 0x50, 0xb5, 0xa8, - 0x67, 0x38, 0x29, 0xdf, 0x82, 0xc9, 0x58, 0x4d, 0x24, 0x38, 0xf9, 0x85, 0xbf, 0x04, 0x6b, 0xe2, - 0xf5, 0x91, 0x4e, 0xe5, 0xc9, 0x6a, 0xcd, 0xc9, 0x58, 0xcd, 0x64, 0xb8, 0xe6, 0x52, 0x5b, 0x38, - 0x1b, 0xfc, 0x5b, 0x01, 0x70, 0x16, 0x58, 0xe1, 0xaf, 0x40, 0xdd, 0x23, 0x1e, 0x0d, 0x47, 0xba, - 0x77, 0x1c, 0x5f, 0x7c, 0xcc, 0xc5, 0x99, 0x10, 0xaf, 0xc5, 0xc3, 0x83, 0x63, 0x78, 0x0b, 0xd4, - 0x2c, 0x87, 0x3d, 0x15, 0x96, 0x4b, 0xd2, 0xb2, 0x31, 0x19, 0xab, 0xa9, 0x08, 0x57, 0xc5, 0xe0, - 0xe0, 0x18, 0xbe, 0x03, 0x6a, 0x21, 0xa5, 0x5c, 0x3f, 0x61, 0x49, 0x40, 0x32, 0x6c, 0x21, 0x3a, - 0x91, 0x29, 0x41, 0xf9, 0x97, 0x4c, 0x84, 0xed, 0x19, 0xdf, 0xea, 0x81, 0x63, 0x31, 0x09, 0x42, - 0xab, 0x71, 0xd8, 0xa9, 0x0c, 0xd7, 0x3c, 0xe3, 0xdb, 0x43, 0xc7, 0x62, 0x83, 0x7f, 0x6e, 0x02, - 0x90, 0x87, 0xfd, 0xf6, 0xce, 0xf1, 0x52, 0x51, 0x97, 0x3e, 0x22, 0x56, 0x2e, 0xf8, 0x88, 0xf8, - 0xf3, 0xab, 0x70, 0x73, 0xf5, 0x62, 0xdc, 0xac, 0x5d, 0x12, 0x35, 0xab, 0x97, 0x43, 0xcd, 0xda, - 0x42, 0xd4, 0x9c, 0xd7, 0x63, 0xaf, 0x5f, 0xa1, 0xc7, 0x1e, 0x2f, 0x04, 0xd0, 0x18, 0x02, 0x6f, - 0x4f, 0xc6, 0xaa, 0x5a, 0xb0, 0x4a, 0xf5, 0x3e, 0xbb, 0x1c, 0x88, 0x16, 0x70, 0xb8, 0xbe, 0x18, - 0x87, 0x0b, 0x49, 0x0a, 0x5e, 0x9d, 0xa4, 0xa5, 0xb4, 0x6f, 0x2c, 0x4e, 0xfb, 0x32, 0xd4, 0x36, - 0x2f, 0x82, 0xda, 0x32, 0x33, 0xb7, 0x2e, 0x64, 0xe6, 0x0c, 0x82, 0xd7, 0xa7, 0x21, 0x38, 0x2f, - 0xba, 0x1b, 0x57, 0x2f, 0xba, 0x65, 0xfa, 0x6d, 0x5f, 0x44, 0xbf, 0xc5, 0x3a, 0xb2, 0xb9, 0xa0, - 0x8e, 0xcc, 0x60, 0x32, 0xbc, 0x1c, 0x26, 0x97, 0xbf, 0xd7, 0xb7, 0x2e, 0xfc, 0x5e, 0xff, 0xfd, - 0xd4, 0x07, 0x40, 0xe7, 0x82, 0x0f, 0x80, 0x32, 0xfa, 0x6b, 0x73, 0xbe, 0x93, 0xb7, 0x17, 0x7e, - 0x27, 0xcf, 0x7e, 0x19, 0xbf, 0x82, 0xd4, 0x77, 0xde, 0x20, 0xa9, 0xef, 0xbe, 0x36, 0xa9, 0xa3, - 0x9f, 0x44, 0xea, 0xd7, 0x7e, 0x02, 0xa9, 0x77, 0x2f, 0x20, 0xf5, 0x99, 0x3f, 0x01, 0x6e, 0x5c, - 0xf9, 0x4f, 0x80, 0x52, 0x57, 0xb8, 0xb9, 0xa0, 0x2b, 0x2c, 0xc0, 0xfa, 0xde, 0x5b, 0xc0, 0x7a, - 0xf5, 0x72, 0x58, 0xdf, 0xbf, 0x2c, 0xd6, 0xff, 0xe2, 0x35, 0xb1, 0x7e, 0x70, 0x39, 0xac, 0xbf, - 0x5b, 0x86, 0xaa, 0x77, 0xe4, 0xaa, 0xc1, 0x2c, 0x54, 0x2d, 0xc2, 0xa9, 0x12, 0xcb, 0xdf, 0xba, - 0x3a, 0xcb, 0xdf, 0x7e, 0x6d, 0x96, 0x7f, 0xf7, 0x67, 0xca, 0xf2, 0xda, 0x27, 0xcf, 0x5f, 0xf4, - 0x2a, 0xdf, 0xbf, 0xe8, 0x55, 0x7e, 0x7c, 0xd1, 0x53, 0xfe, 0x7a, 0xde, 0x53, 0xfe, 0x75, 0xde, - 0x53, 0xbe, 0x3b, 0xef, 0x29, 0xcf, 0xcf, 0x7b, 0xca, 0x0f, 0xe7, 0x3d, 0xe5, 0x7f, 0xe7, 0xbd, - 0xca, 0x8f, 0xe7, 0x3d, 0xe5, 0xef, 0x2f, 0x7b, 0x95, 0xe7, 0x2f, 0x7b, 0x95, 0xef, 0x5f, 0xf6, - 0x2a, 0xc7, 0x55, 0xf9, 0x47, 0xe9, 0xc7, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x43, 0x41, - 0x1c, 0x97, 0x16, 0x00, 0x00, -} - -func (this *DesiredLRPSchedulingInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DesiredLRPSchedulingInfo) - if !ok { - that2, ok := that.(DesiredLRPSchedulingInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.DesiredLRPKey.Equal(&that1.DesiredLRPKey) { - return false - } - if this.Annotation != that1.Annotation { - return false - } - if this.Instances != that1.Instances { - return false - } - if !this.DesiredLRPResource.Equal(&that1.DesiredLRPResource) { - return false - } - if !this.Routes.Equal(that1.Routes) { - return false - } - if !this.ModificationTag.Equal(&that1.ModificationTag) { - return false - } - if !this.VolumePlacement.Equal(that1.VolumePlacement) { - return false - } - if len(this.PlacementTags) != len(that1.PlacementTags) { - return false - } - for i := range this.PlacementTags { - if this.PlacementTags[i] != that1.PlacementTags[i] { - return false - } - } - return true -} -func (this *DesiredLRPRunInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DesiredLRPRunInfo) - if !ok { - that2, ok := that.(DesiredLRPRunInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.DesiredLRPKey.Equal(&that1.DesiredLRPKey) { - return false - } - if len(this.EnvironmentVariables) != len(that1.EnvironmentVariables) { - return false - } - for i := range this.EnvironmentVariables { - if !this.EnvironmentVariables[i].Equal(&that1.EnvironmentVariables[i]) { - return false - } - } - if !this.Setup.Equal(that1.Setup) { - return false - } - if !this.Action.Equal(that1.Action) { - return false - } - if !this.Monitor.Equal(that1.Monitor) { - return false - } - if this.DeprecatedStartTimeoutS != that1.DeprecatedStartTimeoutS { - return false - } - if this.Privileged != that1.Privileged { - return false - } - if this.CpuWeight != that1.CpuWeight { - return false - } - if len(this.Ports) != len(that1.Ports) { - return false - } - for i := range this.Ports { - if this.Ports[i] != that1.Ports[i] { - return false - } - } - if len(this.EgressRules) != len(that1.EgressRules) { - return false - } - for i := range this.EgressRules { - if !this.EgressRules[i].Equal(&that1.EgressRules[i]) { - return false - } - } - if this.LogSource != that1.LogSource { - return false - } - if this.MetricsGuid != that1.MetricsGuid { - return false - } - if this.CreatedAt != that1.CreatedAt { - return false - } - if len(this.CachedDependencies) != len(that1.CachedDependencies) { - return false - } - for i := range this.CachedDependencies { - if !this.CachedDependencies[i].Equal(that1.CachedDependencies[i]) { - return false - } - } - if this.LegacyDownloadUser != that1.LegacyDownloadUser { - return false - } - if this.TrustedSystemCertificatesPath != that1.TrustedSystemCertificatesPath { - return false - } - if len(this.VolumeMounts) != len(that1.VolumeMounts) { - return false - } - for i := range this.VolumeMounts { - if !this.VolumeMounts[i].Equal(that1.VolumeMounts[i]) { - return false - } - } - if !this.Network.Equal(that1.Network) { - return false - } - if this.StartTimeoutMs != that1.StartTimeoutMs { - return false - } - if !this.CertificateProperties.Equal(that1.CertificateProperties) { - return false - } - if this.ImageUsername != that1.ImageUsername { - return false - } - if this.ImagePassword != that1.ImagePassword { - return false - } - if !this.CheckDefinition.Equal(that1.CheckDefinition) { - return false - } - if len(this.ImageLayers) != len(that1.ImageLayers) { - return false - } - for i := range this.ImageLayers { - if !this.ImageLayers[i].Equal(that1.ImageLayers[i]) { - return false - } - } - if len(this.MetricTags) != len(that1.MetricTags) { - return false - } - for i := range this.MetricTags { - if !this.MetricTags[i].Equal(that1.MetricTags[i]) { - return false - } - } - if len(this.Sidecars) != len(that1.Sidecars) { - return false - } - for i := range this.Sidecars { - if !this.Sidecars[i].Equal(that1.Sidecars[i]) { - return false - } - } - if !this.LogRateLimit.Equal(that1.LogRateLimit) { - return false - } - if len(this.VolumeMountedFiles) != len(that1.VolumeMountedFiles) { - return false - } - for i := range this.VolumeMountedFiles { - if !this.VolumeMountedFiles[i].Equal(that1.VolumeMountedFiles[i]) { - return false - } - } - return true -} -func (this *ProtoRoutes) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ProtoRoutes) - if !ok { - that2, ok := that.(ProtoRoutes) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Routes) != len(that1.Routes) { - return false - } - for i := range this.Routes { - if !bytes.Equal(this.Routes[i], that1.Routes[i]) { - return false - } - } - return true -} -func (this *DesiredLRPUpdate) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DesiredLRPUpdate) - if !ok { - that2, ok := that.(DesiredLRPUpdate) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if that1.OptionalInstances == nil { - if this.OptionalInstances != nil { - return false - } - } else if this.OptionalInstances == nil { - return false - } else if !this.OptionalInstances.Equal(that1.OptionalInstances) { - return false - } - if that1.Routes == nil { - if this.Routes != nil { - return false - } - } else if !this.Routes.Equal(*that1.Routes) { - return false - } - if that1.OptionalAnnotation == nil { - if this.OptionalAnnotation != nil { - return false - } - } else if this.OptionalAnnotation == nil { - return false - } else if !this.OptionalAnnotation.Equal(that1.OptionalAnnotation) { - return false - } - if len(this.MetricTags) != len(that1.MetricTags) { - return false - } - for i := range this.MetricTags { - if !this.MetricTags[i].Equal(that1.MetricTags[i]) { - return false - } - } - return true -} -func (this *DesiredLRPUpdate_Instances) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DesiredLRPUpdate_Instances) - if !ok { - that2, ok := that.(DesiredLRPUpdate_Instances) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Instances != that1.Instances { - return false - } - return true -} -func (this *DesiredLRPUpdate_Annotation) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DesiredLRPUpdate_Annotation) - if !ok { - that2, ok := that.(DesiredLRPUpdate_Annotation) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Annotation != that1.Annotation { - return false - } - return true -} -func (this *DesiredLRPKey) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +var File_desired_lrp_proto protoreflect.FileDescriptor + +const file_desired_lrp_proto_rawDesc = "" + + "\n" + + "\x11desired_lrp.proto\x12\x06models\x1a\ractions.proto\x1a\tbbs.proto\x1a\x17cached_dependency.proto\x1a\x1ccertificate_properties.proto\x1a\x1benvironment_variables.proto\x1a\x16modification_tag.proto\x1a\rnetwork.proto\x1a\x14security_group.proto\x1a\x12volume_mount.proto\x1a\x16check_definition.proto\x1a\x11image_layer.proto\x1a\x11metric_tags.proto\x1a\rsidecar.proto\x1a\x14log_rate_limit.proto\x1a\n" + + "file.proto\"\x87\x04\n" + + "\x1dProtoDesiredLRPSchedulingInfo\x12L\n" + + "\x0fdesired_lrp_key\x18\x01 \x01(\v2\x1a.models.ProtoDesiredLRPKeyB\x06\xc0>\x01\x90?\x01R\x0fdesired_lrp_key\x12#\n" + + "\n" + + "annotation\x18\x02 \x01(\tB\x03\xc0>\x01R\n" + + "annotation\x12!\n" + + "\tinstances\x18\x03 \x01(\x05B\x03\xc0>\x01R\tinstances\x12[\n" + + "\x14desired_lrp_resource\x18\x04 \x01(\v2\x1f.models.ProtoDesiredLRPResourceB\x06\xc0>\x01\x90?\x01R\x14desired_lrp_resource\x120\n" + + "\x06routes\x18\x05 \x01(\v2\x13.models.ProtoRoutesB\x03\x90?\x00R\x06routes\x12P\n" + + "\x10modification_tag\x18\x06 \x01(\v2\x1c.models.ProtoModificationTagB\x06\xc0>\x01\x90?\x01R\x10modification_tag\x12H\n" + + "\x10volume_placement\x18\a \x01(\v2\x1c.models.ProtoVolumePlacementR\x10volume_placement\x12%\n" + + "\rPlacementTags\x18\b \x03(\tR\x0eplacement_tags\"\xcf\r\n" + + "\x16ProtoDesiredLRPRunInfo\x12L\n" + + "\x0fdesired_lrp_key\x18\x01 \x01(\v2\x1a.models.ProtoDesiredLRPKeyB\x06\xc0>\x01\x90?\x01R\x0fdesired_lrp_key\x12L\n" + + "\x15environment_variables\x18\x02 \x03(\v2 .models.ProtoEnvironmentVariableB\x06\xc0>\x01\x90?\x00R\x03env\x12)\n" + + "\x05setup\x18\x03 \x01(\v2\x13.models.ProtoActionR\x05setup\x12+\n" + + "\x06action\x18\x04 \x01(\v2\x13.models.ProtoActionR\x06action\x12-\n" + + "\amonitor\x18\x05 \x01(\v2\x13.models.ProtoActionR\amonitor\x125\n" + + "\x1adeprecated_start_timeout_s\x18\x06 \x01(\rB\x02\x18\x01R\rstart_timeout\x12#\n" + + "\n" + + "privileged\x18\a \x01(\bB\x03\xc0>\x01R\n" + + "privileged\x12#\n" + + "\n" + + "cpu_weight\x18\b \x01(\rB\x03\xc0>\x01R\n" + + "cpu_weight\x12\x18\n" + + "\x05ports\x18\t \x03(\rB\x02\x10\x00R\x05ports\x12G\n" + + "\fegress_rules\x18\n" + + " \x03(\v2\x1e.models.ProtoSecurityGroupRuleB\x03\x90?\x00R\fegress_rules\x12#\n" + + "\n" + + "log_source\x18\v \x01(\tB\x03\xc0>\x01R\n" + + "log_source\x12)\n" + + "\fmetrics_guid\x18\f \x01(\tB\x05\xc0>\x01\x18\x01R\fmetrics_guid\x12#\n" + + "\n" + + "created_at\x18\r \x01(\x03B\x03\xc0>\x01R\n" + + "created_at\x12N\n" + + "\x13cached_dependencies\x18\x0e \x03(\v2\x1d.models.ProtoCachedDependencyR\x12cachedDependencies\x126\n" + + "\x14legacy_download_user\x18\x0f \x01(\tB\x02\x18\x01R\x14legacy_download_user\x12J\n" + + " trusted_system_certificates_path\x18\x10 \x01(\tR trusted_system_certificates_path\x12>\n" + + "\rvolume_mounts\x18\x11 \x03(\v2\x18.models.ProtoVolumeMountR\rvolume_mounts\x12.\n" + + "\anetwork\x18\x12 \x01(\v2\x14.models.ProtoNetworkR\anetwork\x12/\n" + + "\x10start_timeout_ms\x18\x13 \x01(\x03B\x03\xc0>\x01R\x10start_timeout_ms\x12_\n" + + "\x16certificate_properties\x18\x14 \x01(\v2\".models.ProtoCertificatePropertiesH\x00R\x16certificate_properties\x88\x01\x01\x12&\n" + + "\x0eimage_username\x18\x15 \x01(\tR\x0eimage_username\x12&\n" + + "\x0eimage_password\x18\x16 \x01(\tR\x0eimage_password\x12H\n" + + "\x10check_definition\x18\x17 \x01(\v2\x1c.models.ProtoCheckDefinitionR\x10check_definition\x12;\n" + + "\fimage_layers\x18\x18 \x03(\v2\x17.models.ProtoImageLayerR\fimage_layers\x12T\n" + + "\vmetric_tags\x18\x19 \x03(\v2..models.ProtoDesiredLRPRunInfo.MetricTagsEntryB\x02\x18\x01R\vmetric_tags\x120\n" + + "\bsidecars\x18\x1a \x03(\v2\x14.models.ProtoSidecarR\bsidecars\x12A\n" + + "\x0elog_rate_limit\x18\x1b \x01(\v2\x19.models.ProtoLogRateLimitR\x0elog_rate_limit\x12J\n" + + "\x14volume_mounted_files\x18\x1c \x03(\v2\x11.models.ProtoFileB\x03\xc0>\x01R\x14volume_mounted_files\x1aZ\n" + + "\x0fMetricTagsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x121\n" + + "\x05value\x18\x02 \x01(\v2\x1b.models.ProtoMetricTagValueR\x05value:\x028\x01B\x19\n" + + "\x17_certificate_properties\"\x81\x01\n" + + "\vProtoRoutes\x127\n" + + "\x06routes\x18\x01 \x03(\v2\x1f.models.ProtoRoutes.RoutesEntryR\x06routes\x1a9\n" + + "\vRoutesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\fR\x05value:\x028\x01\"\xeb\x02\n" + + "\x15ProtoDesiredLRPUpdate\x12!\n" + + "\tinstances\x18\x01 \x01(\x05H\x00R\tinstances\x88\x01\x01\x125\n" + + "\x06routes\x18\x02 \x01(\v2\x13.models.ProtoRoutesB\x03\x90?\x00H\x01R\x06routes\x88\x01\x01\x12#\n" + + "\n" + + "annotation\x18\x03 \x01(\tH\x02R\n" + + "annotation\x88\x01\x01\x12O\n" + + "\vmetric_tags\x18\x04 \x03(\v2-.models.ProtoDesiredLRPUpdate.MetricTagsEntryR\vmetric_tags\x1aZ\n" + + "\x0fMetricTagsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x121\n" + + "\x05value\x18\x02 \x01(\v2\x1b.models.ProtoMetricTagValueR\x05value:\x028\x01B\f\n" + + "\n" + + "_instancesB\t\n" + + "\a_routesB\r\n" + + "\v_annotation\"{\n" + + "\x12ProtoDesiredLRPKey\x12'\n" + + "\fprocess_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\fprocess_guid\x12\x1b\n" + + "\x06domain\x18\x02 \x01(\tB\x03\xc0>\x01R\x06domain\x12\x1f\n" + + "\blog_guid\x18\x03 \x01(\tB\x03\xc0>\x01R\blog_guid\"\x9a\x01\n" + + "\x17ProtoDesiredLRPResource\x12!\n" + + "\tmemory_mb\x18\x01 \x01(\x05B\x03\xc0>\x01R\tmemory_mb\x12\x1d\n" + + "\adisk_mb\x18\x02 \x01(\x05B\x03\xc0>\x01R\adisk_mb\x12\x1c\n" + + "\aroot_fs\x18\x03 \x01(\tB\x03\xc0>\x01R\x06rootfs\x12\x1f\n" + + "\bmax_pids\x18\x04 \x01(\x05B\x03\xc0>\x01R\bmax_pids\"\xae\x10\n" + + "\x0fProtoDesiredLRP\x12'\n" + + "\fprocess_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\fprocess_guid\x12\x1b\n" + + "\x06domain\x18\x02 \x01(\tB\x03\xc0>\x01R\x06domain\x12\x1c\n" + + "\aroot_fs\x18\x03 \x01(\tB\x03\xc0>\x01R\x06rootfs\x12!\n" + + "\tinstances\x18\x04 \x01(\x05B\x03\xc0>\x01R\tinstances\x12I\n" + + "\x15environment_variables\x18\x05 \x03(\v2 .models.ProtoEnvironmentVariableB\x03\xc0>\x01R\x03env\x12)\n" + + "\x05setup\x18\x06 \x01(\v2\x13.models.ProtoActionR\x05setup\x12+\n" + + "\x06action\x18\a \x01(\v2\x13.models.ProtoActionR\x06action\x12/\n" + + "\x10start_timeout_ms\x18\x1b \x01(\x03B\x03\xc0>\x01R\x10start_timeout_ms\x12=\n" + + "\x1adeprecated_start_timeout_s\x18\b \x01(\rB\x02\x18\x01R\x15deprecated_timeout_ns\x12-\n" + + "\amonitor\x18\t \x01(\v2\x13.models.ProtoActionR\amonitor\x12\x1d\n" + + "\adisk_mb\x18\n" + + " \x01(\x05B\x03\xc0>\x01R\adisk_mb\x12!\n" + + "\tmemory_mb\x18\v \x01(\x05B\x03\xc0>\x01R\tmemory_mb\x12#\n" + + "\n" + + "cpu_weight\x18\f \x01(\rB\x03\xc0>\x01R\n" + + "cpu_weight\x12#\n" + + "\n" + + "privileged\x18\r \x01(\bB\x03\xc0>\x01R\n" + + "privileged\x12\x18\n" + + "\x05ports\x18\x0e \x03(\rB\x02\x10\x00R\x05ports\x125\n" + + "\x06routes\x18\x0f \x01(\v2\x13.models.ProtoRoutesB\x03\x90?\x00H\x00R\x06routes\x88\x01\x01\x12#\n" + + "\n" + + "log_source\x18\x10 \x01(\tB\x03\xc0>\x01R\n" + + "log_source\x12\x1f\n" + + "\blog_guid\x18\x11 \x01(\tB\x03\xc0>\x01R\blog_guid\x12)\n" + + "\fmetrics_guid\x18\x12 \x01(\tB\x05\xc0>\x01\x18\x01R\fmetrics_guid\x12#\n" + + "\n" + + "annotation\x18\x13 \x01(\tB\x03\xc0>\x01R\n" + + "annotation\x12B\n" + + "\fegress_rules\x18\x14 \x03(\v2\x1e.models.ProtoSecurityGroupRuleR\fegress_rules\x12H\n" + + "\x10modification_tag\x18\x15 \x01(\v2\x1c.models.ProtoModificationTagR\x10modification_tag\x12O\n" + + "\x13cached_dependencies\x18\x16 \x03(\v2\x1d.models.ProtoCachedDependencyR\x13cached_dependencies\x126\n" + + "\x14legacy_download_user\x18\x17 \x01(\tB\x02\x18\x01R\x14legacy_download_user\x12J\n" + + " trusted_system_certificates_path\x18\x18 \x01(\tR trusted_system_certificates_path\x12>\n" + + "\rvolume_mounts\x18\x19 \x03(\v2\x18.models.ProtoVolumeMountR\rvolume_mounts\x12.\n" + + "\anetwork\x18\x1a \x01(\v2\x14.models.ProtoNetworkR\anetwork\x12%\n" + + "\rPlacementTags\x18\x1c \x03(\tR\x0eplacement_tags\x12\x1f\n" + + "\bmax_pids\x18\x1d \x01(\x05B\x03\xc0>\x01R\bmax_pids\x12_\n" + + "\x16certificate_properties\x18\x1e \x01(\v2\".models.ProtoCertificatePropertiesH\x01R\x16certificate_properties\x88\x01\x01\x12&\n" + + "\x0eimage_username\x18\x1f \x01(\tR\x0eimage_username\x12&\n" + + "\x0eimage_password\x18 \x01(\tR\x0eimage_password\x12H\n" + + "\x10check_definition\x18! \x01(\v2\x1c.models.ProtoCheckDefinitionR\x10check_definition\x12;\n" + + "\fimage_layers\x18\" \x03(\v2\x17.models.ProtoImageLayerR\fimage_layers\x12I\n" + + "\vmetric_tags\x18# \x03(\v2'.models.ProtoDesiredLRP.MetricTagsEntryR\vmetric_tags\x120\n" + + "\bsidecars\x18$ \x03(\v2\x14.models.ProtoSidecarR\bsidecars\x12A\n" + + "\x0elog_rate_limit\x18% \x01(\v2\x19.models.ProtoLogRateLimitR\x0elog_rate_limit\x12J\n" + + "\x14volume_mounted_files\x18& \x03(\v2\x11.models.ProtoFileB\x03\xc0>\x01R\x14volume_mounted_files\x1aZ\n" + + "\x0fMetricTagsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x121\n" + + "\x05value\x18\x02 \x01(\v2\x1b.models.ProtoMetricTagValueR\x05value:\x028\x01B\t\n" + + "\a_routesB\x19\n" + + "\x17_certificate_propertiesB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" - that1, ok := that.(*DesiredLRPKey) - if !ok { - that2, ok := that.(DesiredLRPKey) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProcessGuid != that1.ProcessGuid { - return false - } - if this.Domain != that1.Domain { - return false - } - if this.LogGuid != that1.LogGuid { - return false - } - return true -} -func (this *DesiredLRPResource) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +var ( + file_desired_lrp_proto_rawDescOnce sync.Once + file_desired_lrp_proto_rawDescData []byte +) - that1, ok := that.(*DesiredLRPResource) - if !ok { - that2, ok := that.(DesiredLRPResource) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.MemoryMb != that1.MemoryMb { - return false - } - if this.DiskMb != that1.DiskMb { - return false - } - if this.RootFs != that1.RootFs { - return false - } - if this.MaxPids != that1.MaxPids { - return false - } - return true +func file_desired_lrp_proto_rawDescGZIP() []byte { + file_desired_lrp_proto_rawDescOnce.Do(func() { + file_desired_lrp_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_desired_lrp_proto_rawDesc), len(file_desired_lrp_proto_rawDesc))) + }) + return file_desired_lrp_proto_rawDescData +} + +var file_desired_lrp_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_desired_lrp_proto_goTypes = []any{ + (*ProtoDesiredLRPSchedulingInfo)(nil), // 0: models.ProtoDesiredLRPSchedulingInfo + (*ProtoDesiredLRPRunInfo)(nil), // 1: models.ProtoDesiredLRPRunInfo + (*ProtoRoutes)(nil), // 2: models.ProtoRoutes + (*ProtoDesiredLRPUpdate)(nil), // 3: models.ProtoDesiredLRPUpdate + (*ProtoDesiredLRPKey)(nil), // 4: models.ProtoDesiredLRPKey + (*ProtoDesiredLRPResource)(nil), // 5: models.ProtoDesiredLRPResource + (*ProtoDesiredLRP)(nil), // 6: models.ProtoDesiredLRP + nil, // 7: models.ProtoDesiredLRPRunInfo.MetricTagsEntry + nil, // 8: models.ProtoRoutes.RoutesEntry + nil, // 9: models.ProtoDesiredLRPUpdate.MetricTagsEntry + nil, // 10: models.ProtoDesiredLRP.MetricTagsEntry + (*ProtoModificationTag)(nil), // 11: models.ProtoModificationTag + (*ProtoVolumePlacement)(nil), // 12: models.ProtoVolumePlacement + (*ProtoEnvironmentVariable)(nil), // 13: models.ProtoEnvironmentVariable + (*ProtoAction)(nil), // 14: models.ProtoAction + (*ProtoSecurityGroupRule)(nil), // 15: models.ProtoSecurityGroupRule + (*ProtoCachedDependency)(nil), // 16: models.ProtoCachedDependency + (*ProtoVolumeMount)(nil), // 17: models.ProtoVolumeMount + (*ProtoNetwork)(nil), // 18: models.ProtoNetwork + (*ProtoCertificateProperties)(nil), // 19: models.ProtoCertificateProperties + (*ProtoCheckDefinition)(nil), // 20: models.ProtoCheckDefinition + (*ProtoImageLayer)(nil), // 21: models.ProtoImageLayer + (*ProtoSidecar)(nil), // 22: models.ProtoSidecar + (*ProtoLogRateLimit)(nil), // 23: models.ProtoLogRateLimit + (*ProtoFile)(nil), // 24: models.ProtoFile + (*ProtoMetricTagValue)(nil), // 25: models.ProtoMetricTagValue +} +var file_desired_lrp_proto_depIdxs = []int32{ + 4, // 0: models.ProtoDesiredLRPSchedulingInfo.desired_lrp_key:type_name -> models.ProtoDesiredLRPKey + 5, // 1: models.ProtoDesiredLRPSchedulingInfo.desired_lrp_resource:type_name -> models.ProtoDesiredLRPResource + 2, // 2: models.ProtoDesiredLRPSchedulingInfo.routes:type_name -> models.ProtoRoutes + 11, // 3: models.ProtoDesiredLRPSchedulingInfo.modification_tag:type_name -> models.ProtoModificationTag + 12, // 4: models.ProtoDesiredLRPSchedulingInfo.volume_placement:type_name -> models.ProtoVolumePlacement + 4, // 5: models.ProtoDesiredLRPRunInfo.desired_lrp_key:type_name -> models.ProtoDesiredLRPKey + 13, // 6: models.ProtoDesiredLRPRunInfo.environment_variables:type_name -> models.ProtoEnvironmentVariable + 14, // 7: models.ProtoDesiredLRPRunInfo.setup:type_name -> models.ProtoAction + 14, // 8: models.ProtoDesiredLRPRunInfo.action:type_name -> models.ProtoAction + 14, // 9: models.ProtoDesiredLRPRunInfo.monitor:type_name -> models.ProtoAction + 15, // 10: models.ProtoDesiredLRPRunInfo.egress_rules:type_name -> models.ProtoSecurityGroupRule + 16, // 11: models.ProtoDesiredLRPRunInfo.cached_dependencies:type_name -> models.ProtoCachedDependency + 17, // 12: models.ProtoDesiredLRPRunInfo.volume_mounts:type_name -> models.ProtoVolumeMount + 18, // 13: models.ProtoDesiredLRPRunInfo.network:type_name -> models.ProtoNetwork + 19, // 14: models.ProtoDesiredLRPRunInfo.certificate_properties:type_name -> models.ProtoCertificateProperties + 20, // 15: models.ProtoDesiredLRPRunInfo.check_definition:type_name -> models.ProtoCheckDefinition + 21, // 16: models.ProtoDesiredLRPRunInfo.image_layers:type_name -> models.ProtoImageLayer + 7, // 17: models.ProtoDesiredLRPRunInfo.metric_tags:type_name -> models.ProtoDesiredLRPRunInfo.MetricTagsEntry + 22, // 18: models.ProtoDesiredLRPRunInfo.sidecars:type_name -> models.ProtoSidecar + 23, // 19: models.ProtoDesiredLRPRunInfo.log_rate_limit:type_name -> models.ProtoLogRateLimit + 24, // 20: models.ProtoDesiredLRPRunInfo.volume_mounted_files:type_name -> models.ProtoFile + 8, // 21: models.ProtoRoutes.routes:type_name -> models.ProtoRoutes.RoutesEntry + 2, // 22: models.ProtoDesiredLRPUpdate.routes:type_name -> models.ProtoRoutes + 9, // 23: models.ProtoDesiredLRPUpdate.metric_tags:type_name -> models.ProtoDesiredLRPUpdate.MetricTagsEntry + 13, // 24: models.ProtoDesiredLRP.environment_variables:type_name -> models.ProtoEnvironmentVariable + 14, // 25: models.ProtoDesiredLRP.setup:type_name -> models.ProtoAction + 14, // 26: models.ProtoDesiredLRP.action:type_name -> models.ProtoAction + 14, // 27: models.ProtoDesiredLRP.monitor:type_name -> models.ProtoAction + 2, // 28: models.ProtoDesiredLRP.routes:type_name -> models.ProtoRoutes + 15, // 29: models.ProtoDesiredLRP.egress_rules:type_name -> models.ProtoSecurityGroupRule + 11, // 30: models.ProtoDesiredLRP.modification_tag:type_name -> models.ProtoModificationTag + 16, // 31: models.ProtoDesiredLRP.cached_dependencies:type_name -> models.ProtoCachedDependency + 17, // 32: models.ProtoDesiredLRP.volume_mounts:type_name -> models.ProtoVolumeMount + 18, // 33: models.ProtoDesiredLRP.network:type_name -> models.ProtoNetwork + 19, // 34: models.ProtoDesiredLRP.certificate_properties:type_name -> models.ProtoCertificateProperties + 20, // 35: models.ProtoDesiredLRP.check_definition:type_name -> models.ProtoCheckDefinition + 21, // 36: models.ProtoDesiredLRP.image_layers:type_name -> models.ProtoImageLayer + 10, // 37: models.ProtoDesiredLRP.metric_tags:type_name -> models.ProtoDesiredLRP.MetricTagsEntry + 22, // 38: models.ProtoDesiredLRP.sidecars:type_name -> models.ProtoSidecar + 23, // 39: models.ProtoDesiredLRP.log_rate_limit:type_name -> models.ProtoLogRateLimit + 24, // 40: models.ProtoDesiredLRP.volume_mounted_files:type_name -> models.ProtoFile + 25, // 41: models.ProtoDesiredLRPRunInfo.MetricTagsEntry.value:type_name -> models.ProtoMetricTagValue + 25, // 42: models.ProtoDesiredLRPUpdate.MetricTagsEntry.value:type_name -> models.ProtoMetricTagValue + 25, // 43: models.ProtoDesiredLRP.MetricTagsEntry.value:type_name -> models.ProtoMetricTagValue + 44, // [44:44] is the sub-list for method output_type + 44, // [44:44] is the sub-list for method input_type + 44, // [44:44] is the sub-list for extension type_name + 44, // [44:44] is the sub-list for extension extendee + 0, // [0:44] is the sub-list for field type_name +} + +func init() { file_desired_lrp_proto_init() } +func file_desired_lrp_proto_init() { + if File_desired_lrp_proto != nil { + return + } + file_actions_proto_init() + file_bbs_proto_init() + file_cached_dependency_proto_init() + file_certificate_properties_proto_init() + file_environment_variables_proto_init() + file_modification_tag_proto_init() + file_network_proto_init() + file_security_group_proto_init() + file_volume_mount_proto_init() + file_check_definition_proto_init() + file_image_layer_proto_init() + file_metric_tags_proto_init() + file_sidecar_proto_init() + file_log_rate_limit_proto_init() + file_file_proto_init() + file_desired_lrp_proto_msgTypes[1].OneofWrappers = []any{} + file_desired_lrp_proto_msgTypes[3].OneofWrappers = []any{} + file_desired_lrp_proto_msgTypes[6].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_desired_lrp_proto_rawDesc), len(file_desired_lrp_proto_rawDesc)), + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_desired_lrp_proto_goTypes, + DependencyIndexes: file_desired_lrp_proto_depIdxs, + MessageInfos: file_desired_lrp_proto_msgTypes, + }.Build() + File_desired_lrp_proto = out.File + file_desired_lrp_proto_goTypes = nil + file_desired_lrp_proto_depIdxs = nil } -func (this *DesiredLRP) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DesiredLRP) - if !ok { - that2, ok := that.(DesiredLRP) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProcessGuid != that1.ProcessGuid { - return false - } - if this.Domain != that1.Domain { - return false - } - if this.RootFs != that1.RootFs { - return false - } - if this.Instances != that1.Instances { - return false - } - if len(this.EnvironmentVariables) != len(that1.EnvironmentVariables) { - return false - } - for i := range this.EnvironmentVariables { - if !this.EnvironmentVariables[i].Equal(that1.EnvironmentVariables[i]) { - return false - } - } - if !this.Setup.Equal(that1.Setup) { - return false - } - if !this.Action.Equal(that1.Action) { - return false - } - if this.StartTimeoutMs != that1.StartTimeoutMs { - return false - } - if this.DeprecatedStartTimeoutS != that1.DeprecatedStartTimeoutS { - return false - } - if !this.Monitor.Equal(that1.Monitor) { - return false - } - if this.DiskMb != that1.DiskMb { - return false - } - if this.MemoryMb != that1.MemoryMb { - return false - } - if this.CpuWeight != that1.CpuWeight { - return false - } - if this.Privileged != that1.Privileged { - return false - } - if len(this.Ports) != len(that1.Ports) { - return false - } - for i := range this.Ports { - if this.Ports[i] != that1.Ports[i] { - return false - } - } - if that1.Routes == nil { - if this.Routes != nil { - return false - } - } else if !this.Routes.Equal(*that1.Routes) { - return false - } - if this.LogSource != that1.LogSource { - return false - } - if this.LogGuid != that1.LogGuid { - return false - } - if this.MetricsGuid != that1.MetricsGuid { - return false - } - if this.Annotation != that1.Annotation { - return false - } - if len(this.EgressRules) != len(that1.EgressRules) { - return false - } - for i := range this.EgressRules { - if !this.EgressRules[i].Equal(that1.EgressRules[i]) { - return false - } - } - if !this.ModificationTag.Equal(that1.ModificationTag) { - return false - } - if len(this.CachedDependencies) != len(that1.CachedDependencies) { - return false - } - for i := range this.CachedDependencies { - if !this.CachedDependencies[i].Equal(that1.CachedDependencies[i]) { - return false - } - } - if this.LegacyDownloadUser != that1.LegacyDownloadUser { - return false - } - if this.TrustedSystemCertificatesPath != that1.TrustedSystemCertificatesPath { - return false - } - if len(this.VolumeMounts) != len(that1.VolumeMounts) { - return false - } - for i := range this.VolumeMounts { - if !this.VolumeMounts[i].Equal(that1.VolumeMounts[i]) { - return false - } - } - if !this.Network.Equal(that1.Network) { - return false - } - if len(this.PlacementTags) != len(that1.PlacementTags) { - return false - } - for i := range this.PlacementTags { - if this.PlacementTags[i] != that1.PlacementTags[i] { - return false - } - } - if this.MaxPids != that1.MaxPids { - return false - } - if !this.CertificateProperties.Equal(that1.CertificateProperties) { - return false - } - if this.ImageUsername != that1.ImageUsername { - return false - } - if this.ImagePassword != that1.ImagePassword { - return false - } - if !this.CheckDefinition.Equal(that1.CheckDefinition) { - return false - } - if len(this.ImageLayers) != len(that1.ImageLayers) { - return false - } - for i := range this.ImageLayers { - if !this.ImageLayers[i].Equal(that1.ImageLayers[i]) { - return false - } - } - if len(this.MetricTags) != len(that1.MetricTags) { - return false - } - for i := range this.MetricTags { - if !this.MetricTags[i].Equal(that1.MetricTags[i]) { - return false - } - } - if len(this.Sidecars) != len(that1.Sidecars) { - return false - } - for i := range this.Sidecars { - if !this.Sidecars[i].Equal(that1.Sidecars[i]) { - return false - } - } - if !this.LogRateLimit.Equal(that1.LogRateLimit) { - return false - } - if len(this.VolumeMountedFiles) != len(that1.VolumeMountedFiles) { - return false - } - for i := range this.VolumeMountedFiles { - if !this.VolumeMountedFiles[i].Equal(that1.VolumeMountedFiles[i]) { - return false - } - } - return true -} -func (this *DesiredLRPSchedulingInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 12) - s = append(s, "&models.DesiredLRPSchedulingInfo{") - s = append(s, "DesiredLRPKey: "+strings.Replace(this.DesiredLRPKey.GoString(), `&`, ``, 1)+",\n") - s = append(s, "Annotation: "+fmt.Sprintf("%#v", this.Annotation)+",\n") - s = append(s, "Instances: "+fmt.Sprintf("%#v", this.Instances)+",\n") - s = append(s, "DesiredLRPResource: "+strings.Replace(this.DesiredLRPResource.GoString(), `&`, ``, 1)+",\n") - s = append(s, "Routes: "+fmt.Sprintf("%#v", this.Routes)+",\n") - s = append(s, "ModificationTag: "+strings.Replace(this.ModificationTag.GoString(), `&`, ``, 1)+",\n") - if this.VolumePlacement != nil { - s = append(s, "VolumePlacement: "+fmt.Sprintf("%#v", this.VolumePlacement)+",\n") - } - s = append(s, "PlacementTags: "+fmt.Sprintf("%#v", this.PlacementTags)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRPRunInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 32) - s = append(s, "&models.DesiredLRPRunInfo{") - s = append(s, "DesiredLRPKey: "+strings.Replace(this.DesiredLRPKey.GoString(), `&`, ``, 1)+",\n") - if this.EnvironmentVariables != nil { - vs := make([]EnvironmentVariable, len(this.EnvironmentVariables)) - for i := range vs { - vs[i] = this.EnvironmentVariables[i] - } - s = append(s, "EnvironmentVariables: "+fmt.Sprintf("%#v", vs)+",\n") - } - if this.Setup != nil { - s = append(s, "Setup: "+fmt.Sprintf("%#v", this.Setup)+",\n") - } - if this.Action != nil { - s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") - } - if this.Monitor != nil { - s = append(s, "Monitor: "+fmt.Sprintf("%#v", this.Monitor)+",\n") - } - s = append(s, "DeprecatedStartTimeoutS: "+fmt.Sprintf("%#v", this.DeprecatedStartTimeoutS)+",\n") - s = append(s, "Privileged: "+fmt.Sprintf("%#v", this.Privileged)+",\n") - s = append(s, "CpuWeight: "+fmt.Sprintf("%#v", this.CpuWeight)+",\n") - s = append(s, "Ports: "+fmt.Sprintf("%#v", this.Ports)+",\n") - if this.EgressRules != nil { - vs := make([]SecurityGroupRule, len(this.EgressRules)) - for i := range vs { - vs[i] = this.EgressRules[i] - } - s = append(s, "EgressRules: "+fmt.Sprintf("%#v", vs)+",\n") - } - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - s = append(s, "MetricsGuid: "+fmt.Sprintf("%#v", this.MetricsGuid)+",\n") - s = append(s, "CreatedAt: "+fmt.Sprintf("%#v", this.CreatedAt)+",\n") - if this.CachedDependencies != nil { - s = append(s, "CachedDependencies: "+fmt.Sprintf("%#v", this.CachedDependencies)+",\n") - } - s = append(s, "LegacyDownloadUser: "+fmt.Sprintf("%#v", this.LegacyDownloadUser)+",\n") - s = append(s, "TrustedSystemCertificatesPath: "+fmt.Sprintf("%#v", this.TrustedSystemCertificatesPath)+",\n") - if this.VolumeMounts != nil { - s = append(s, "VolumeMounts: "+fmt.Sprintf("%#v", this.VolumeMounts)+",\n") - } - if this.Network != nil { - s = append(s, "Network: "+fmt.Sprintf("%#v", this.Network)+",\n") - } - s = append(s, "StartTimeoutMs: "+fmt.Sprintf("%#v", this.StartTimeoutMs)+",\n") - if this.CertificateProperties != nil { - s = append(s, "CertificateProperties: "+fmt.Sprintf("%#v", this.CertificateProperties)+",\n") - } - s = append(s, "ImageUsername: "+fmt.Sprintf("%#v", this.ImageUsername)+",\n") - s = append(s, "ImagePassword: "+fmt.Sprintf("%#v", this.ImagePassword)+",\n") - if this.CheckDefinition != nil { - s = append(s, "CheckDefinition: "+fmt.Sprintf("%#v", this.CheckDefinition)+",\n") - } - if this.ImageLayers != nil { - s = append(s, "ImageLayers: "+fmt.Sprintf("%#v", this.ImageLayers)+",\n") - } - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]*MetricTagValue{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%#v: %#v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - if this.MetricTags != nil { - s = append(s, "MetricTags: "+mapStringForMetricTags+",\n") - } - if this.Sidecars != nil { - s = append(s, "Sidecars: "+fmt.Sprintf("%#v", this.Sidecars)+",\n") - } - if this.LogRateLimit != nil { - s = append(s, "LogRateLimit: "+fmt.Sprintf("%#v", this.LogRateLimit)+",\n") - } - if this.VolumeMountedFiles != nil { - s = append(s, "VolumeMountedFiles: "+fmt.Sprintf("%#v", this.VolumeMountedFiles)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ProtoRoutes) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.ProtoRoutes{") - keysForRoutes := make([]string, 0, len(this.Routes)) - for k, _ := range this.Routes { - keysForRoutes = append(keysForRoutes, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForRoutes) - mapStringForRoutes := "map[string][]byte{" - for _, k := range keysForRoutes { - mapStringForRoutes += fmt.Sprintf("%#v: %#v,", k, this.Routes[k]) - } - mapStringForRoutes += "}" - if this.Routes != nil { - s = append(s, "Routes: "+mapStringForRoutes+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRPUpdate) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&models.DesiredLRPUpdate{") - if this.OptionalInstances != nil { - s = append(s, "OptionalInstances: "+fmt.Sprintf("%#v", this.OptionalInstances)+",\n") - } - s = append(s, "Routes: "+fmt.Sprintf("%#v", this.Routes)+",\n") - if this.OptionalAnnotation != nil { - s = append(s, "OptionalAnnotation: "+fmt.Sprintf("%#v", this.OptionalAnnotation)+",\n") - } - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]*MetricTagValue{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%#v: %#v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - if this.MetricTags != nil { - s = append(s, "MetricTags: "+mapStringForMetricTags+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRPUpdate_Instances) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&models.DesiredLRPUpdate_Instances{` + - `Instances:` + fmt.Sprintf("%#v", this.Instances) + `}`}, ", ") - return s -} -func (this *DesiredLRPUpdate_Annotation) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&models.DesiredLRPUpdate_Annotation{` + - `Annotation:` + fmt.Sprintf("%#v", this.Annotation) + `}`}, ", ") - return s -} -func (this *DesiredLRPKey) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&models.DesiredLRPKey{") - s = append(s, "ProcessGuid: "+fmt.Sprintf("%#v", this.ProcessGuid)+",\n") - s = append(s, "Domain: "+fmt.Sprintf("%#v", this.Domain)+",\n") - s = append(s, "LogGuid: "+fmt.Sprintf("%#v", this.LogGuid)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRPResource) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&models.DesiredLRPResource{") - s = append(s, "MemoryMb: "+fmt.Sprintf("%#v", this.MemoryMb)+",\n") - s = append(s, "DiskMb: "+fmt.Sprintf("%#v", this.DiskMb)+",\n") - s = append(s, "RootFs: "+fmt.Sprintf("%#v", this.RootFs)+",\n") - s = append(s, "MaxPids: "+fmt.Sprintf("%#v", this.MaxPids)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRP) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 42) - s = append(s, "&models.DesiredLRP{") - s = append(s, "ProcessGuid: "+fmt.Sprintf("%#v", this.ProcessGuid)+",\n") - s = append(s, "Domain: "+fmt.Sprintf("%#v", this.Domain)+",\n") - s = append(s, "RootFs: "+fmt.Sprintf("%#v", this.RootFs)+",\n") - s = append(s, "Instances: "+fmt.Sprintf("%#v", this.Instances)+",\n") - if this.EnvironmentVariables != nil { - s = append(s, "EnvironmentVariables: "+fmt.Sprintf("%#v", this.EnvironmentVariables)+",\n") - } - if this.Setup != nil { - s = append(s, "Setup: "+fmt.Sprintf("%#v", this.Setup)+",\n") - } - if this.Action != nil { - s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") - } - s = append(s, "StartTimeoutMs: "+fmt.Sprintf("%#v", this.StartTimeoutMs)+",\n") - s = append(s, "DeprecatedStartTimeoutS: "+fmt.Sprintf("%#v", this.DeprecatedStartTimeoutS)+",\n") - if this.Monitor != nil { - s = append(s, "Monitor: "+fmt.Sprintf("%#v", this.Monitor)+",\n") - } - s = append(s, "DiskMb: "+fmt.Sprintf("%#v", this.DiskMb)+",\n") - s = append(s, "MemoryMb: "+fmt.Sprintf("%#v", this.MemoryMb)+",\n") - s = append(s, "CpuWeight: "+fmt.Sprintf("%#v", this.CpuWeight)+",\n") - s = append(s, "Privileged: "+fmt.Sprintf("%#v", this.Privileged)+",\n") - s = append(s, "Ports: "+fmt.Sprintf("%#v", this.Ports)+",\n") - s = append(s, "Routes: "+fmt.Sprintf("%#v", this.Routes)+",\n") - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - s = append(s, "LogGuid: "+fmt.Sprintf("%#v", this.LogGuid)+",\n") - s = append(s, "MetricsGuid: "+fmt.Sprintf("%#v", this.MetricsGuid)+",\n") - s = append(s, "Annotation: "+fmt.Sprintf("%#v", this.Annotation)+",\n") - if this.EgressRules != nil { - s = append(s, "EgressRules: "+fmt.Sprintf("%#v", this.EgressRules)+",\n") - } - if this.ModificationTag != nil { - s = append(s, "ModificationTag: "+fmt.Sprintf("%#v", this.ModificationTag)+",\n") - } - if this.CachedDependencies != nil { - s = append(s, "CachedDependencies: "+fmt.Sprintf("%#v", this.CachedDependencies)+",\n") - } - s = append(s, "LegacyDownloadUser: "+fmt.Sprintf("%#v", this.LegacyDownloadUser)+",\n") - s = append(s, "TrustedSystemCertificatesPath: "+fmt.Sprintf("%#v", this.TrustedSystemCertificatesPath)+",\n") - if this.VolumeMounts != nil { - s = append(s, "VolumeMounts: "+fmt.Sprintf("%#v", this.VolumeMounts)+",\n") - } - if this.Network != nil { - s = append(s, "Network: "+fmt.Sprintf("%#v", this.Network)+",\n") - } - s = append(s, "PlacementTags: "+fmt.Sprintf("%#v", this.PlacementTags)+",\n") - s = append(s, "MaxPids: "+fmt.Sprintf("%#v", this.MaxPids)+",\n") - if this.CertificateProperties != nil { - s = append(s, "CertificateProperties: "+fmt.Sprintf("%#v", this.CertificateProperties)+",\n") - } - s = append(s, "ImageUsername: "+fmt.Sprintf("%#v", this.ImageUsername)+",\n") - s = append(s, "ImagePassword: "+fmt.Sprintf("%#v", this.ImagePassword)+",\n") - if this.CheckDefinition != nil { - s = append(s, "CheckDefinition: "+fmt.Sprintf("%#v", this.CheckDefinition)+",\n") - } - if this.ImageLayers != nil { - s = append(s, "ImageLayers: "+fmt.Sprintf("%#v", this.ImageLayers)+",\n") - } - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]*MetricTagValue{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%#v: %#v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - if this.MetricTags != nil { - s = append(s, "MetricTags: "+mapStringForMetricTags+",\n") - } - if this.Sidecars != nil { - s = append(s, "Sidecars: "+fmt.Sprintf("%#v", this.Sidecars)+",\n") - } - if this.LogRateLimit != nil { - s = append(s, "LogRateLimit: "+fmt.Sprintf("%#v", this.LogRateLimit)+",\n") - } - if this.VolumeMountedFiles != nil { - s = append(s, "VolumeMountedFiles: "+fmt.Sprintf("%#v", this.VolumeMountedFiles)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringDesiredLrp(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *DesiredLRPSchedulingInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRPSchedulingInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPSchedulingInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PlacementTags) > 0 { - for iNdEx := len(m.PlacementTags) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PlacementTags[iNdEx]) - copy(dAtA[i:], m.PlacementTags[iNdEx]) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.PlacementTags[iNdEx]))) - i-- - dAtA[i] = 0x42 - } - } - if m.VolumePlacement != nil { - { - size, err := m.VolumePlacement.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - { - size, err := m.ModificationTag.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size := m.Routes.Size() - i -= size - if _, err := m.Routes.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size, err := m.DesiredLRPResource.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Instances != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.Instances)) - i-- - dAtA[i] = 0x18 - } - if len(m.Annotation) > 0 { - i -= len(m.Annotation) - copy(dAtA[i:], m.Annotation) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.Annotation))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.DesiredLRPKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *DesiredLRPRunInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRPRunInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPRunInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.VolumeMountedFiles) > 0 { - for iNdEx := len(m.VolumeMountedFiles) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.VolumeMountedFiles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xe2 - } - } - if m.LogRateLimit != nil { - { - size, err := m.LogRateLimit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xda - } - if len(m.Sidecars) > 0 { - for iNdEx := len(m.Sidecars) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Sidecars[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xd2 - } - } - if len(m.MetricTags) > 0 { - for k := range m.MetricTags { - v := m.MetricTags[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintDesiredLrp(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xca - } - } - if len(m.ImageLayers) > 0 { - for iNdEx := len(m.ImageLayers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ImageLayers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xc2 - } - } - if m.CheckDefinition != nil { - { - size, err := m.CheckDefinition.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xba - } - if len(m.ImagePassword) > 0 { - i -= len(m.ImagePassword) - copy(dAtA[i:], m.ImagePassword) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.ImagePassword))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xb2 - } - if len(m.ImageUsername) > 0 { - i -= len(m.ImageUsername) - copy(dAtA[i:], m.ImageUsername) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.ImageUsername))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xaa - } - if m.CertificateProperties != nil { - { - size, err := m.CertificateProperties.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa2 - } - if m.StartTimeoutMs != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.StartTimeoutMs)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x98 - } - if m.Network != nil { - { - size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - } - if len(m.VolumeMounts) > 0 { - for iNdEx := len(m.VolumeMounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.VolumeMounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - } - if len(m.TrustedSystemCertificatesPath) > 0 { - i -= len(m.TrustedSystemCertificatesPath) - copy(dAtA[i:], m.TrustedSystemCertificatesPath) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.TrustedSystemCertificatesPath))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if len(m.LegacyDownloadUser) > 0 { - i -= len(m.LegacyDownloadUser) - copy(dAtA[i:], m.LegacyDownloadUser) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.LegacyDownloadUser))) - i-- - dAtA[i] = 0x7a - } - if len(m.CachedDependencies) > 0 { - for iNdEx := len(m.CachedDependencies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.CachedDependencies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - } - } - if m.CreatedAt != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.CreatedAt)) - i-- - dAtA[i] = 0x68 - } - if len(m.MetricsGuid) > 0 { - i -= len(m.MetricsGuid) - copy(dAtA[i:], m.MetricsGuid) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.MetricsGuid))) - i-- - dAtA[i] = 0x62 - } - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x5a - } - if len(m.EgressRules) > 0 { - for iNdEx := len(m.EgressRules) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.EgressRules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - } - if len(m.Ports) > 0 { - for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.Ports[iNdEx])) - i-- - dAtA[i] = 0x48 - } - } - if m.CpuWeight != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.CpuWeight)) - i-- - dAtA[i] = 0x40 - } - if m.Privileged { - i-- - if m.Privileged { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if m.DeprecatedStartTimeoutS != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.DeprecatedStartTimeoutS)) - i-- - dAtA[i] = 0x30 - } - if m.Monitor != nil { - { - size, err := m.Monitor.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Action != nil { - { - size, err := m.Action.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Setup != nil { - { - size, err := m.Setup.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.EnvironmentVariables) > 0 { - for iNdEx := len(m.EnvironmentVariables) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.EnvironmentVariables[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.DesiredLRPKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ProtoRoutes) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProtoRoutes) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProtoRoutes) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Routes) > 0 { - for k := range m.Routes { - v := m.Routes[k] - baseI := i - if len(v) > 0 { - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintDesiredLrp(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *DesiredLRPUpdate) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRPUpdate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MetricTags) > 0 { - for k := range m.MetricTags { - v := m.MetricTags[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintDesiredLrp(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 - } - } - if m.OptionalAnnotation != nil { - { - size := m.OptionalAnnotation.Size() - i -= size - if _, err := m.OptionalAnnotation.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.Routes != nil { - { - size := m.Routes.Size() - i -= size - if _, err := m.Routes.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.OptionalInstances != nil { - { - size := m.OptionalInstances.Size() - i -= size - if _, err := m.OptionalInstances.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *DesiredLRPUpdate_Instances) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPUpdate_Instances) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.Instances)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} -func (m *DesiredLRPUpdate_Annotation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPUpdate_Annotation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Annotation) - copy(dAtA[i:], m.Annotation) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.Annotation))) - i-- - dAtA[i] = 0x1a - return len(dAtA) - i, nil -} -func (m *DesiredLRPKey) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRPKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.LogGuid) > 0 { - i -= len(m.LogGuid) - copy(dAtA[i:], m.LogGuid) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.LogGuid))) - i-- - dAtA[i] = 0x1a - } - if len(m.Domain) > 0 { - i -= len(m.Domain) - copy(dAtA[i:], m.Domain) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.Domain))) - i-- - dAtA[i] = 0x12 - } - if len(m.ProcessGuid) > 0 { - i -= len(m.ProcessGuid) - copy(dAtA[i:], m.ProcessGuid) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.ProcessGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DesiredLRPResource) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRPResource) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxPids != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.MaxPids)) - i-- - dAtA[i] = 0x20 - } - if len(m.RootFs) > 0 { - i -= len(m.RootFs) - copy(dAtA[i:], m.RootFs) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.RootFs))) - i-- - dAtA[i] = 0x1a - } - if m.DiskMb != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.DiskMb)) - i-- - dAtA[i] = 0x10 - } - if m.MemoryMb != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.MemoryMb)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DesiredLRP) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRP) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRP) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.VolumeMountedFiles) > 0 { - for iNdEx := len(m.VolumeMountedFiles) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.VolumeMountedFiles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2 - i-- - dAtA[i] = 0xb2 - } - } - if m.LogRateLimit != nil { - { - size, err := m.LogRateLimit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2 - i-- - dAtA[i] = 0xaa - } - if len(m.Sidecars) > 0 { - for iNdEx := len(m.Sidecars) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Sidecars[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2 - i-- - dAtA[i] = 0xa2 - } - } - if len(m.MetricTags) > 0 { - for k := range m.MetricTags { - v := m.MetricTags[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintDesiredLrp(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x2 - i-- - dAtA[i] = 0x9a - } - } - if len(m.ImageLayers) > 0 { - for iNdEx := len(m.ImageLayers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ImageLayers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2 - i-- - dAtA[i] = 0x92 - } - } - if m.CheckDefinition != nil { - { - size, err := m.CheckDefinition.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2 - i-- - dAtA[i] = 0x8a - } - if len(m.ImagePassword) > 0 { - i -= len(m.ImagePassword) - copy(dAtA[i:], m.ImagePassword) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.ImagePassword))) - i-- - dAtA[i] = 0x2 - i-- - dAtA[i] = 0x82 - } - if len(m.ImageUsername) > 0 { - i -= len(m.ImageUsername) - copy(dAtA[i:], m.ImageUsername) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.ImageUsername))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xfa - } - if m.CertificateProperties != nil { - { - size, err := m.CertificateProperties.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xf2 - } - if m.MaxPids != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.MaxPids)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xe8 - } - if len(m.PlacementTags) > 0 { - for iNdEx := len(m.PlacementTags) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PlacementTags[iNdEx]) - copy(dAtA[i:], m.PlacementTags[iNdEx]) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.PlacementTags[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xe2 - } - } - if m.StartTimeoutMs != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.StartTimeoutMs)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xd8 - } - if m.Network != nil { - { - size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xd2 - } - if len(m.VolumeMounts) > 0 { - for iNdEx := len(m.VolumeMounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.VolumeMounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xca - } - } - if len(m.TrustedSystemCertificatesPath) > 0 { - i -= len(m.TrustedSystemCertificatesPath) - copy(dAtA[i:], m.TrustedSystemCertificatesPath) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.TrustedSystemCertificatesPath))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xc2 - } - if len(m.LegacyDownloadUser) > 0 { - i -= len(m.LegacyDownloadUser) - copy(dAtA[i:], m.LegacyDownloadUser) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.LegacyDownloadUser))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xba - } - if len(m.CachedDependencies) > 0 { - for iNdEx := len(m.CachedDependencies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.CachedDependencies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xb2 - } - } - if m.ModificationTag != nil { - { - size, err := m.ModificationTag.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xaa - } - if len(m.EgressRules) > 0 { - for iNdEx := len(m.EgressRules) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.EgressRules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa2 - } - } - if len(m.Annotation) > 0 { - i -= len(m.Annotation) - copy(dAtA[i:], m.Annotation) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.Annotation))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x9a - } - if len(m.MetricsGuid) > 0 { - i -= len(m.MetricsGuid) - copy(dAtA[i:], m.MetricsGuid) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.MetricsGuid))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - } - if len(m.LogGuid) > 0 { - i -= len(m.LogGuid) - copy(dAtA[i:], m.LogGuid) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.LogGuid))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if m.Routes != nil { - { - size := m.Routes.Size() - i -= size - if _, err := m.Routes.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x7a - } - if len(m.Ports) > 0 { - for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.Ports[iNdEx])) - i-- - dAtA[i] = 0x70 - } - } - if m.Privileged { - i-- - if m.Privileged { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x68 - } - if m.CpuWeight != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.CpuWeight)) - i-- - dAtA[i] = 0x60 - } - if m.MemoryMb != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.MemoryMb)) - i-- - dAtA[i] = 0x58 - } - if m.DiskMb != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.DiskMb)) - i-- - dAtA[i] = 0x50 - } - if m.Monitor != nil { - { - size, err := m.Monitor.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - if m.DeprecatedStartTimeoutS != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.DeprecatedStartTimeoutS)) - i-- - dAtA[i] = 0x40 - } - if m.Action != nil { - { - size, err := m.Action.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.Setup != nil { - { - size, err := m.Setup.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if len(m.EnvironmentVariables) > 0 { - for iNdEx := len(m.EnvironmentVariables) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.EnvironmentVariables[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.Instances != 0 { - i = encodeVarintDesiredLrp(dAtA, i, uint64(m.Instances)) - i-- - dAtA[i] = 0x20 - } - if len(m.RootFs) > 0 { - i -= len(m.RootFs) - copy(dAtA[i:], m.RootFs) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.RootFs))) - i-- - dAtA[i] = 0x1a - } - if len(m.Domain) > 0 { - i -= len(m.Domain) - copy(dAtA[i:], m.Domain) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.Domain))) - i-- - dAtA[i] = 0x12 - } - if len(m.ProcessGuid) > 0 { - i -= len(m.ProcessGuid) - copy(dAtA[i:], m.ProcessGuid) - i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.ProcessGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintDesiredLrp(dAtA []byte, offset int, v uint64) int { - offset -= sovDesiredLrp(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *DesiredLRPSchedulingInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.DesiredLRPKey.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - l = len(m.Annotation) - if l > 0 { - n += 1 + l + sovDesiredLrp(uint64(l)) - } - if m.Instances != 0 { - n += 1 + sovDesiredLrp(uint64(m.Instances)) - } - l = m.DesiredLRPResource.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - l = m.Routes.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - l = m.ModificationTag.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - if m.VolumePlacement != nil { - l = m.VolumePlacement.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - } - if len(m.PlacementTags) > 0 { - for _, s := range m.PlacementTags { - l = len(s) - n += 1 + l + sovDesiredLrp(uint64(l)) - } - } - return n -} - -func (m *DesiredLRPRunInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.DesiredLRPKey.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - if len(m.EnvironmentVariables) > 0 { - for _, e := range m.EnvironmentVariables { - l = e.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - } - } - if m.Setup != nil { - l = m.Setup.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - } - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - } - if m.Monitor != nil { - l = m.Monitor.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - } - if m.DeprecatedStartTimeoutS != 0 { - n += 1 + sovDesiredLrp(uint64(m.DeprecatedStartTimeoutS)) - } - if m.Privileged { - n += 2 - } - if m.CpuWeight != 0 { - n += 1 + sovDesiredLrp(uint64(m.CpuWeight)) - } - if len(m.Ports) > 0 { - for _, e := range m.Ports { - n += 1 + sovDesiredLrp(uint64(e)) - } - } - if len(m.EgressRules) > 0 { - for _, e := range m.EgressRules { - l = e.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - } - } - l = len(m.LogSource) - if l > 0 { - n += 1 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.MetricsGuid) - if l > 0 { - n += 1 + l + sovDesiredLrp(uint64(l)) - } - if m.CreatedAt != 0 { - n += 1 + sovDesiredLrp(uint64(m.CreatedAt)) - } - if len(m.CachedDependencies) > 0 { - for _, e := range m.CachedDependencies { - l = e.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - } - } - l = len(m.LegacyDownloadUser) - if l > 0 { - n += 1 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.TrustedSystemCertificatesPath) - if l > 0 { - n += 2 + l + sovDesiredLrp(uint64(l)) - } - if len(m.VolumeMounts) > 0 { - for _, e := range m.VolumeMounts { - l = e.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - } - if m.Network != nil { - l = m.Network.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - if m.StartTimeoutMs != 0 { - n += 2 + sovDesiredLrp(uint64(m.StartTimeoutMs)) - } - if m.CertificateProperties != nil { - l = m.CertificateProperties.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.ImageUsername) - if l > 0 { - n += 2 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.ImagePassword) - if l > 0 { - n += 2 + l + sovDesiredLrp(uint64(l)) - } - if m.CheckDefinition != nil { - l = m.CheckDefinition.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - if len(m.ImageLayers) > 0 { - for _, e := range m.ImageLayers { - l = e.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - } - if len(m.MetricTags) > 0 { - for k, v := range m.MetricTags { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovDesiredLrp(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovDesiredLrp(uint64(len(k))) + l - n += mapEntrySize + 2 + sovDesiredLrp(uint64(mapEntrySize)) - } - } - if len(m.Sidecars) > 0 { - for _, e := range m.Sidecars { - l = e.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - } - if m.LogRateLimit != nil { - l = m.LogRateLimit.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - if len(m.VolumeMountedFiles) > 0 { - for _, e := range m.VolumeMountedFiles { - l = e.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - } - return n -} - -func (m *ProtoRoutes) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Routes) > 0 { - for k, v := range m.Routes { - _ = k - _ = v - l = 0 - if len(v) > 0 { - l = 1 + len(v) + sovDesiredLrp(uint64(len(v))) - } - mapEntrySize := 1 + len(k) + sovDesiredLrp(uint64(len(k))) + l - n += mapEntrySize + 1 + sovDesiredLrp(uint64(mapEntrySize)) - } - } - return n -} - -func (m *DesiredLRPUpdate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.OptionalInstances != nil { - n += m.OptionalInstances.Size() - } - if m.Routes != nil { - l = m.Routes.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - } - if m.OptionalAnnotation != nil { - n += m.OptionalAnnotation.Size() - } - if len(m.MetricTags) > 0 { - for k, v := range m.MetricTags { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovDesiredLrp(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovDesiredLrp(uint64(len(k))) + l - n += mapEntrySize + 1 + sovDesiredLrp(uint64(mapEntrySize)) - } - } - return n -} - -func (m *DesiredLRPUpdate_Instances) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovDesiredLrp(uint64(m.Instances)) - return n -} -func (m *DesiredLRPUpdate_Annotation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Annotation) - n += 1 + l + sovDesiredLrp(uint64(l)) - return n -} -func (m *DesiredLRPKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProcessGuid) - if l > 0 { - n += 1 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.Domain) - if l > 0 { - n += 1 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.LogGuid) - if l > 0 { - n += 1 + l + sovDesiredLrp(uint64(l)) - } - return n -} - -func (m *DesiredLRPResource) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MemoryMb != 0 { - n += 1 + sovDesiredLrp(uint64(m.MemoryMb)) - } - if m.DiskMb != 0 { - n += 1 + sovDesiredLrp(uint64(m.DiskMb)) - } - l = len(m.RootFs) - if l > 0 { - n += 1 + l + sovDesiredLrp(uint64(l)) - } - if m.MaxPids != 0 { - n += 1 + sovDesiredLrp(uint64(m.MaxPids)) - } - return n -} - -func (m *DesiredLRP) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProcessGuid) - if l > 0 { - n += 1 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.Domain) - if l > 0 { - n += 1 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.RootFs) - if l > 0 { - n += 1 + l + sovDesiredLrp(uint64(l)) - } - if m.Instances != 0 { - n += 1 + sovDesiredLrp(uint64(m.Instances)) - } - if len(m.EnvironmentVariables) > 0 { - for _, e := range m.EnvironmentVariables { - l = e.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - } - } - if m.Setup != nil { - l = m.Setup.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - } - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - } - if m.DeprecatedStartTimeoutS != 0 { - n += 1 + sovDesiredLrp(uint64(m.DeprecatedStartTimeoutS)) - } - if m.Monitor != nil { - l = m.Monitor.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - } - if m.DiskMb != 0 { - n += 1 + sovDesiredLrp(uint64(m.DiskMb)) - } - if m.MemoryMb != 0 { - n += 1 + sovDesiredLrp(uint64(m.MemoryMb)) - } - if m.CpuWeight != 0 { - n += 1 + sovDesiredLrp(uint64(m.CpuWeight)) - } - if m.Privileged { - n += 2 - } - if len(m.Ports) > 0 { - for _, e := range m.Ports { - n += 1 + sovDesiredLrp(uint64(e)) - } - } - if m.Routes != nil { - l = m.Routes.Size() - n += 1 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.LogSource) - if l > 0 { - n += 2 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.LogGuid) - if l > 0 { - n += 2 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.MetricsGuid) - if l > 0 { - n += 2 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.Annotation) - if l > 0 { - n += 2 + l + sovDesiredLrp(uint64(l)) - } - if len(m.EgressRules) > 0 { - for _, e := range m.EgressRules { - l = e.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - } - if m.ModificationTag != nil { - l = m.ModificationTag.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - if len(m.CachedDependencies) > 0 { - for _, e := range m.CachedDependencies { - l = e.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - } - l = len(m.LegacyDownloadUser) - if l > 0 { - n += 2 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.TrustedSystemCertificatesPath) - if l > 0 { - n += 2 + l + sovDesiredLrp(uint64(l)) - } - if len(m.VolumeMounts) > 0 { - for _, e := range m.VolumeMounts { - l = e.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - } - if m.Network != nil { - l = m.Network.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - if m.StartTimeoutMs != 0 { - n += 2 + sovDesiredLrp(uint64(m.StartTimeoutMs)) - } - if len(m.PlacementTags) > 0 { - for _, s := range m.PlacementTags { - l = len(s) - n += 2 + l + sovDesiredLrp(uint64(l)) - } - } - if m.MaxPids != 0 { - n += 2 + sovDesiredLrp(uint64(m.MaxPids)) - } - if m.CertificateProperties != nil { - l = m.CertificateProperties.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.ImageUsername) - if l > 0 { - n += 2 + l + sovDesiredLrp(uint64(l)) - } - l = len(m.ImagePassword) - if l > 0 { - n += 2 + l + sovDesiredLrp(uint64(l)) - } - if m.CheckDefinition != nil { - l = m.CheckDefinition.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - if len(m.ImageLayers) > 0 { - for _, e := range m.ImageLayers { - l = e.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - } - if len(m.MetricTags) > 0 { - for k, v := range m.MetricTags { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovDesiredLrp(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovDesiredLrp(uint64(len(k))) + l - n += mapEntrySize + 2 + sovDesiredLrp(uint64(mapEntrySize)) - } - } - if len(m.Sidecars) > 0 { - for _, e := range m.Sidecars { - l = e.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - } - if m.LogRateLimit != nil { - l = m.LogRateLimit.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - if len(m.VolumeMountedFiles) > 0 { - for _, e := range m.VolumeMountedFiles { - l = e.Size() - n += 2 + l + sovDesiredLrp(uint64(l)) - } - } - return n -} - -func sovDesiredLrp(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozDesiredLrp(x uint64) (n int) { - return sovDesiredLrp(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *DesiredLRPSchedulingInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesiredLRPSchedulingInfo{`, - `DesiredLRPKey:` + strings.Replace(strings.Replace(this.DesiredLRPKey.String(), "DesiredLRPKey", "DesiredLRPKey", 1), `&`, ``, 1) + `,`, - `Annotation:` + fmt.Sprintf("%v", this.Annotation) + `,`, - `Instances:` + fmt.Sprintf("%v", this.Instances) + `,`, - `DesiredLRPResource:` + strings.Replace(strings.Replace(this.DesiredLRPResource.String(), "DesiredLRPResource", "DesiredLRPResource", 1), `&`, ``, 1) + `,`, - `Routes:` + fmt.Sprintf("%v", this.Routes) + `,`, - `ModificationTag:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ModificationTag), "ModificationTag", "ModificationTag", 1), `&`, ``, 1) + `,`, - `VolumePlacement:` + strings.Replace(fmt.Sprintf("%v", this.VolumePlacement), "VolumePlacement", "VolumePlacement", 1) + `,`, - `PlacementTags:` + fmt.Sprintf("%v", this.PlacementTags) + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPRunInfo) String() string { - if this == nil { - return "nil" - } - repeatedStringForEnvironmentVariables := "[]EnvironmentVariable{" - for _, f := range this.EnvironmentVariables { - repeatedStringForEnvironmentVariables += fmt.Sprintf("%v", f) + "," - } - repeatedStringForEnvironmentVariables += "}" - repeatedStringForEgressRules := "[]SecurityGroupRule{" - for _, f := range this.EgressRules { - repeatedStringForEgressRules += fmt.Sprintf("%v", f) + "," - } - repeatedStringForEgressRules += "}" - repeatedStringForCachedDependencies := "[]*CachedDependency{" - for _, f := range this.CachedDependencies { - repeatedStringForCachedDependencies += strings.Replace(fmt.Sprintf("%v", f), "CachedDependency", "CachedDependency", 1) + "," - } - repeatedStringForCachedDependencies += "}" - repeatedStringForVolumeMounts := "[]*VolumeMount{" - for _, f := range this.VolumeMounts { - repeatedStringForVolumeMounts += strings.Replace(fmt.Sprintf("%v", f), "VolumeMount", "VolumeMount", 1) + "," - } - repeatedStringForVolumeMounts += "}" - repeatedStringForImageLayers := "[]*ImageLayer{" - for _, f := range this.ImageLayers { - repeatedStringForImageLayers += strings.Replace(fmt.Sprintf("%v", f), "ImageLayer", "ImageLayer", 1) + "," - } - repeatedStringForImageLayers += "}" - repeatedStringForSidecars := "[]*Sidecar{" - for _, f := range this.Sidecars { - repeatedStringForSidecars += strings.Replace(fmt.Sprintf("%v", f), "Sidecar", "Sidecar", 1) + "," - } - repeatedStringForSidecars += "}" - repeatedStringForVolumeMountedFiles := "[]*File{" - for _, f := range this.VolumeMountedFiles { - repeatedStringForVolumeMountedFiles += strings.Replace(fmt.Sprintf("%v", f), "File", "File", 1) + "," - } - repeatedStringForVolumeMountedFiles += "}" - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]*MetricTagValue{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%v: %v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - s := strings.Join([]string{`&DesiredLRPRunInfo{`, - `DesiredLRPKey:` + strings.Replace(strings.Replace(this.DesiredLRPKey.String(), "DesiredLRPKey", "DesiredLRPKey", 1), `&`, ``, 1) + `,`, - `EnvironmentVariables:` + repeatedStringForEnvironmentVariables + `,`, - `Setup:` + strings.Replace(fmt.Sprintf("%v", this.Setup), "Action", "Action", 1) + `,`, - `Action:` + strings.Replace(fmt.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, - `Monitor:` + strings.Replace(fmt.Sprintf("%v", this.Monitor), "Action", "Action", 1) + `,`, - `DeprecatedStartTimeoutS:` + fmt.Sprintf("%v", this.DeprecatedStartTimeoutS) + `,`, - `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, - `CpuWeight:` + fmt.Sprintf("%v", this.CpuWeight) + `,`, - `Ports:` + fmt.Sprintf("%v", this.Ports) + `,`, - `EgressRules:` + repeatedStringForEgressRules + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `MetricsGuid:` + fmt.Sprintf("%v", this.MetricsGuid) + `,`, - `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, - `CachedDependencies:` + repeatedStringForCachedDependencies + `,`, - `LegacyDownloadUser:` + fmt.Sprintf("%v", this.LegacyDownloadUser) + `,`, - `TrustedSystemCertificatesPath:` + fmt.Sprintf("%v", this.TrustedSystemCertificatesPath) + `,`, - `VolumeMounts:` + repeatedStringForVolumeMounts + `,`, - `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, - `StartTimeoutMs:` + fmt.Sprintf("%v", this.StartTimeoutMs) + `,`, - `CertificateProperties:` + strings.Replace(fmt.Sprintf("%v", this.CertificateProperties), "CertificateProperties", "CertificateProperties", 1) + `,`, - `ImageUsername:` + fmt.Sprintf("%v", this.ImageUsername) + `,`, - `ImagePassword:` + fmt.Sprintf("%v", this.ImagePassword) + `,`, - `CheckDefinition:` + strings.Replace(fmt.Sprintf("%v", this.CheckDefinition), "CheckDefinition", "CheckDefinition", 1) + `,`, - `ImageLayers:` + repeatedStringForImageLayers + `,`, - `MetricTags:` + mapStringForMetricTags + `,`, - `Sidecars:` + repeatedStringForSidecars + `,`, - `LogRateLimit:` + strings.Replace(fmt.Sprintf("%v", this.LogRateLimit), "LogRateLimit", "LogRateLimit", 1) + `,`, - `VolumeMountedFiles:` + repeatedStringForVolumeMountedFiles + `,`, - `}`, - }, "") - return s -} -func (this *ProtoRoutes) String() string { - if this == nil { - return "nil" - } - keysForRoutes := make([]string, 0, len(this.Routes)) - for k, _ := range this.Routes { - keysForRoutes = append(keysForRoutes, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForRoutes) - mapStringForRoutes := "map[string][]byte{" - for _, k := range keysForRoutes { - mapStringForRoutes += fmt.Sprintf("%v: %v,", k, this.Routes[k]) - } - mapStringForRoutes += "}" - s := strings.Join([]string{`&ProtoRoutes{`, - `Routes:` + mapStringForRoutes + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPUpdate) String() string { - if this == nil { - return "nil" - } - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]*MetricTagValue{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%v: %v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - s := strings.Join([]string{`&DesiredLRPUpdate{`, - `OptionalInstances:` + fmt.Sprintf("%v", this.OptionalInstances) + `,`, - `Routes:` + fmt.Sprintf("%v", this.Routes) + `,`, - `OptionalAnnotation:` + fmt.Sprintf("%v", this.OptionalAnnotation) + `,`, - `MetricTags:` + mapStringForMetricTags + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPUpdate_Instances) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesiredLRPUpdate_Instances{`, - `Instances:` + fmt.Sprintf("%v", this.Instances) + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPUpdate_Annotation) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesiredLRPUpdate_Annotation{`, - `Annotation:` + fmt.Sprintf("%v", this.Annotation) + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPKey) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesiredLRPKey{`, - `ProcessGuid:` + fmt.Sprintf("%v", this.ProcessGuid) + `,`, - `Domain:` + fmt.Sprintf("%v", this.Domain) + `,`, - `LogGuid:` + fmt.Sprintf("%v", this.LogGuid) + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPResource) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesiredLRPResource{`, - `MemoryMb:` + fmt.Sprintf("%v", this.MemoryMb) + `,`, - `DiskMb:` + fmt.Sprintf("%v", this.DiskMb) + `,`, - `RootFs:` + fmt.Sprintf("%v", this.RootFs) + `,`, - `MaxPids:` + fmt.Sprintf("%v", this.MaxPids) + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRP) String() string { - if this == nil { - return "nil" - } - repeatedStringForEnvironmentVariables := "[]*EnvironmentVariable{" - for _, f := range this.EnvironmentVariables { - repeatedStringForEnvironmentVariables += strings.Replace(fmt.Sprintf("%v", f), "EnvironmentVariable", "EnvironmentVariable", 1) + "," - } - repeatedStringForEnvironmentVariables += "}" - repeatedStringForEgressRules := "[]*SecurityGroupRule{" - for _, f := range this.EgressRules { - repeatedStringForEgressRules += strings.Replace(fmt.Sprintf("%v", f), "SecurityGroupRule", "SecurityGroupRule", 1) + "," - } - repeatedStringForEgressRules += "}" - repeatedStringForCachedDependencies := "[]*CachedDependency{" - for _, f := range this.CachedDependencies { - repeatedStringForCachedDependencies += strings.Replace(fmt.Sprintf("%v", f), "CachedDependency", "CachedDependency", 1) + "," - } - repeatedStringForCachedDependencies += "}" - repeatedStringForVolumeMounts := "[]*VolumeMount{" - for _, f := range this.VolumeMounts { - repeatedStringForVolumeMounts += strings.Replace(fmt.Sprintf("%v", f), "VolumeMount", "VolumeMount", 1) + "," - } - repeatedStringForVolumeMounts += "}" - repeatedStringForImageLayers := "[]*ImageLayer{" - for _, f := range this.ImageLayers { - repeatedStringForImageLayers += strings.Replace(fmt.Sprintf("%v", f), "ImageLayer", "ImageLayer", 1) + "," - } - repeatedStringForImageLayers += "}" - repeatedStringForSidecars := "[]*Sidecar{" - for _, f := range this.Sidecars { - repeatedStringForSidecars += strings.Replace(fmt.Sprintf("%v", f), "Sidecar", "Sidecar", 1) + "," - } - repeatedStringForSidecars += "}" - repeatedStringForVolumeMountedFiles := "[]*File{" - for _, f := range this.VolumeMountedFiles { - repeatedStringForVolumeMountedFiles += strings.Replace(fmt.Sprintf("%v", f), "File", "File", 1) + "," - } - repeatedStringForVolumeMountedFiles += "}" - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]*MetricTagValue{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%v: %v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - s := strings.Join([]string{`&DesiredLRP{`, - `ProcessGuid:` + fmt.Sprintf("%v", this.ProcessGuid) + `,`, - `Domain:` + fmt.Sprintf("%v", this.Domain) + `,`, - `RootFs:` + fmt.Sprintf("%v", this.RootFs) + `,`, - `Instances:` + fmt.Sprintf("%v", this.Instances) + `,`, - `EnvironmentVariables:` + repeatedStringForEnvironmentVariables + `,`, - `Setup:` + strings.Replace(fmt.Sprintf("%v", this.Setup), "Action", "Action", 1) + `,`, - `Action:` + strings.Replace(fmt.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, - `DeprecatedStartTimeoutS:` + fmt.Sprintf("%v", this.DeprecatedStartTimeoutS) + `,`, - `Monitor:` + strings.Replace(fmt.Sprintf("%v", this.Monitor), "Action", "Action", 1) + `,`, - `DiskMb:` + fmt.Sprintf("%v", this.DiskMb) + `,`, - `MemoryMb:` + fmt.Sprintf("%v", this.MemoryMb) + `,`, - `CpuWeight:` + fmt.Sprintf("%v", this.CpuWeight) + `,`, - `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, - `Ports:` + fmt.Sprintf("%v", this.Ports) + `,`, - `Routes:` + fmt.Sprintf("%v", this.Routes) + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `LogGuid:` + fmt.Sprintf("%v", this.LogGuid) + `,`, - `MetricsGuid:` + fmt.Sprintf("%v", this.MetricsGuid) + `,`, - `Annotation:` + fmt.Sprintf("%v", this.Annotation) + `,`, - `EgressRules:` + repeatedStringForEgressRules + `,`, - `ModificationTag:` + strings.Replace(fmt.Sprintf("%v", this.ModificationTag), "ModificationTag", "ModificationTag", 1) + `,`, - `CachedDependencies:` + repeatedStringForCachedDependencies + `,`, - `LegacyDownloadUser:` + fmt.Sprintf("%v", this.LegacyDownloadUser) + `,`, - `TrustedSystemCertificatesPath:` + fmt.Sprintf("%v", this.TrustedSystemCertificatesPath) + `,`, - `VolumeMounts:` + repeatedStringForVolumeMounts + `,`, - `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, - `StartTimeoutMs:` + fmt.Sprintf("%v", this.StartTimeoutMs) + `,`, - `PlacementTags:` + fmt.Sprintf("%v", this.PlacementTags) + `,`, - `MaxPids:` + fmt.Sprintf("%v", this.MaxPids) + `,`, - `CertificateProperties:` + strings.Replace(fmt.Sprintf("%v", this.CertificateProperties), "CertificateProperties", "CertificateProperties", 1) + `,`, - `ImageUsername:` + fmt.Sprintf("%v", this.ImageUsername) + `,`, - `ImagePassword:` + fmt.Sprintf("%v", this.ImagePassword) + `,`, - `CheckDefinition:` + strings.Replace(fmt.Sprintf("%v", this.CheckDefinition), "CheckDefinition", "CheckDefinition", 1) + `,`, - `ImageLayers:` + repeatedStringForImageLayers + `,`, - `MetricTags:` + mapStringForMetricTags + `,`, - `Sidecars:` + repeatedStringForSidecars + `,`, - `LogRateLimit:` + strings.Replace(fmt.Sprintf("%v", this.LogRateLimit), "LogRateLimit", "LogRateLimit", 1) + `,`, - `VolumeMountedFiles:` + repeatedStringForVolumeMountedFiles + `,`, - `}`, - }, "") - return s -} -func valueToStringDesiredLrp(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *DesiredLRPSchedulingInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPSchedulingInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPSchedulingInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredLRPKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DesiredLRPKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotation", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Annotation = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Instances", wireType) - } - m.Instances = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Instances |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredLRPResource", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DesiredLRPResource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Routes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Routes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ModificationTag", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ModificationTag.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumePlacement", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VolumePlacement == nil { - m.VolumePlacement = &VolumePlacement{} - } - if err := m.VolumePlacement.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlacementTags", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PlacementTags = append(m.PlacementTags, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DesiredLRPRunInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPRunInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPRunInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredLRPKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DesiredLRPKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EnvironmentVariables", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EnvironmentVariables = append(m.EnvironmentVariables, EnvironmentVariable{}) - if err := m.EnvironmentVariables[len(m.EnvironmentVariables)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Setup", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Setup == nil { - m.Setup = &Action{} - } - if err := m.Setup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Monitor", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Monitor == nil { - m.Monitor = &Action{} - } - if err := m.Monitor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedStartTimeoutS", wireType) - } - m.DeprecatedStartTimeoutS = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DeprecatedStartTimeoutS |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Privileged = bool(v != 0) - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CpuWeight", wireType) - } - m.CpuWeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CpuWeight |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType == 0 { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Ports = append(m.Ports, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Ports) == 0 { - m.Ports = make([]uint32, 0, elementCount) - } - for iNdEx < postIndex { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Ports = append(m.Ports, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EgressRules", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EgressRules = append(m.EgressRules, SecurityGroupRule{}) - if err := m.EgressRules[len(m.EgressRules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricsGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MetricsGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - m.CreatedAt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreatedAt |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CachedDependencies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CachedDependencies = append(m.CachedDependencies, &CachedDependency{}) - if err := m.CachedDependencies[len(m.CachedDependencies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LegacyDownloadUser", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LegacyDownloadUser = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TrustedSystemCertificatesPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TrustedSystemCertificatesPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeMounts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VolumeMounts = append(m.VolumeMounts, &VolumeMount{}) - if err := m.VolumeMounts[len(m.VolumeMounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Network == nil { - m.Network = &Network{} - } - if err := m.Network.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 19: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTimeoutMs", wireType) - } - m.StartTimeoutMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartTimeoutMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 20: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CertificateProperties", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CertificateProperties == nil { - m.CertificateProperties = &CertificateProperties{} - } - if err := m.CertificateProperties.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 21: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImageUsername", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImageUsername = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 22: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImagePassword", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImagePassword = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 23: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckDefinition", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CheckDefinition == nil { - m.CheckDefinition = &CheckDefinition{} - } - if err := m.CheckDefinition.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 24: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImageLayers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImageLayers = append(m.ImageLayers, &ImageLayer{}) - if err := m.ImageLayers[len(m.ImageLayers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 25: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricTags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MetricTags == nil { - m.MetricTags = make(map[string]*MetricTagValue) - } - var mapkey string - var mapvalue *MetricTagValue - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthDesiredLrp - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthDesiredLrp - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &MetricTagValue{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipDesiredLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrp - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.MetricTags[mapkey] = mapvalue - iNdEx = postIndex - case 26: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sidecars", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sidecars = append(m.Sidecars, &Sidecar{}) - if err := m.Sidecars[len(m.Sidecars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 27: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogRateLimit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LogRateLimit == nil { - m.LogRateLimit = &LogRateLimit{} - } - if err := m.LogRateLimit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 28: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeMountedFiles", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VolumeMountedFiles = append(m.VolumeMountedFiles, &File{}) - if err := m.VolumeMountedFiles[len(m.VolumeMountedFiles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProtoRoutes) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProtoRoutes: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProtoRoutes: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Routes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Routes == nil { - m.Routes = make(map[string][]byte) - } - var mapkey string - mapvalue := []byte{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthDesiredLrp - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthDesiredLrp - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapbyteLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapbyteLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intMapbyteLen := int(mapbyteLen) - if intMapbyteLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postbytesIndex := iNdEx + intMapbyteLen - if postbytesIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postbytesIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = make([]byte, mapbyteLen) - copy(mapvalue, dAtA[iNdEx:postbytesIndex]) - iNdEx = postbytesIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipDesiredLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrp - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Routes[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DesiredLRPUpdate) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPUpdate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPUpdate: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Instances", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.OptionalInstances = &DesiredLRPUpdate_Instances{v} - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Routes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Routes == nil { - m.Routes = &Routes{} - } - if err := m.Routes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotation", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OptionalAnnotation = &DesiredLRPUpdate_Annotation{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricTags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MetricTags == nil { - m.MetricTags = make(map[string]*MetricTagValue) - } - var mapkey string - var mapvalue *MetricTagValue - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthDesiredLrp - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthDesiredLrp - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &MetricTagValue{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipDesiredLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrp - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.MetricTags[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DesiredLRPKey) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DesiredLRPResource) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPResource: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPResource: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemoryMb", wireType) - } - m.MemoryMb = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MemoryMb |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskMb", wireType) - } - m.DiskMb = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DiskMb |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RootFs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RootFs = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxPids", wireType) - } - m.MaxPids = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxPids |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipDesiredLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DesiredLRP) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRP: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRP: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RootFs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RootFs = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Instances", wireType) - } - m.Instances = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Instances |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EnvironmentVariables", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EnvironmentVariables = append(m.EnvironmentVariables, &EnvironmentVariable{}) - if err := m.EnvironmentVariables[len(m.EnvironmentVariables)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Setup", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Setup == nil { - m.Setup = &Action{} - } - if err := m.Setup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedStartTimeoutS", wireType) - } - m.DeprecatedStartTimeoutS = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DeprecatedStartTimeoutS |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Monitor", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Monitor == nil { - m.Monitor = &Action{} - } - if err := m.Monitor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskMb", wireType) - } - m.DiskMb = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DiskMb |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemoryMb", wireType) - } - m.MemoryMb = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MemoryMb |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CpuWeight", wireType) - } - m.CpuWeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CpuWeight |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Privileged = bool(v != 0) - case 14: - if wireType == 0 { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Ports = append(m.Ports, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Ports) == 0 { - m.Ports = make([]uint32, 0, elementCount) - } - for iNdEx < postIndex { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Ports = append(m.Ports, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) - } - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Routes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Routes == nil { - m.Routes = &Routes{} - } - if err := m.Routes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricsGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MetricsGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 19: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotation", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Annotation = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 20: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EgressRules", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EgressRules = append(m.EgressRules, &SecurityGroupRule{}) - if err := m.EgressRules[len(m.EgressRules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 21: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ModificationTag", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ModificationTag == nil { - m.ModificationTag = &ModificationTag{} - } - if err := m.ModificationTag.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 22: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CachedDependencies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CachedDependencies = append(m.CachedDependencies, &CachedDependency{}) - if err := m.CachedDependencies[len(m.CachedDependencies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 23: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LegacyDownloadUser", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LegacyDownloadUser = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 24: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TrustedSystemCertificatesPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TrustedSystemCertificatesPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 25: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeMounts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VolumeMounts = append(m.VolumeMounts, &VolumeMount{}) - if err := m.VolumeMounts[len(m.VolumeMounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 26: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Network == nil { - m.Network = &Network{} - } - if err := m.Network.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 27: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTimeoutMs", wireType) - } - m.StartTimeoutMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartTimeoutMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 28: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlacementTags", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PlacementTags = append(m.PlacementTags, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 29: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxPids", wireType) - } - m.MaxPids = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxPids |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 30: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CertificateProperties", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CertificateProperties == nil { - m.CertificateProperties = &CertificateProperties{} - } - if err := m.CertificateProperties.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 31: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImageUsername", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImageUsername = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 32: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImagePassword", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImagePassword = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 33: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckDefinition", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CheckDefinition == nil { - m.CheckDefinition = &CheckDefinition{} - } - if err := m.CheckDefinition.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 34: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImageLayers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImageLayers = append(m.ImageLayers, &ImageLayer{}) - if err := m.ImageLayers[len(m.ImageLayers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 35: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricTags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MetricTags == nil { - m.MetricTags = make(map[string]*MetricTagValue) - } - var mapkey string - var mapvalue *MetricTagValue - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthDesiredLrp - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthDesiredLrp - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &MetricTagValue{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipDesiredLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrp - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.MetricTags[mapkey] = mapvalue - iNdEx = postIndex - case 36: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sidecars", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sidecars = append(m.Sidecars, &Sidecar{}) - if err := m.Sidecars[len(m.Sidecars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 37: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogRateLimit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LogRateLimit == nil { - m.LogRateLimit = &LogRateLimit{} - } - if err := m.LogRateLimit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 38: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeMountedFiles", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VolumeMountedFiles = append(m.VolumeMountedFiles, &File{}) - if err := m.VolumeMountedFiles[len(m.VolumeMountedFiles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDesiredLrp(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDesiredLrp - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthDesiredLrp - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupDesiredLrp - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthDesiredLrp - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthDesiredLrp = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDesiredLrp = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupDesiredLrp = fmt.Errorf("proto: unexpected end of group") -) diff --git a/models/desired_lrp.proto b/models/desired_lrp.proto index d079c034..b4792905 100644 --- a/models/desired_lrp.proto +++ b/models/desired_lrp.proto @@ -1,9 +1,10 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "actions.proto"; +import "bbs.proto"; import "cached_dependency.proto"; import "certificate_properties.proto"; import "environment_variables.proto"; @@ -18,60 +19,60 @@ import "sidecar.proto"; import "log_rate_limit.proto"; import "file.proto"; -message DesiredLRPSchedulingInfo { - DesiredLRPKey desired_lrp_key = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; +message ProtoDesiredLRPSchedulingInfo { + ProtoDesiredLRPKey desired_lrp_key = 1 [(bbs.bbs_by_value) = true, json_name = "desired_lrp_key", (bbs.bbs_json_always_emit) = true]; - string annotation = 2 [(gogoproto.jsontag) = "annotation"]; - int32 instances = 3 [(gogoproto.jsontag) = "instances"]; + string annotation = 2 [json_name = "annotation", (bbs.bbs_json_always_emit) = true]; + int32 instances = 3 [json_name = "instances", (bbs.bbs_json_always_emit) = true]; - DesiredLRPResource desired_lrp_resource = 4 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; + ProtoDesiredLRPResource desired_lrp_resource = 4 [(bbs.bbs_by_value) = true, json_name = "desired_lrp_resource", (bbs.bbs_json_always_emit) = true]; - ProtoRoutes routes = 5 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Routes"]; - ModificationTag modification_tag = 6 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; - VolumePlacement volume_placement = 7; - repeated string PlacementTags = 8 [(gogoproto.jsontag) ="placement_tags,omitempty"]; + ProtoRoutes routes = 5 [(bbs.bbs_by_value) = false]; + ProtoModificationTag modification_tag = 6 [(bbs.bbs_by_value) = true, json_name = "modification_tag", (bbs.bbs_json_always_emit) = true]; + ProtoVolumePlacement volume_placement = 7 [json_name = "volume_placement"]; + repeated string PlacementTags = 8 [json_name ="placement_tags"]; } -message DesiredLRPRunInfo { - DesiredLRPKey desired_lrp_key = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; +message ProtoDesiredLRPRunInfo { + ProtoDesiredLRPKey desired_lrp_key = 1 [(bbs.bbs_by_value) = true, json_name = "desired_lrp_key", (bbs.bbs_json_always_emit) = true]; - repeated EnvironmentVariable environment_variables = 2 [(gogoproto.jsontag) = "env", (gogoproto.nullable) = false]; - Action setup = 3; - Action action = 4; - Action monitor = 5; + repeated ProtoEnvironmentVariable environment_variables = 2 [json_name = "env", (bbs.bbs_by_value) = false, (bbs.bbs_json_always_emit) = true]; + ProtoAction setup = 3; + ProtoAction action = 4; + ProtoAction monitor = 5; - uint32 deprecated_start_timeout_s = 6 [(gogoproto.jsontag) = "start_timeout,omitempty", deprecated=true]; + uint32 deprecated_start_timeout_s = 6 [json_name = "start_timeout", deprecated=true]; - bool privileged = 7 [(gogoproto.jsontag) = "privileged"]; + bool privileged = 7 [json_name = "privileged", (bbs.bbs_json_always_emit) = true]; - uint32 cpu_weight = 8 [(gogoproto.jsontag) = "cpu_weight"]; + uint32 cpu_weight = 8 [json_name = "cpu_weight", (bbs.bbs_json_always_emit) = true]; repeated uint32 ports = 9 [packed = false]; - repeated SecurityGroupRule egress_rules = 10 [(gogoproto.nullable) = false]; - string log_source = 11 [(gogoproto.jsontag) = "log_source"]; - string metrics_guid = 12 [deprecated=true, (gogoproto.jsontag) = "metrics_guid"]; - int64 created_at = 13 [(gogoproto.jsontag) = "created_at"]; - repeated CachedDependency cached_dependencies = 14; - string legacy_download_user = 15 [deprecated=true]; - string trusted_system_certificates_path = 16; - repeated VolumeMount volume_mounts = 17; - Network network = 18; + repeated ProtoSecurityGroupRule egress_rules = 10 [(bbs.bbs_by_value) = false, json_name = "egress_rules"]; + string log_source = 11 [json_name = "log_source", (bbs.bbs_json_always_emit) = true]; + string metrics_guid = 12 [deprecated=true, json_name = "metrics_guid", (bbs.bbs_json_always_emit) = true]; + int64 created_at = 13 [json_name = "created_at", (bbs.bbs_json_always_emit) = true]; + repeated ProtoCachedDependency cached_dependencies = 14; + string legacy_download_user = 15 [deprecated=true, json_name = "legacy_download_user"]; + string trusted_system_certificates_path = 16 [json_name = "trusted_system_certificates_path"]; + repeated ProtoVolumeMount volume_mounts = 17 [json_name = "volume_mounts"]; + ProtoNetwork network = 18; - int64 start_timeout_ms = 19 [(gogoproto.jsontag) = "start_timeout_ms"]; + int64 start_timeout_ms = 19 [json_name = "start_timeout_ms", (bbs.bbs_json_always_emit) = true]; - CertificateProperties certificate_properties = 20 [(gogoproto.nullable) = true]; + optional ProtoCertificateProperties certificate_properties = 20 [json_name = "certificate_properties"]; - string image_username = 21; - string image_password = 22; + string image_username = 21 [json_name = "image_username"]; + string image_password = 22 [json_name = "image_password"]; - CheckDefinition check_definition = 23; + ProtoCheckDefinition check_definition = 23 [json_name = "check_definition"]; - repeated ImageLayer image_layers = 24; + repeated ProtoImageLayer image_layers = 24 [json_name = "image_layers"]; - map metric_tags = 25 [deprecated=true]; + map metric_tags = 25 [json_name = "metric_tags", deprecated=true]; - repeated Sidecar sidecars = 26; - LogRateLimit log_rate_limit = 27; - repeated File volume_mounted_files = 28 [(gogoproto.jsontag) = "volume_mounted_files"]; + repeated ProtoSidecar sidecars = 26; + ProtoLogRateLimit log_rate_limit = 27 [json_name = "log_rate_limit"]; + repeated ProtoFile volume_mounted_files = 28 [json_name = "volume_mounted_files", (bbs.bbs_json_always_emit) = true]; } // helper message for marshalling routes @@ -79,75 +80,71 @@ message ProtoRoutes { map routes = 1; } -message DesiredLRPUpdate { - oneof optional_instances { - int32 instances = 1; - } - ProtoRoutes routes = 2 [(gogoproto.nullable) = true, (gogoproto.customtype) = "Routes"]; - oneof optional_annotation { - string annotation = 3; - } - map metric_tags = 4; +message ProtoDesiredLRPUpdate { + optional int32 instances = 1; + optional ProtoRoutes routes = 2 [(bbs.bbs_by_value) = false]; + optional string annotation = 3; + map metric_tags = 4 [json_name = "metric_tags"]; } -message DesiredLRPKey { - string process_guid = 1 [(gogoproto.jsontag) = "process_guid"]; - string domain = 2 [(gogoproto.jsontag) = "domain"]; - string log_guid = 3 [(gogoproto.jsontag) = "log_guid"]; +message ProtoDesiredLRPKey { + string process_guid = 1 [json_name = "process_guid", (bbs.bbs_json_always_emit) = true]; + string domain = 2 [json_name = "domain", (bbs.bbs_json_always_emit) = true]; + string log_guid = 3 [json_name = "log_guid", (bbs.bbs_json_always_emit) = true]; } -message DesiredLRPResource { - int32 memory_mb = 1 [(gogoproto.jsontag) = "memory_mb"]; - int32 disk_mb = 2 [(gogoproto.jsontag) = "disk_mb"]; - string root_fs = 3 [(gogoproto.jsontag) = "rootfs"]; - int32 max_pids = 4 [(gogoproto.jsontag) = "max_pids"]; +message ProtoDesiredLRPResource { + int32 memory_mb = 1 [json_name = "memory_mb", (bbs.bbs_json_always_emit) = true]; + int32 disk_mb = 2 [json_name = "disk_mb", (bbs.bbs_json_always_emit) = true]; + string root_fs = 3 [json_name = "rootfs", (bbs.bbs_json_always_emit) = true]; + int32 max_pids = 4 [json_name = "max_pids", (bbs.bbs_json_always_emit) = true]; } -message DesiredLRP { - string process_guid = 1 [(gogoproto.jsontag) = "process_guid"]; - string domain = 2 [(gogoproto.jsontag) = "domain"]; - string root_fs = 3 [(gogoproto.jsontag) = "rootfs"]; - int32 instances = 4 [(gogoproto.jsontag) = "instances"]; - repeated EnvironmentVariable environment_variables = 5 [(gogoproto.jsontag) = "env"]; - Action setup = 6; - Action action = 7; - - int64 start_timeout_ms = 27 [(gogoproto.jsontag) = "start_timeout_ms"]; - uint32 deprecated_start_timeout_s = 8 [(gogoproto.jsontag) = "deprecated_timeout_ns,omitempty", deprecated=true]; - - Action monitor = 9; - int32 disk_mb = 10 [(gogoproto.jsontag) = "disk_mb"]; - int32 memory_mb = 11 [(gogoproto.jsontag) = "memory_mb"]; - uint32 cpu_weight = 12 [(gogoproto.jsontag) = "cpu_weight"]; - bool privileged = 13 [(gogoproto.jsontag) = "privileged"]; +message ProtoDesiredLRP { + string process_guid = 1 [json_name = "process_guid", (bbs.bbs_json_always_emit) = true]; + string domain = 2 [json_name = "domain", (bbs.bbs_json_always_emit) = true]; + string root_fs = 3 [json_name = "rootfs", (bbs.bbs_json_always_emit) = true]; + int32 instances = 4 [json_name = "instances", (bbs.bbs_json_always_emit) = true]; + repeated ProtoEnvironmentVariable environment_variables = 5 [json_name = "env", (bbs.bbs_json_always_emit) = true]; + ProtoAction setup = 6; + ProtoAction action = 7; + + int64 start_timeout_ms = 27 [json_name = "start_timeout_ms", (bbs.bbs_json_always_emit) = true]; + uint32 deprecated_start_timeout_s = 8 [json_name = "deprecated_timeout_ns", deprecated=true]; + + ProtoAction monitor = 9; + int32 disk_mb = 10 [json_name = "disk_mb", (bbs.bbs_json_always_emit) = true]; + int32 memory_mb = 11 [json_name = "memory_mb", (bbs.bbs_json_always_emit) = true]; + uint32 cpu_weight = 12 [json_name = "cpu_weight", (bbs.bbs_json_always_emit) = true]; + bool privileged = 13 [json_name = "privileged", (bbs.bbs_json_always_emit) = true]; repeated uint32 ports = 14 [packed = false]; - ProtoRoutes routes = 15 [(gogoproto.nullable) = true, (gogoproto.customtype) = "Routes"]; - string log_source = 16 [(gogoproto.jsontag) = "log_source"]; - string log_guid = 17 [(gogoproto.jsontag) = "log_guid"]; - string metrics_guid = 18 [deprecated=true, (gogoproto.jsontag) = "metrics_guid"]; - string annotation = 19 [(gogoproto.jsontag) = "annotation"]; - repeated SecurityGroupRule egress_rules = 20; - ModificationTag modification_tag = 21; - repeated CachedDependency cached_dependencies = 22; - string legacy_download_user = 23 [deprecated=true]; - string trusted_system_certificates_path = 24; - repeated VolumeMount volume_mounts = 25; - Network network = 26; - repeated string PlacementTags = 28 [(gogoproto.jsontag) ="placement_tags,omitempty"]; - int32 max_pids = 29 [(gogoproto.jsontag) = "max_pids"]; - - CertificateProperties certificate_properties = 30 [(gogoproto.nullable) = true]; - - string image_username = 31; - string image_password = 32; - - CheckDefinition check_definition = 33; - - repeated ImageLayer image_layers = 34; - - map metric_tags = 35; - - repeated Sidecar sidecars = 36; - LogRateLimit log_rate_limit = 37; - repeated File volume_mounted_files = 38 [(gogoproto.jsontag) = "volume_mounted_files"]; + optional ProtoRoutes routes = 15 [(bbs.bbs_by_value) = false]; + string log_source = 16 [json_name = "log_source", (bbs.bbs_json_always_emit) = true]; + string log_guid = 17 [json_name = "log_guid", (bbs.bbs_json_always_emit) = true]; + string metrics_guid = 18 [deprecated=true, json_name = "metrics_guid", (bbs.bbs_json_always_emit) = true]; + string annotation = 19 [json_name = "annotation", (bbs.bbs_json_always_emit) = true]; + repeated ProtoSecurityGroupRule egress_rules = 20 [json_name = "egress_rules"]; + ProtoModificationTag modification_tag = 21 [json_name = "modification_tag"]; + repeated ProtoCachedDependency cached_dependencies = 22 [json_name = "cached_dependencies"]; + string legacy_download_user = 23 [deprecated=true, json_name = "legacy_download_user"]; + string trusted_system_certificates_path = 24 [json_name = "trusted_system_certificates_path"]; + repeated ProtoVolumeMount volume_mounts = 25 [json_name = "volume_mounts"]; + ProtoNetwork network = 26; + repeated string PlacementTags = 28 [json_name ="placement_tags"]; + int32 max_pids = 29 [json_name = "max_pids", (bbs.bbs_json_always_emit) = true]; + + optional ProtoCertificateProperties certificate_properties = 30 [json_name = "certificate_properties"]; + + string image_username = 31 [json_name = "image_username"]; + string image_password = 32 [json_name = "image_password"]; + + ProtoCheckDefinition check_definition = 33 [json_name = "check_definition"]; + + repeated ProtoImageLayer image_layers = 34 [json_name = "image_layers"]; + + map metric_tags = 35 [json_name = "metric_tags"]; + + repeated ProtoSidecar sidecars = 36; + ProtoLogRateLimit log_rate_limit = 37 [json_name = "log_rate_limit"]; + repeated ProtoFile volume_mounted_files = 38 [json_name = "volume_mounted_files", (bbs.bbs_json_always_emit) = true]; } diff --git a/models/desired_lrp_bbs.pb.go b/models/desired_lrp_bbs.pb.go new file mode 100644 index 00000000..fd781d9d --- /dev/null +++ b/models/desired_lrp_bbs.pb.go @@ -0,0 +1,2322 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: desired_lrp.proto + +package models + +// Prevent copylock errors when using ProtoDesiredLRPSchedulingInfo directly +type DesiredLRPSchedulingInfo struct { + DesiredLrpKey DesiredLRPKey `json:"desired_lrp_key"` + Annotation string `json:"annotation"` + Instances int32 `json:"instances"` + DesiredLrpResource DesiredLRPResource `json:"desired_lrp_resource"` + Routes *Routes `json:"routes,omitempty"` + ModificationTag ModificationTag `json:"modification_tag"` + VolumePlacement *VolumePlacement `json:"volume_placement,omitempty"` + PlacementTags []string `json:"placement_tags,omitempty"` +} + +func (this *DesiredLRPSchedulingInfo) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPSchedulingInfo) + if !ok { + that2, ok := that.(DesiredLRPSchedulingInfo) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if !this.DesiredLrpKey.Equal(that1.DesiredLrpKey) { + return false + } + if this.Annotation != that1.Annotation { + return false + } + if this.Instances != that1.Instances { + return false + } + if !this.DesiredLrpResource.Equal(that1.DesiredLrpResource) { + return false + } + if this.Routes == nil { + if that1.Routes != nil { + return false + } + } else if !this.Routes.Equal(*that1.Routes) { + return false + } + if !this.ModificationTag.Equal(that1.ModificationTag) { + return false + } + if this.VolumePlacement == nil { + if that1.VolumePlacement != nil { + return false + } + } else if !this.VolumePlacement.Equal(*that1.VolumePlacement) { + return false + } + if this.PlacementTags == nil { + if that1.PlacementTags != nil { + return false + } + } else if len(this.PlacementTags) != len(that1.PlacementTags) { + return false + } + for i := range this.PlacementTags { + if this.PlacementTags[i] != that1.PlacementTags[i] { + return false + } + } + return true +} +func (m *DesiredLRPSchedulingInfo) SetDesiredLrpKey(value DesiredLRPKey) { + if m != nil { + m.DesiredLrpKey = value + } +} +func (m *DesiredLRPSchedulingInfo) GetAnnotation() string { + if m != nil { + return m.Annotation + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPSchedulingInfo) SetAnnotation(value string) { + if m != nil { + m.Annotation = value + } +} +func (m *DesiredLRPSchedulingInfo) GetInstances() int32 { + if m != nil { + return m.Instances + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *DesiredLRPSchedulingInfo) SetInstances(value int32) { + if m != nil { + m.Instances = value + } +} +func (m *DesiredLRPSchedulingInfo) SetDesiredLrpResource(value DesiredLRPResource) { + if m != nil { + m.DesiredLrpResource = value + } +} +func (m *DesiredLRPSchedulingInfo) GetRoutes() *Routes { + if m != nil { + return m.Routes + } + return nil +} +func (m *DesiredLRPSchedulingInfo) SetRoutes(value *Routes) { + if m != nil { + m.Routes = value + } +} +func (m *DesiredLRPSchedulingInfo) SetModificationTag(value ModificationTag) { + if m != nil { + m.ModificationTag = value + } +} +func (m *DesiredLRPSchedulingInfo) GetVolumePlacement() *VolumePlacement { + if m != nil { + return m.VolumePlacement + } + return nil +} +func (m *DesiredLRPSchedulingInfo) SetVolumePlacement(value *VolumePlacement) { + if m != nil { + m.VolumePlacement = value + } +} +func (m *DesiredLRPSchedulingInfo) GetPlacementTags() []string { + if m != nil { + return m.PlacementTags + } + return nil +} +func (m *DesiredLRPSchedulingInfo) SetPlacementTags(value []string) { + if m != nil { + m.PlacementTags = value + } +} +func (x *DesiredLRPSchedulingInfo) ToProto() *ProtoDesiredLRPSchedulingInfo { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPSchedulingInfo{ + DesiredLrpKey: x.DesiredLrpKey.ToProto(), + Annotation: x.Annotation, + Instances: x.Instances, + DesiredLrpResource: x.DesiredLrpResource.ToProto(), + Routes: x.Routes.ToProto(), + ModificationTag: x.ModificationTag.ToProto(), + VolumePlacement: x.VolumePlacement.ToProto(), + PlacementTags: x.PlacementTags, + } + return proto +} + +func (x *ProtoDesiredLRPSchedulingInfo) FromProto() *DesiredLRPSchedulingInfo { + if x == nil { + return nil + } + + copysafe := &DesiredLRPSchedulingInfo{ + DesiredLrpKey: *x.DesiredLrpKey.FromProto(), + Annotation: x.Annotation, + Instances: x.Instances, + DesiredLrpResource: *x.DesiredLrpResource.FromProto(), + Routes: x.Routes.FromProto(), + ModificationTag: *x.ModificationTag.FromProto(), + VolumePlacement: x.VolumePlacement.FromProto(), + PlacementTags: x.PlacementTags, + } + return copysafe +} + +func DesiredLRPSchedulingInfoToProtoSlice(values []*DesiredLRPSchedulingInfo) []*ProtoDesiredLRPSchedulingInfo { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPSchedulingInfo, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPSchedulingInfoFromProtoSlice(values []*ProtoDesiredLRPSchedulingInfo) []*DesiredLRPSchedulingInfo { + if values == nil { + return nil + } + result := make([]*DesiredLRPSchedulingInfo, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRPRunInfo directly +type DesiredLRPRunInfo struct { + DesiredLrpKey DesiredLRPKey `json:"desired_lrp_key"` + EnvironmentVariables []*EnvironmentVariable `json:"env"` + Setup *Action `json:"setup,omitempty"` + Action *Action `json:"action,omitempty"` + Monitor *Action `json:"monitor,omitempty"` + // Deprecated: marked deprecated in desired_lrp.proto + DeprecatedStartTimeoutS uint32 `json:"start_timeout,omitempty"` + Privileged bool `json:"privileged"` + CpuWeight uint32 `json:"cpu_weight"` + Ports []uint32 `json:"ports,omitempty"` + EgressRules []*SecurityGroupRule `json:"egress_rules,omitempty"` + LogSource string `json:"log_source"` + // Deprecated: marked deprecated in desired_lrp.proto + MetricsGuid string `json:"metrics_guid"` + CreatedAt int64 `json:"created_at"` + CachedDependencies []*CachedDependency `json:"cachedDependencies,omitempty"` + // Deprecated: marked deprecated in desired_lrp.proto + LegacyDownloadUser string `json:"legacy_download_user,omitempty"` + TrustedSystemCertificatesPath string `json:"trusted_system_certificates_path,omitempty"` + VolumeMounts []*VolumeMount `json:"volume_mounts,omitempty"` + Network *Network `json:"network,omitempty"` + StartTimeoutMs int64 `json:"start_timeout_ms"` + CertificateProperties *CertificateProperties `json:"certificate_properties,omitempty"` + ImageUsername string `json:"image_username,omitempty"` + ImagePassword string `json:"image_password,omitempty"` + CheckDefinition *CheckDefinition `json:"check_definition,omitempty"` + ImageLayers []*ImageLayer `json:"image_layers,omitempty"` + // Deprecated: marked deprecated in desired_lrp.proto + MetricTags map[string]*MetricTagValue `json:"metric_tags,omitempty"` + Sidecars []*Sidecar `json:"sidecars,omitempty"` + LogRateLimit *LogRateLimit `json:"log_rate_limit,omitempty"` + VolumeMountedFiles []*File `json:"volume_mounted_files"` +} + +func (this *DesiredLRPRunInfo) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPRunInfo) + if !ok { + that2, ok := that.(DesiredLRPRunInfo) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if !this.DesiredLrpKey.Equal(that1.DesiredLrpKey) { + return false + } + if this.EnvironmentVariables == nil { + if that1.EnvironmentVariables != nil { + return false + } + } else if len(this.EnvironmentVariables) != len(that1.EnvironmentVariables) { + return false + } + for i := range this.EnvironmentVariables { + if !this.EnvironmentVariables[i].Equal(that1.EnvironmentVariables[i]) { + return false + } + } + if this.Setup == nil { + if that1.Setup != nil { + return false + } + } else if !this.Setup.Equal(*that1.Setup) { + return false + } + if this.Action == nil { + if that1.Action != nil { + return false + } + } else if !this.Action.Equal(*that1.Action) { + return false + } + if this.Monitor == nil { + if that1.Monitor != nil { + return false + } + } else if !this.Monitor.Equal(*that1.Monitor) { + return false + } + if this.DeprecatedStartTimeoutS != that1.DeprecatedStartTimeoutS { + return false + } + if this.Privileged != that1.Privileged { + return false + } + if this.CpuWeight != that1.CpuWeight { + return false + } + if this.Ports == nil { + if that1.Ports != nil { + return false + } + } else if len(this.Ports) != len(that1.Ports) { + return false + } + for i := range this.Ports { + if this.Ports[i] != that1.Ports[i] { + return false + } + } + if this.EgressRules == nil { + if that1.EgressRules != nil { + return false + } + } else if len(this.EgressRules) != len(that1.EgressRules) { + return false + } + for i := range this.EgressRules { + if !this.EgressRules[i].Equal(that1.EgressRules[i]) { + return false + } + } + if this.LogSource != that1.LogSource { + return false + } + if this.MetricsGuid != that1.MetricsGuid { + return false + } + if this.CreatedAt != that1.CreatedAt { + return false + } + if this.CachedDependencies == nil { + if that1.CachedDependencies != nil { + return false + } + } else if len(this.CachedDependencies) != len(that1.CachedDependencies) { + return false + } + for i := range this.CachedDependencies { + if !this.CachedDependencies[i].Equal(that1.CachedDependencies[i]) { + return false + } + } + if this.LegacyDownloadUser != that1.LegacyDownloadUser { + return false + } + if this.TrustedSystemCertificatesPath != that1.TrustedSystemCertificatesPath { + return false + } + if this.VolumeMounts == nil { + if that1.VolumeMounts != nil { + return false + } + } else if len(this.VolumeMounts) != len(that1.VolumeMounts) { + return false + } + for i := range this.VolumeMounts { + if !this.VolumeMounts[i].Equal(that1.VolumeMounts[i]) { + return false + } + } + if this.Network == nil { + if that1.Network != nil { + return false + } + } else if !this.Network.Equal(*that1.Network) { + return false + } + if this.StartTimeoutMs != that1.StartTimeoutMs { + return false + } + if this.CertificateProperties == nil { + if that1.CertificateProperties != nil { + return false + } + } else if !this.CertificateProperties.Equal(*that1.CertificateProperties) { + return false + } + if this.ImageUsername != that1.ImageUsername { + return false + } + if this.ImagePassword != that1.ImagePassword { + return false + } + if this.CheckDefinition == nil { + if that1.CheckDefinition != nil { + return false + } + } else if !this.CheckDefinition.Equal(*that1.CheckDefinition) { + return false + } + if this.ImageLayers == nil { + if that1.ImageLayers != nil { + return false + } + } else if len(this.ImageLayers) != len(that1.ImageLayers) { + return false + } + for i := range this.ImageLayers { + if !this.ImageLayers[i].Equal(that1.ImageLayers[i]) { + return false + } + } + if this.MetricTags == nil { + if that1.MetricTags != nil { + return false + } + } else if len(this.MetricTags) != len(that1.MetricTags) { + return false + } + for i := range this.MetricTags { + if !this.MetricTags[i].Equal(that1.MetricTags[i]) { + return false + } + } + if this.Sidecars == nil { + if that1.Sidecars != nil { + return false + } + } else if len(this.Sidecars) != len(that1.Sidecars) { + return false + } + for i := range this.Sidecars { + if !this.Sidecars[i].Equal(that1.Sidecars[i]) { + return false + } + } + if this.LogRateLimit == nil { + if that1.LogRateLimit != nil { + return false + } + } else if !this.LogRateLimit.Equal(*that1.LogRateLimit) { + return false + } + if this.VolumeMountedFiles == nil { + if that1.VolumeMountedFiles != nil { + return false + } + } else if len(this.VolumeMountedFiles) != len(that1.VolumeMountedFiles) { + return false + } + for i := range this.VolumeMountedFiles { + if !this.VolumeMountedFiles[i].Equal(that1.VolumeMountedFiles[i]) { + return false + } + } + return true +} +func (m *DesiredLRPRunInfo) SetDesiredLrpKey(value DesiredLRPKey) { + if m != nil { + m.DesiredLrpKey = value + } +} +func (m *DesiredLRPRunInfo) GetEnvironmentVariables() []*EnvironmentVariable { + if m != nil { + return m.EnvironmentVariables + } + return nil +} +func (m *DesiredLRPRunInfo) SetEnvironmentVariables(value []*EnvironmentVariable) { + if m != nil { + m.EnvironmentVariables = value + } +} +func (m *DesiredLRPRunInfo) GetSetup() *Action { + if m != nil { + return m.Setup + } + return nil +} +func (m *DesiredLRPRunInfo) SetSetup(value *Action) { + if m != nil { + m.Setup = value + } +} +func (m *DesiredLRPRunInfo) GetAction() *Action { + if m != nil { + return m.Action + } + return nil +} +func (m *DesiredLRPRunInfo) SetAction(value *Action) { + if m != nil { + m.Action = value + } +} +func (m *DesiredLRPRunInfo) GetMonitor() *Action { + if m != nil { + return m.Monitor + } + return nil +} +func (m *DesiredLRPRunInfo) SetMonitor(value *Action) { + if m != nil { + m.Monitor = value + } +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRPRunInfo) GetDeprecatedStartTimeoutS() uint32 { + if m != nil { + return m.DeprecatedStartTimeoutS + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRPRunInfo) SetDeprecatedStartTimeoutS(value uint32) { + if m != nil { + m.DeprecatedStartTimeoutS = value + } +} +func (m *DesiredLRPRunInfo) GetPrivileged() bool { + if m != nil { + return m.Privileged + } + var defaultValue bool + defaultValue = false + return defaultValue +} +func (m *DesiredLRPRunInfo) SetPrivileged(value bool) { + if m != nil { + m.Privileged = value + } +} +func (m *DesiredLRPRunInfo) GetCpuWeight() uint32 { + if m != nil { + return m.CpuWeight + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} +func (m *DesiredLRPRunInfo) SetCpuWeight(value uint32) { + if m != nil { + m.CpuWeight = value + } +} +func (m *DesiredLRPRunInfo) GetPorts() []uint32 { + if m != nil { + return m.Ports + } + return nil +} +func (m *DesiredLRPRunInfo) SetPorts(value []uint32) { + if m != nil { + m.Ports = value + } +} +func (m *DesiredLRPRunInfo) GetEgressRules() []*SecurityGroupRule { + if m != nil { + return m.EgressRules + } + return nil +} +func (m *DesiredLRPRunInfo) SetEgressRules(value []*SecurityGroupRule) { + if m != nil { + m.EgressRules = value + } +} +func (m *DesiredLRPRunInfo) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPRunInfo) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRPRunInfo) GetMetricsGuid() string { + if m != nil { + return m.MetricsGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRPRunInfo) SetMetricsGuid(value string) { + if m != nil { + m.MetricsGuid = value + } +} +func (m *DesiredLRPRunInfo) GetCreatedAt() int64 { + if m != nil { + return m.CreatedAt + } + var defaultValue int64 + defaultValue = 0 + return defaultValue +} +func (m *DesiredLRPRunInfo) SetCreatedAt(value int64) { + if m != nil { + m.CreatedAt = value + } +} +func (m *DesiredLRPRunInfo) GetCachedDependencies() []*CachedDependency { + if m != nil { + return m.CachedDependencies + } + return nil +} +func (m *DesiredLRPRunInfo) SetCachedDependencies(value []*CachedDependency) { + if m != nil { + m.CachedDependencies = value + } +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRPRunInfo) GetLegacyDownloadUser() string { + if m != nil { + return m.LegacyDownloadUser + } + var defaultValue string + defaultValue = "" + return defaultValue +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRPRunInfo) SetLegacyDownloadUser(value string) { + if m != nil { + m.LegacyDownloadUser = value + } +} +func (m *DesiredLRPRunInfo) GetTrustedSystemCertificatesPath() string { + if m != nil { + return m.TrustedSystemCertificatesPath + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPRunInfo) SetTrustedSystemCertificatesPath(value string) { + if m != nil { + m.TrustedSystemCertificatesPath = value + } +} +func (m *DesiredLRPRunInfo) GetVolumeMounts() []*VolumeMount { + if m != nil { + return m.VolumeMounts + } + return nil +} +func (m *DesiredLRPRunInfo) SetVolumeMounts(value []*VolumeMount) { + if m != nil { + m.VolumeMounts = value + } +} +func (m *DesiredLRPRunInfo) GetNetwork() *Network { + if m != nil { + return m.Network + } + return nil +} +func (m *DesiredLRPRunInfo) SetNetwork(value *Network) { + if m != nil { + m.Network = value + } +} +func (m *DesiredLRPRunInfo) GetStartTimeoutMs() int64 { + if m != nil { + return m.StartTimeoutMs + } + var defaultValue int64 + defaultValue = 0 + return defaultValue +} +func (m *DesiredLRPRunInfo) SetStartTimeoutMs(value int64) { + if m != nil { + m.StartTimeoutMs = value + } +} +func (m *DesiredLRPRunInfo) CertificatePropertiesExists() bool { + return m != nil && m.CertificateProperties != nil +} +func (m *DesiredLRPRunInfo) GetCertificateProperties() *CertificateProperties { + if m != nil && m.CertificateProperties != nil { + return m.CertificateProperties + } + return nil +} +func (m *DesiredLRPRunInfo) SetCertificateProperties(value *CertificateProperties) { + if m != nil { + m.CertificateProperties = value + } +} +func (m *DesiredLRPRunInfo) GetImageUsername() string { + if m != nil { + return m.ImageUsername + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPRunInfo) SetImageUsername(value string) { + if m != nil { + m.ImageUsername = value + } +} +func (m *DesiredLRPRunInfo) GetImagePassword() string { + if m != nil { + return m.ImagePassword + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPRunInfo) SetImagePassword(value string) { + if m != nil { + m.ImagePassword = value + } +} +func (m *DesiredLRPRunInfo) GetCheckDefinition() *CheckDefinition { + if m != nil { + return m.CheckDefinition + } + return nil +} +func (m *DesiredLRPRunInfo) SetCheckDefinition(value *CheckDefinition) { + if m != nil { + m.CheckDefinition = value + } +} +func (m *DesiredLRPRunInfo) GetImageLayers() []*ImageLayer { + if m != nil { + return m.ImageLayers + } + return nil +} +func (m *DesiredLRPRunInfo) SetImageLayers(value []*ImageLayer) { + if m != nil { + m.ImageLayers = value + } +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRPRunInfo) GetMetricTags() map[string]*MetricTagValue { + if m != nil { + return m.MetricTags + } + return nil +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRPRunInfo) SetMetricTags(value map[string]*MetricTagValue) { + if m != nil { + m.MetricTags = value + } +} +func (m *DesiredLRPRunInfo) GetSidecars() []*Sidecar { + if m != nil { + return m.Sidecars + } + return nil +} +func (m *DesiredLRPRunInfo) SetSidecars(value []*Sidecar) { + if m != nil { + m.Sidecars = value + } +} +func (m *DesiredLRPRunInfo) GetLogRateLimit() *LogRateLimit { + if m != nil { + return m.LogRateLimit + } + return nil +} +func (m *DesiredLRPRunInfo) SetLogRateLimit(value *LogRateLimit) { + if m != nil { + m.LogRateLimit = value + } +} +func (m *DesiredLRPRunInfo) GetVolumeMountedFiles() []*File { + if m != nil { + return m.VolumeMountedFiles + } + return nil +} +func (m *DesiredLRPRunInfo) SetVolumeMountedFiles(value []*File) { + if m != nil { + m.VolumeMountedFiles = value + } +} +func (x *DesiredLRPRunInfo) ToProto() *ProtoDesiredLRPRunInfo { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPRunInfo{ + DesiredLrpKey: x.DesiredLrpKey.ToProto(), + EnvironmentVariables: EnvironmentVariableToProtoSlice(x.EnvironmentVariables), + Setup: x.Setup.ToProto(), + Action: x.Action.ToProto(), + Monitor: x.Monitor.ToProto(), + DeprecatedStartTimeoutS: x.DeprecatedStartTimeoutS, + Privileged: x.Privileged, + CpuWeight: x.CpuWeight, + Ports: x.Ports, + EgressRules: SecurityGroupRuleToProtoSlice(x.EgressRules), + LogSource: x.LogSource, + MetricsGuid: x.MetricsGuid, + CreatedAt: x.CreatedAt, + CachedDependencies: CachedDependencyToProtoSlice(x.CachedDependencies), + LegacyDownloadUser: x.LegacyDownloadUser, + TrustedSystemCertificatesPath: x.TrustedSystemCertificatesPath, + VolumeMounts: VolumeMountToProtoSlice(x.VolumeMounts), + Network: x.Network.ToProto(), + StartTimeoutMs: x.StartTimeoutMs, + CertificateProperties: x.CertificateProperties.ToProto(), + ImageUsername: x.ImageUsername, + ImagePassword: x.ImagePassword, + CheckDefinition: x.CheckDefinition.ToProto(), + ImageLayers: ImageLayerToProtoSlice(x.ImageLayers), + MetricTags: DesiredLRPRunInfoMetricTagsToProtoMap(x.MetricTags), + Sidecars: SidecarToProtoSlice(x.Sidecars), + LogRateLimit: x.LogRateLimit.ToProto(), + VolumeMountedFiles: FileToProtoSlice(x.VolumeMountedFiles), + } + return proto +} + +func (x *ProtoDesiredLRPRunInfo) FromProto() *DesiredLRPRunInfo { + if x == nil { + return nil + } + + copysafe := &DesiredLRPRunInfo{ + DesiredLrpKey: *x.DesiredLrpKey.FromProto(), + EnvironmentVariables: EnvironmentVariableFromProtoSlice(x.EnvironmentVariables), + Setup: x.Setup.FromProto(), + Action: x.Action.FromProto(), + Monitor: x.Monitor.FromProto(), + DeprecatedStartTimeoutS: x.DeprecatedStartTimeoutS, + Privileged: x.Privileged, + CpuWeight: x.CpuWeight, + Ports: x.Ports, + EgressRules: SecurityGroupRuleFromProtoSlice(x.EgressRules), + LogSource: x.LogSource, + MetricsGuid: x.MetricsGuid, + CreatedAt: x.CreatedAt, + CachedDependencies: CachedDependencyFromProtoSlice(x.CachedDependencies), + LegacyDownloadUser: x.LegacyDownloadUser, + TrustedSystemCertificatesPath: x.TrustedSystemCertificatesPath, + VolumeMounts: VolumeMountFromProtoSlice(x.VolumeMounts), + Network: x.Network.FromProto(), + StartTimeoutMs: x.StartTimeoutMs, + CertificateProperties: x.CertificateProperties.FromProto(), + ImageUsername: x.ImageUsername, + ImagePassword: x.ImagePassword, + CheckDefinition: x.CheckDefinition.FromProto(), + ImageLayers: ImageLayerFromProtoSlice(x.ImageLayers), + MetricTags: DesiredLRPRunInfoMetricTagsFromProtoMap(x.MetricTags), + Sidecars: SidecarFromProtoSlice(x.Sidecars), + LogRateLimit: x.LogRateLimit.FromProto(), + VolumeMountedFiles: FileFromProtoSlice(x.VolumeMountedFiles), + } + return copysafe +} + +func DesiredLRPRunInfoToProtoSlice(values []*DesiredLRPRunInfo) []*ProtoDesiredLRPRunInfo { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPRunInfo, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPRunInfoMetricTagsToProtoMap(values map[string]*MetricTagValue) map[string]*ProtoMetricTagValue { + if values == nil { + return nil + } + result := make(map[string]*ProtoMetricTagValue, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPRunInfoFromProtoSlice(values []*ProtoDesiredLRPRunInfo) []*DesiredLRPRunInfo { + if values == nil { + return nil + } + result := make([]*DesiredLRPRunInfo, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +func DesiredLRPRunInfoMetricTagsFromProtoMap(values map[string]*ProtoMetricTagValue) map[string]*MetricTagValue { + if values == nil { + return nil + } + result := make(map[string]*MetricTagValue, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRPUpdate directly +type DesiredLRPUpdate struct { + Instances *int32 `json:"instances,omitempty"` + Routes *Routes `json:"routes,omitempty"` + Annotation *string `json:"annotation,omitempty"` + MetricTags map[string]*MetricTagValue `json:"metric_tags,omitempty"` +} + +func (this *DesiredLRPUpdate) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPUpdate) + if !ok { + that2, ok := that.(DesiredLRPUpdate) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Instances == nil { + if that1.Instances != nil { + return false + } + } else if *this.Instances != *that1.Instances { + return false + } + if this.Routes == nil { + if that1.Routes != nil { + return false + } + } else if !this.Routes.Equal(*that1.Routes) { + return false + } + if this.Annotation == nil { + if that1.Annotation != nil { + return false + } + } else if *this.Annotation != *that1.Annotation { + return false + } + if this.MetricTags == nil { + if that1.MetricTags != nil { + return false + } + } else if len(this.MetricTags) != len(that1.MetricTags) { + return false + } + for i := range this.MetricTags { + if !this.MetricTags[i].Equal(that1.MetricTags[i]) { + return false + } + } + return true +} +func (m *DesiredLRPUpdate) InstancesExists() bool { + return m != nil && m.Instances != nil +} +func (m *DesiredLRPUpdate) GetInstances() *int32 { + if m != nil && m.Instances != nil { + return m.Instances + } + var defaultValue int32 + defaultValue = 0 + return &defaultValue +} +func (m *DesiredLRPUpdate) SetInstances(value *int32) { + if m != nil { + m.Instances = value + } +} +func (m *DesiredLRPUpdate) RoutesExists() bool { + return m != nil && m.Routes != nil +} +func (m *DesiredLRPUpdate) GetRoutes() *Routes { + if m != nil && m.Routes != nil { + return m.Routes + } + return nil +} +func (m *DesiredLRPUpdate) SetRoutes(value *Routes) { + if m != nil { + m.Routes = value + } +} +func (m *DesiredLRPUpdate) AnnotationExists() bool { + return m != nil && m.Annotation != nil +} +func (m *DesiredLRPUpdate) GetAnnotation() *string { + if m != nil && m.Annotation != nil { + return m.Annotation + } + var defaultValue string + defaultValue = "" + return &defaultValue +} +func (m *DesiredLRPUpdate) SetAnnotation(value *string) { + if m != nil { + m.Annotation = value + } +} +func (m *DesiredLRPUpdate) GetMetricTags() map[string]*MetricTagValue { + if m != nil { + return m.MetricTags + } + return nil +} +func (m *DesiredLRPUpdate) SetMetricTags(value map[string]*MetricTagValue) { + if m != nil { + m.MetricTags = value + } +} +func (x *DesiredLRPUpdate) ToProto() *ProtoDesiredLRPUpdate { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPUpdate{ + Instances: x.Instances, + Routes: x.Routes.ToProto(), + Annotation: x.Annotation, + MetricTags: DesiredLRPUpdateMetricTagsToProtoMap(x.MetricTags), + } + return proto +} + +func (x *ProtoDesiredLRPUpdate) FromProto() *DesiredLRPUpdate { + if x == nil { + return nil + } + + copysafe := &DesiredLRPUpdate{ + Instances: x.Instances, + Routes: x.Routes.FromProto(), + Annotation: x.Annotation, + MetricTags: DesiredLRPUpdateMetricTagsFromProtoMap(x.MetricTags), + } + return copysafe +} + +func DesiredLRPUpdateToProtoSlice(values []*DesiredLRPUpdate) []*ProtoDesiredLRPUpdate { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPUpdate, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPUpdateMetricTagsToProtoMap(values map[string]*MetricTagValue) map[string]*ProtoMetricTagValue { + if values == nil { + return nil + } + result := make(map[string]*ProtoMetricTagValue, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPUpdateFromProtoSlice(values []*ProtoDesiredLRPUpdate) []*DesiredLRPUpdate { + if values == nil { + return nil + } + result := make([]*DesiredLRPUpdate, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +func DesiredLRPUpdateMetricTagsFromProtoMap(values map[string]*ProtoMetricTagValue) map[string]*MetricTagValue { + if values == nil { + return nil + } + result := make(map[string]*MetricTagValue, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRPKey directly +type DesiredLRPKey struct { + ProcessGuid string `json:"process_guid"` + Domain string `json:"domain"` + LogGuid string `json:"log_guid"` +} + +func (this *DesiredLRPKey) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPKey) + if !ok { + that2, ok := that.(DesiredLRPKey) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ProcessGuid != that1.ProcessGuid { + return false + } + if this.Domain != that1.Domain { + return false + } + if this.LogGuid != that1.LogGuid { + return false + } + return true +} +func (m *DesiredLRPKey) GetProcessGuid() string { + if m != nil { + return m.ProcessGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPKey) SetProcessGuid(value string) { + if m != nil { + m.ProcessGuid = value + } +} +func (m *DesiredLRPKey) GetDomain() string { + if m != nil { + return m.Domain + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPKey) SetDomain(value string) { + if m != nil { + m.Domain = value + } +} +func (m *DesiredLRPKey) GetLogGuid() string { + if m != nil { + return m.LogGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPKey) SetLogGuid(value string) { + if m != nil { + m.LogGuid = value + } +} +func (x *DesiredLRPKey) ToProto() *ProtoDesiredLRPKey { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPKey{ + ProcessGuid: x.ProcessGuid, + Domain: x.Domain, + LogGuid: x.LogGuid, + } + return proto +} + +func (x *ProtoDesiredLRPKey) FromProto() *DesiredLRPKey { + if x == nil { + return nil + } + + copysafe := &DesiredLRPKey{ + ProcessGuid: x.ProcessGuid, + Domain: x.Domain, + LogGuid: x.LogGuid, + } + return copysafe +} + +func DesiredLRPKeyToProtoSlice(values []*DesiredLRPKey) []*ProtoDesiredLRPKey { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPKey, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPKeyFromProtoSlice(values []*ProtoDesiredLRPKey) []*DesiredLRPKey { + if values == nil { + return nil + } + result := make([]*DesiredLRPKey, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRPResource directly +type DesiredLRPResource struct { + MemoryMb int32 `json:"memory_mb"` + DiskMb int32 `json:"disk_mb"` + RootFs string `json:"rootfs"` + MaxPids int32 `json:"max_pids"` +} + +func (this *DesiredLRPResource) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPResource) + if !ok { + that2, ok := that.(DesiredLRPResource) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.MemoryMb != that1.MemoryMb { + return false + } + if this.DiskMb != that1.DiskMb { + return false + } + if this.RootFs != that1.RootFs { + return false + } + if this.MaxPids != that1.MaxPids { + return false + } + return true +} +func (m *DesiredLRPResource) GetMemoryMb() int32 { + if m != nil { + return m.MemoryMb + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *DesiredLRPResource) SetMemoryMb(value int32) { + if m != nil { + m.MemoryMb = value + } +} +func (m *DesiredLRPResource) GetDiskMb() int32 { + if m != nil { + return m.DiskMb + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *DesiredLRPResource) SetDiskMb(value int32) { + if m != nil { + m.DiskMb = value + } +} +func (m *DesiredLRPResource) GetRootFs() string { + if m != nil { + return m.RootFs + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPResource) SetRootFs(value string) { + if m != nil { + m.RootFs = value + } +} +func (m *DesiredLRPResource) GetMaxPids() int32 { + if m != nil { + return m.MaxPids + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *DesiredLRPResource) SetMaxPids(value int32) { + if m != nil { + m.MaxPids = value + } +} +func (x *DesiredLRPResource) ToProto() *ProtoDesiredLRPResource { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPResource{ + MemoryMb: x.MemoryMb, + DiskMb: x.DiskMb, + RootFs: x.RootFs, + MaxPids: x.MaxPids, + } + return proto +} + +func (x *ProtoDesiredLRPResource) FromProto() *DesiredLRPResource { + if x == nil { + return nil + } + + copysafe := &DesiredLRPResource{ + MemoryMb: x.MemoryMb, + DiskMb: x.DiskMb, + RootFs: x.RootFs, + MaxPids: x.MaxPids, + } + return copysafe +} + +func DesiredLRPResourceToProtoSlice(values []*DesiredLRPResource) []*ProtoDesiredLRPResource { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPResource, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPResourceFromProtoSlice(values []*ProtoDesiredLRPResource) []*DesiredLRPResource { + if values == nil { + return nil + } + result := make([]*DesiredLRPResource, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRP directly +type DesiredLRP struct { + ProcessGuid string `json:"process_guid"` + Domain string `json:"domain"` + RootFs string `json:"rootfs"` + Instances int32 `json:"instances"` + EnvironmentVariables []*EnvironmentVariable `json:"env"` + Setup *Action `json:"setup,omitempty"` + Action *Action `json:"action,omitempty"` + StartTimeoutMs int64 `json:"start_timeout_ms"` + // Deprecated: marked deprecated in desired_lrp.proto + DeprecatedStartTimeoutS uint32 `json:"deprecated_timeout_ns,omitempty"` + Monitor *Action `json:"monitor,omitempty"` + DiskMb int32 `json:"disk_mb"` + MemoryMb int32 `json:"memory_mb"` + CpuWeight uint32 `json:"cpu_weight"` + Privileged bool `json:"privileged"` + Ports []uint32 `json:"ports,omitempty"` + Routes *Routes `json:"routes,omitempty"` + LogSource string `json:"log_source"` + LogGuid string `json:"log_guid"` + // Deprecated: marked deprecated in desired_lrp.proto + MetricsGuid string `json:"metrics_guid"` + Annotation string `json:"annotation"` + EgressRules []*SecurityGroupRule `json:"egress_rules,omitempty"` + ModificationTag *ModificationTag `json:"modification_tag,omitempty"` + CachedDependencies []*CachedDependency `json:"cached_dependencies,omitempty"` + // Deprecated: marked deprecated in desired_lrp.proto + LegacyDownloadUser string `json:"legacy_download_user,omitempty"` + TrustedSystemCertificatesPath string `json:"trusted_system_certificates_path,omitempty"` + VolumeMounts []*VolumeMount `json:"volume_mounts,omitempty"` + Network *Network `json:"network,omitempty"` + PlacementTags []string `json:"placement_tags,omitempty"` + MaxPids int32 `json:"max_pids"` + CertificateProperties *CertificateProperties `json:"certificate_properties,omitempty"` + ImageUsername string `json:"image_username,omitempty"` + ImagePassword string `json:"image_password,omitempty"` + CheckDefinition *CheckDefinition `json:"check_definition,omitempty"` + ImageLayers []*ImageLayer `json:"image_layers,omitempty"` + MetricTags map[string]*MetricTagValue `json:"metric_tags,omitempty"` + Sidecars []*Sidecar `json:"sidecars,omitempty"` + LogRateLimit *LogRateLimit `json:"log_rate_limit,omitempty"` + VolumeMountedFiles []*File `json:"volume_mounted_files"` +} + +func (this *DesiredLRP) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRP) + if !ok { + that2, ok := that.(DesiredLRP) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ProcessGuid != that1.ProcessGuid { + return false + } + if this.Domain != that1.Domain { + return false + } + if this.RootFs != that1.RootFs { + return false + } + if this.Instances != that1.Instances { + return false + } + if this.EnvironmentVariables == nil { + if that1.EnvironmentVariables != nil { + return false + } + } else if len(this.EnvironmentVariables) != len(that1.EnvironmentVariables) { + return false + } + for i := range this.EnvironmentVariables { + if !this.EnvironmentVariables[i].Equal(that1.EnvironmentVariables[i]) { + return false + } + } + if this.Setup == nil { + if that1.Setup != nil { + return false + } + } else if !this.Setup.Equal(*that1.Setup) { + return false + } + if this.Action == nil { + if that1.Action != nil { + return false + } + } else if !this.Action.Equal(*that1.Action) { + return false + } + if this.StartTimeoutMs != that1.StartTimeoutMs { + return false + } + if this.DeprecatedStartTimeoutS != that1.DeprecatedStartTimeoutS { + return false + } + if this.Monitor == nil { + if that1.Monitor != nil { + return false + } + } else if !this.Monitor.Equal(*that1.Monitor) { + return false + } + if this.DiskMb != that1.DiskMb { + return false + } + if this.MemoryMb != that1.MemoryMb { + return false + } + if this.CpuWeight != that1.CpuWeight { + return false + } + if this.Privileged != that1.Privileged { + return false + } + if this.Ports == nil { + if that1.Ports != nil { + return false + } + } else if len(this.Ports) != len(that1.Ports) { + return false + } + for i := range this.Ports { + if this.Ports[i] != that1.Ports[i] { + return false + } + } + if this.Routes == nil { + if that1.Routes != nil { + return false + } + } else if !this.Routes.Equal(*that1.Routes) { + return false + } + if this.LogSource != that1.LogSource { + return false + } + if this.LogGuid != that1.LogGuid { + return false + } + if this.MetricsGuid != that1.MetricsGuid { + return false + } + if this.Annotation != that1.Annotation { + return false + } + if this.EgressRules == nil { + if that1.EgressRules != nil { + return false + } + } else if len(this.EgressRules) != len(that1.EgressRules) { + return false + } + for i := range this.EgressRules { + if !this.EgressRules[i].Equal(that1.EgressRules[i]) { + return false + } + } + if this.ModificationTag == nil { + if that1.ModificationTag != nil { + return false + } + } else if !this.ModificationTag.Equal(*that1.ModificationTag) { + return false + } + if this.CachedDependencies == nil { + if that1.CachedDependencies != nil { + return false + } + } else if len(this.CachedDependencies) != len(that1.CachedDependencies) { + return false + } + for i := range this.CachedDependencies { + if !this.CachedDependencies[i].Equal(that1.CachedDependencies[i]) { + return false + } + } + if this.LegacyDownloadUser != that1.LegacyDownloadUser { + return false + } + if this.TrustedSystemCertificatesPath != that1.TrustedSystemCertificatesPath { + return false + } + if this.VolumeMounts == nil { + if that1.VolumeMounts != nil { + return false + } + } else if len(this.VolumeMounts) != len(that1.VolumeMounts) { + return false + } + for i := range this.VolumeMounts { + if !this.VolumeMounts[i].Equal(that1.VolumeMounts[i]) { + return false + } + } + if this.Network == nil { + if that1.Network != nil { + return false + } + } else if !this.Network.Equal(*that1.Network) { + return false + } + if this.PlacementTags == nil { + if that1.PlacementTags != nil { + return false + } + } else if len(this.PlacementTags) != len(that1.PlacementTags) { + return false + } + for i := range this.PlacementTags { + if this.PlacementTags[i] != that1.PlacementTags[i] { + return false + } + } + if this.MaxPids != that1.MaxPids { + return false + } + if this.CertificateProperties == nil { + if that1.CertificateProperties != nil { + return false + } + } else if !this.CertificateProperties.Equal(*that1.CertificateProperties) { + return false + } + if this.ImageUsername != that1.ImageUsername { + return false + } + if this.ImagePassword != that1.ImagePassword { + return false + } + if this.CheckDefinition == nil { + if that1.CheckDefinition != nil { + return false + } + } else if !this.CheckDefinition.Equal(*that1.CheckDefinition) { + return false + } + if this.ImageLayers == nil { + if that1.ImageLayers != nil { + return false + } + } else if len(this.ImageLayers) != len(that1.ImageLayers) { + return false + } + for i := range this.ImageLayers { + if !this.ImageLayers[i].Equal(that1.ImageLayers[i]) { + return false + } + } + if this.MetricTags == nil { + if that1.MetricTags != nil { + return false + } + } else if len(this.MetricTags) != len(that1.MetricTags) { + return false + } + for i := range this.MetricTags { + if !this.MetricTags[i].Equal(that1.MetricTags[i]) { + return false + } + } + if this.Sidecars == nil { + if that1.Sidecars != nil { + return false + } + } else if len(this.Sidecars) != len(that1.Sidecars) { + return false + } + for i := range this.Sidecars { + if !this.Sidecars[i].Equal(that1.Sidecars[i]) { + return false + } + } + if this.LogRateLimit == nil { + if that1.LogRateLimit != nil { + return false + } + } else if !this.LogRateLimit.Equal(*that1.LogRateLimit) { + return false + } + if this.VolumeMountedFiles == nil { + if that1.VolumeMountedFiles != nil { + return false + } + } else if len(this.VolumeMountedFiles) != len(that1.VolumeMountedFiles) { + return false + } + for i := range this.VolumeMountedFiles { + if !this.VolumeMountedFiles[i].Equal(that1.VolumeMountedFiles[i]) { + return false + } + } + return true +} +func (m *DesiredLRP) GetProcessGuid() string { + if m != nil { + return m.ProcessGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRP) SetProcessGuid(value string) { + if m != nil { + m.ProcessGuid = value + } +} +func (m *DesiredLRP) GetDomain() string { + if m != nil { + return m.Domain + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRP) SetDomain(value string) { + if m != nil { + m.Domain = value + } +} +func (m *DesiredLRP) GetRootFs() string { + if m != nil { + return m.RootFs + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRP) SetRootFs(value string) { + if m != nil { + m.RootFs = value + } +} +func (m *DesiredLRP) GetInstances() int32 { + if m != nil { + return m.Instances + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *DesiredLRP) SetInstances(value int32) { + if m != nil { + m.Instances = value + } +} +func (m *DesiredLRP) GetEnvironmentVariables() []*EnvironmentVariable { + if m != nil { + return m.EnvironmentVariables + } + return nil +} +func (m *DesiredLRP) SetEnvironmentVariables(value []*EnvironmentVariable) { + if m != nil { + m.EnvironmentVariables = value + } +} +func (m *DesiredLRP) GetSetup() *Action { + if m != nil { + return m.Setup + } + return nil +} +func (m *DesiredLRP) SetSetup(value *Action) { + if m != nil { + m.Setup = value + } +} +func (m *DesiredLRP) GetAction() *Action { + if m != nil { + return m.Action + } + return nil +} +func (m *DesiredLRP) SetAction(value *Action) { + if m != nil { + m.Action = value + } +} +func (m *DesiredLRP) GetStartTimeoutMs() int64 { + if m != nil { + return m.StartTimeoutMs + } + var defaultValue int64 + defaultValue = 0 + return defaultValue +} +func (m *DesiredLRP) SetStartTimeoutMs(value int64) { + if m != nil { + m.StartTimeoutMs = value + } +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRP) GetDeprecatedStartTimeoutS() uint32 { + if m != nil { + return m.DeprecatedStartTimeoutS + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRP) SetDeprecatedStartTimeoutS(value uint32) { + if m != nil { + m.DeprecatedStartTimeoutS = value + } +} +func (m *DesiredLRP) GetMonitor() *Action { + if m != nil { + return m.Monitor + } + return nil +} +func (m *DesiredLRP) SetMonitor(value *Action) { + if m != nil { + m.Monitor = value + } +} +func (m *DesiredLRP) GetDiskMb() int32 { + if m != nil { + return m.DiskMb + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *DesiredLRP) SetDiskMb(value int32) { + if m != nil { + m.DiskMb = value + } +} +func (m *DesiredLRP) GetMemoryMb() int32 { + if m != nil { + return m.MemoryMb + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *DesiredLRP) SetMemoryMb(value int32) { + if m != nil { + m.MemoryMb = value + } +} +func (m *DesiredLRP) GetCpuWeight() uint32 { + if m != nil { + return m.CpuWeight + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} +func (m *DesiredLRP) SetCpuWeight(value uint32) { + if m != nil { + m.CpuWeight = value + } +} +func (m *DesiredLRP) GetPrivileged() bool { + if m != nil { + return m.Privileged + } + var defaultValue bool + defaultValue = false + return defaultValue +} +func (m *DesiredLRP) SetPrivileged(value bool) { + if m != nil { + m.Privileged = value + } +} +func (m *DesiredLRP) GetPorts() []uint32 { + if m != nil { + return m.Ports + } + return nil +} +func (m *DesiredLRP) SetPorts(value []uint32) { + if m != nil { + m.Ports = value + } +} +func (m *DesiredLRP) RoutesExists() bool { + return m != nil && m.Routes != nil +} +func (m *DesiredLRP) GetRoutes() *Routes { + if m != nil && m.Routes != nil { + return m.Routes + } + return nil +} +func (m *DesiredLRP) SetRoutes(value *Routes) { + if m != nil { + m.Routes = value + } +} +func (m *DesiredLRP) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRP) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} +func (m *DesiredLRP) GetLogGuid() string { + if m != nil { + return m.LogGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRP) SetLogGuid(value string) { + if m != nil { + m.LogGuid = value + } +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRP) GetMetricsGuid() string { + if m != nil { + return m.MetricsGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRP) SetMetricsGuid(value string) { + if m != nil { + m.MetricsGuid = value + } +} +func (m *DesiredLRP) GetAnnotation() string { + if m != nil { + return m.Annotation + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRP) SetAnnotation(value string) { + if m != nil { + m.Annotation = value + } +} +func (m *DesiredLRP) GetEgressRules() []*SecurityGroupRule { + if m != nil { + return m.EgressRules + } + return nil +} +func (m *DesiredLRP) SetEgressRules(value []*SecurityGroupRule) { + if m != nil { + m.EgressRules = value + } +} +func (m *DesiredLRP) GetModificationTag() *ModificationTag { + if m != nil { + return m.ModificationTag + } + return nil +} +func (m *DesiredLRP) SetModificationTag(value *ModificationTag) { + if m != nil { + m.ModificationTag = value + } +} +func (m *DesiredLRP) GetCachedDependencies() []*CachedDependency { + if m != nil { + return m.CachedDependencies + } + return nil +} +func (m *DesiredLRP) SetCachedDependencies(value []*CachedDependency) { + if m != nil { + m.CachedDependencies = value + } +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRP) GetLegacyDownloadUser() string { + if m != nil { + return m.LegacyDownloadUser + } + var defaultValue string + defaultValue = "" + return defaultValue +} + +// Deprecated: marked deprecated in desired_lrp.proto +func (m *DesiredLRP) SetLegacyDownloadUser(value string) { + if m != nil { + m.LegacyDownloadUser = value + } +} +func (m *DesiredLRP) GetTrustedSystemCertificatesPath() string { + if m != nil { + return m.TrustedSystemCertificatesPath + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRP) SetTrustedSystemCertificatesPath(value string) { + if m != nil { + m.TrustedSystemCertificatesPath = value + } +} +func (m *DesiredLRP) GetVolumeMounts() []*VolumeMount { + if m != nil { + return m.VolumeMounts + } + return nil +} +func (m *DesiredLRP) SetVolumeMounts(value []*VolumeMount) { + if m != nil { + m.VolumeMounts = value + } +} +func (m *DesiredLRP) GetNetwork() *Network { + if m != nil { + return m.Network + } + return nil +} +func (m *DesiredLRP) SetNetwork(value *Network) { + if m != nil { + m.Network = value + } +} +func (m *DesiredLRP) GetPlacementTags() []string { + if m != nil { + return m.PlacementTags + } + return nil +} +func (m *DesiredLRP) SetPlacementTags(value []string) { + if m != nil { + m.PlacementTags = value + } +} +func (m *DesiredLRP) GetMaxPids() int32 { + if m != nil { + return m.MaxPids + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *DesiredLRP) SetMaxPids(value int32) { + if m != nil { + m.MaxPids = value + } +} +func (m *DesiredLRP) CertificatePropertiesExists() bool { + return m != nil && m.CertificateProperties != nil +} +func (m *DesiredLRP) GetCertificateProperties() *CertificateProperties { + if m != nil && m.CertificateProperties != nil { + return m.CertificateProperties + } + return nil +} +func (m *DesiredLRP) SetCertificateProperties(value *CertificateProperties) { + if m != nil { + m.CertificateProperties = value + } +} +func (m *DesiredLRP) GetImageUsername() string { + if m != nil { + return m.ImageUsername + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRP) SetImageUsername(value string) { + if m != nil { + m.ImageUsername = value + } +} +func (m *DesiredLRP) GetImagePassword() string { + if m != nil { + return m.ImagePassword + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRP) SetImagePassword(value string) { + if m != nil { + m.ImagePassword = value + } +} +func (m *DesiredLRP) GetCheckDefinition() *CheckDefinition { + if m != nil { + return m.CheckDefinition + } + return nil +} +func (m *DesiredLRP) SetCheckDefinition(value *CheckDefinition) { + if m != nil { + m.CheckDefinition = value + } +} +func (m *DesiredLRP) GetImageLayers() []*ImageLayer { + if m != nil { + return m.ImageLayers + } + return nil +} +func (m *DesiredLRP) SetImageLayers(value []*ImageLayer) { + if m != nil { + m.ImageLayers = value + } +} +func (m *DesiredLRP) GetMetricTags() map[string]*MetricTagValue { + if m != nil { + return m.MetricTags + } + return nil +} +func (m *DesiredLRP) SetMetricTags(value map[string]*MetricTagValue) { + if m != nil { + m.MetricTags = value + } +} +func (m *DesiredLRP) GetSidecars() []*Sidecar { + if m != nil { + return m.Sidecars + } + return nil +} +func (m *DesiredLRP) SetSidecars(value []*Sidecar) { + if m != nil { + m.Sidecars = value + } +} +func (m *DesiredLRP) GetLogRateLimit() *LogRateLimit { + if m != nil { + return m.LogRateLimit + } + return nil +} +func (m *DesiredLRP) SetLogRateLimit(value *LogRateLimit) { + if m != nil { + m.LogRateLimit = value + } +} +func (m *DesiredLRP) GetVolumeMountedFiles() []*File { + if m != nil { + return m.VolumeMountedFiles + } + return nil +} +func (m *DesiredLRP) SetVolumeMountedFiles(value []*File) { + if m != nil { + m.VolumeMountedFiles = value + } +} +func (x *DesiredLRP) ToProto() *ProtoDesiredLRP { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRP{ + ProcessGuid: x.ProcessGuid, + Domain: x.Domain, + RootFs: x.RootFs, + Instances: x.Instances, + EnvironmentVariables: EnvironmentVariableToProtoSlice(x.EnvironmentVariables), + Setup: x.Setup.ToProto(), + Action: x.Action.ToProto(), + StartTimeoutMs: x.StartTimeoutMs, + DeprecatedStartTimeoutS: x.DeprecatedStartTimeoutS, + Monitor: x.Monitor.ToProto(), + DiskMb: x.DiskMb, + MemoryMb: x.MemoryMb, + CpuWeight: x.CpuWeight, + Privileged: x.Privileged, + Ports: x.Ports, + Routes: x.Routes.ToProto(), + LogSource: x.LogSource, + LogGuid: x.LogGuid, + MetricsGuid: x.MetricsGuid, + Annotation: x.Annotation, + EgressRules: SecurityGroupRuleToProtoSlice(x.EgressRules), + ModificationTag: x.ModificationTag.ToProto(), + CachedDependencies: CachedDependencyToProtoSlice(x.CachedDependencies), + LegacyDownloadUser: x.LegacyDownloadUser, + TrustedSystemCertificatesPath: x.TrustedSystemCertificatesPath, + VolumeMounts: VolumeMountToProtoSlice(x.VolumeMounts), + Network: x.Network.ToProto(), + PlacementTags: x.PlacementTags, + MaxPids: x.MaxPids, + CertificateProperties: x.CertificateProperties.ToProto(), + ImageUsername: x.ImageUsername, + ImagePassword: x.ImagePassword, + CheckDefinition: x.CheckDefinition.ToProto(), + ImageLayers: ImageLayerToProtoSlice(x.ImageLayers), + MetricTags: DesiredLRPMetricTagsToProtoMap(x.MetricTags), + Sidecars: SidecarToProtoSlice(x.Sidecars), + LogRateLimit: x.LogRateLimit.ToProto(), + VolumeMountedFiles: FileToProtoSlice(x.VolumeMountedFiles), + } + return proto +} + +func (x *ProtoDesiredLRP) FromProto() *DesiredLRP { + if x == nil { + return nil + } + + copysafe := &DesiredLRP{ + ProcessGuid: x.ProcessGuid, + Domain: x.Domain, + RootFs: x.RootFs, + Instances: x.Instances, + EnvironmentVariables: EnvironmentVariableFromProtoSlice(x.EnvironmentVariables), + Setup: x.Setup.FromProto(), + Action: x.Action.FromProto(), + StartTimeoutMs: x.StartTimeoutMs, + DeprecatedStartTimeoutS: x.DeprecatedStartTimeoutS, + Monitor: x.Monitor.FromProto(), + DiskMb: x.DiskMb, + MemoryMb: x.MemoryMb, + CpuWeight: x.CpuWeight, + Privileged: x.Privileged, + Ports: x.Ports, + Routes: x.Routes.FromProto(), + LogSource: x.LogSource, + LogGuid: x.LogGuid, + MetricsGuid: x.MetricsGuid, + Annotation: x.Annotation, + EgressRules: SecurityGroupRuleFromProtoSlice(x.EgressRules), + ModificationTag: x.ModificationTag.FromProto(), + CachedDependencies: CachedDependencyFromProtoSlice(x.CachedDependencies), + LegacyDownloadUser: x.LegacyDownloadUser, + TrustedSystemCertificatesPath: x.TrustedSystemCertificatesPath, + VolumeMounts: VolumeMountFromProtoSlice(x.VolumeMounts), + Network: x.Network.FromProto(), + PlacementTags: x.PlacementTags, + MaxPids: x.MaxPids, + CertificateProperties: x.CertificateProperties.FromProto(), + ImageUsername: x.ImageUsername, + ImagePassword: x.ImagePassword, + CheckDefinition: x.CheckDefinition.FromProto(), + ImageLayers: ImageLayerFromProtoSlice(x.ImageLayers), + MetricTags: DesiredLRPMetricTagsFromProtoMap(x.MetricTags), + Sidecars: SidecarFromProtoSlice(x.Sidecars), + LogRateLimit: x.LogRateLimit.FromProto(), + VolumeMountedFiles: FileFromProtoSlice(x.VolumeMountedFiles), + } + return copysafe +} + +func DesiredLRPToProtoSlice(values []*DesiredLRP) []*ProtoDesiredLRP { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRP, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPMetricTagsToProtoMap(values map[string]*MetricTagValue) map[string]*ProtoMetricTagValue { + if values == nil { + return nil + } + result := make(map[string]*ProtoMetricTagValue, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPFromProtoSlice(values []*ProtoDesiredLRP) []*DesiredLRP { + if values == nil { + return nil + } + result := make([]*DesiredLRP, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +func DesiredLRPMetricTagsFromProtoMap(values map[string]*ProtoMetricTagValue) map[string]*MetricTagValue { + if values == nil { + return nil + } + result := make(map[string]*MetricTagValue, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/desired_lrp_requests.go b/models/desired_lrp_requests.go index 92030fec..626f53a1 100644 --- a/models/desired_lrp_requests.go +++ b/models/desired_lrp_requests.go @@ -1,9 +1,17 @@ package models +func (request *ProtoDesiredLRPsRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *DesiredLRPsRequest) Validate() error { return nil } +func (request *ProtoDesiredLRPByProcessGuidRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *DesiredLRPByProcessGuidRequest) Validate() error { var validationError ValidationError @@ -18,6 +26,10 @@ func (request *DesiredLRPByProcessGuidRequest) Validate() error { return nil } +func (request *ProtoDesireLRPRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *DesireLRPRequest) Validate() error { var validationError ValidationError @@ -34,6 +46,10 @@ func (request *DesireLRPRequest) Validate() error { return nil } +func (request *ProtoUpdateDesiredLRPRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *UpdateDesiredLRPRequest) Validate() error { var validationError ValidationError @@ -54,6 +70,10 @@ func (request *UpdateDesiredLRPRequest) Validate() error { return nil } +func (request *ProtoRemoveDesiredLRPRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *RemoveDesiredLRPRequest) Validate() error { var validationError ValidationError diff --git a/models/desired_lrp_requests.pb.go b/models/desired_lrp_requests.pb.go index 703679ff..93d40094 100644 --- a/models/desired_lrp_requests.pb.go +++ b/models/desired_lrp_requests.pb.go @@ -1,2806 +1,617 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: desired_lrp_requests.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type DesiredLRPLifecycleResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *DesiredLRPLifecycleResponse) Reset() { *m = DesiredLRPLifecycleResponse{} } -func (*DesiredLRPLifecycleResponse) ProtoMessage() {} -func (*DesiredLRPLifecycleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7235cc1a84e38c85, []int{0} -} -func (m *DesiredLRPLifecycleResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DesiredLRPLifecycleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPLifecycleResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DesiredLRPLifecycleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPLifecycleResponse.Merge(m, src) -} -func (m *DesiredLRPLifecycleResponse) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRPLifecycleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPLifecycleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DesiredLRPLifecycleResponse proto.InternalMessageInfo +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -func (m *DesiredLRPLifecycleResponse) GetError() *Error { - if m != nil { - return m.Error - } - return nil +type ProtoDesiredLRPLifecycleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -type DesiredLRPsResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - DesiredLrps []*DesiredLRP `protobuf:"bytes,2,rep,name=desired_lrps,json=desiredLrps,proto3" json:"desired_lrps,omitempty"` +func (x *ProtoDesiredLRPLifecycleResponse) Reset() { + *x = ProtoDesiredLRPLifecycleResponse{} + mi := &file_desired_lrp_requests_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DesiredLRPsResponse) Reset() { *m = DesiredLRPsResponse{} } -func (*DesiredLRPsResponse) ProtoMessage() {} -func (*DesiredLRPsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7235cc1a84e38c85, []int{1} -} -func (m *DesiredLRPsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (x *ProtoDesiredLRPLifecycleResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DesiredLRPsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoDesiredLRPLifecycleResponse) ProtoMessage() {} + +func (x *ProtoDesiredLRPLifecycleResponse) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_requests_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *DesiredLRPsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPsResponse.Merge(m, src) -} -func (m *DesiredLRPsResponse) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRPsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DesiredLRPsResponse proto.InternalMessageInfo -func (m *DesiredLRPsResponse) GetError() *Error { - if m != nil { - return m.Error - } - return nil +// Deprecated: Use ProtoDesiredLRPLifecycleResponse.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPLifecycleResponse) Descriptor() ([]byte, []int) { + return file_desired_lrp_requests_proto_rawDescGZIP(), []int{0} } -func (m *DesiredLRPsResponse) GetDesiredLrps() []*DesiredLRP { - if m != nil { - return m.DesiredLrps +func (x *ProtoDesiredLRPLifecycleResponse) GetError() *ProtoError { + if x != nil { + return x.Error } return nil } -type DesiredLRPsRequest struct { - Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain"` - ProcessGuids []string `protobuf:"bytes,2,rep,name=process_guids,json=processGuids,proto3" json:"process_guids,omitempty"` +type ProtoDesiredLRPsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + DesiredLrps []*ProtoDesiredLRP `protobuf:"bytes,2,rep,name=desired_lrps,proto3" json:"desired_lrps,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DesiredLRPsRequest) Reset() { *m = DesiredLRPsRequest{} } -func (*DesiredLRPsRequest) ProtoMessage() {} -func (*DesiredLRPsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7235cc1a84e38c85, []int{2} -} -func (m *DesiredLRPsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DesiredLRPsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DesiredLRPsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPsRequest.Merge(m, src) -} -func (m *DesiredLRPsRequest) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRPsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPsRequest.DiscardUnknown(m) +func (x *ProtoDesiredLRPsResponse) Reset() { + *x = ProtoDesiredLRPsResponse{} + mi := &file_desired_lrp_requests_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -var xxx_messageInfo_DesiredLRPsRequest proto.InternalMessageInfo - -func (m *DesiredLRPsRequest) GetDomain() string { - if m != nil { - return m.Domain - } - return "" +func (x *ProtoDesiredLRPsResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DesiredLRPsRequest) GetProcessGuids() []string { - if m != nil { - return m.ProcessGuids - } - return nil -} - -type DesiredLRPResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - DesiredLrp *DesiredLRP `protobuf:"bytes,2,opt,name=desired_lrp,json=desiredLrp,proto3" json:"desired_lrp,omitempty"` -} +func (*ProtoDesiredLRPsResponse) ProtoMessage() {} -func (m *DesiredLRPResponse) Reset() { *m = DesiredLRPResponse{} } -func (*DesiredLRPResponse) ProtoMessage() {} -func (*DesiredLRPResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7235cc1a84e38c85, []int{3} -} -func (m *DesiredLRPResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DesiredLRPResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoDesiredLRPsResponse) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_requests_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *DesiredLRPResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPResponse.Merge(m, src) -} -func (m *DesiredLRPResponse) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRPResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPResponse.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_DesiredLRPResponse proto.InternalMessageInfo +// Deprecated: Use ProtoDesiredLRPsResponse.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPsResponse) Descriptor() ([]byte, []int) { + return file_desired_lrp_requests_proto_rawDescGZIP(), []int{1} +} -func (m *DesiredLRPResponse) GetError() *Error { - if m != nil { - return m.Error +func (x *ProtoDesiredLRPsResponse) GetError() *ProtoError { + if x != nil { + return x.Error } return nil } -func (m *DesiredLRPResponse) GetDesiredLrp() *DesiredLRP { - if m != nil { - return m.DesiredLrp +func (x *ProtoDesiredLRPsResponse) GetDesiredLrps() []*ProtoDesiredLRP { + if x != nil { + return x.DesiredLrps } return nil } -type DesiredLRPSchedulingInfosResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - DesiredLrpSchedulingInfos []*DesiredLRPSchedulingInfo `protobuf:"bytes,2,rep,name=desired_lrp_scheduling_infos,json=desiredLrpSchedulingInfos,proto3" json:"desired_lrp_scheduling_infos,omitempty"` -} - -func (m *DesiredLRPSchedulingInfosResponse) Reset() { *m = DesiredLRPSchedulingInfosResponse{} } -func (*DesiredLRPSchedulingInfosResponse) ProtoMessage() {} -func (*DesiredLRPSchedulingInfosResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7235cc1a84e38c85, []int{4} -} -func (m *DesiredLRPSchedulingInfosResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DesiredLRPSchedulingInfosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPSchedulingInfosResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DesiredLRPSchedulingInfosResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPSchedulingInfosResponse.Merge(m, src) -} -func (m *DesiredLRPSchedulingInfosResponse) XXX_Size() int { - return m.Size() +type ProtoDesiredLRPsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` + ProcessGuids []string `protobuf:"bytes,2,rep,name=process_guids,proto3" json:"process_guids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DesiredLRPSchedulingInfosResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPSchedulingInfosResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DesiredLRPSchedulingInfosResponse proto.InternalMessageInfo -func (m *DesiredLRPSchedulingInfosResponse) GetError() *Error { - if m != nil { - return m.Error - } - return nil +func (x *ProtoDesiredLRPsRequest) Reset() { + *x = ProtoDesiredLRPsRequest{} + mi := &file_desired_lrp_requests_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DesiredLRPSchedulingInfosResponse) GetDesiredLrpSchedulingInfos() []*DesiredLRPSchedulingInfo { - if m != nil { - return m.DesiredLrpSchedulingInfos - } - return nil +func (x *ProtoDesiredLRPsRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -type DesiredLRPSchedulingInfoByProcessGuidResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - DesiredLrpSchedulingInfo *DesiredLRPSchedulingInfo `protobuf:"bytes,2,opt,name=desired_lrp_scheduling_info,json=desiredLrpSchedulingInfo,proto3" json:"desired_lrp_scheduling_info,omitempty"` -} +func (*ProtoDesiredLRPsRequest) ProtoMessage() {} -func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) Reset() { - *m = DesiredLRPSchedulingInfoByProcessGuidResponse{} -} -func (*DesiredLRPSchedulingInfoByProcessGuidResponse) ProtoMessage() {} -func (*DesiredLRPSchedulingInfoByProcessGuidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7235cc1a84e38c85, []int{5} -} -func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPSchedulingInfoByProcessGuidResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoDesiredLRPsRequest) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_requests_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPSchedulingInfoByProcessGuidResponse.Merge(m, src) -} -func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPSchedulingInfoByProcessGuidResponse.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_DesiredLRPSchedulingInfoByProcessGuidResponse proto.InternalMessageInfo +// Deprecated: Use ProtoDesiredLRPsRequest.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPsRequest) Descriptor() ([]byte, []int) { + return file_desired_lrp_requests_proto_rawDescGZIP(), []int{2} +} -func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) GetError() *Error { - if m != nil { - return m.Error +func (x *ProtoDesiredLRPsRequest) GetDomain() string { + if x != nil { + return x.Domain } - return nil + return "" } -func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) GetDesiredLrpSchedulingInfo() *DesiredLRPSchedulingInfo { - if m != nil { - return m.DesiredLrpSchedulingInfo +func (x *ProtoDesiredLRPsRequest) GetProcessGuids() []string { + if x != nil { + return x.ProcessGuids } return nil } -type DesiredLRPByProcessGuidRequest struct { - ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,json=processGuid,proto3" json:"process_guid"` +type ProtoDesiredLRPResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + DesiredLrp *ProtoDesiredLRP `protobuf:"bytes,2,opt,name=desired_lrp,proto3" json:"desired_lrp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DesiredLRPByProcessGuidRequest) Reset() { *m = DesiredLRPByProcessGuidRequest{} } -func (*DesiredLRPByProcessGuidRequest) ProtoMessage() {} -func (*DesiredLRPByProcessGuidRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7235cc1a84e38c85, []int{6} -} -func (m *DesiredLRPByProcessGuidRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DesiredLRPByProcessGuidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPByProcessGuidRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DesiredLRPByProcessGuidRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPByProcessGuidRequest.Merge(m, src) -} -func (m *DesiredLRPByProcessGuidRequest) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRPByProcessGuidRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPByProcessGuidRequest.DiscardUnknown(m) +func (x *ProtoDesiredLRPResponse) Reset() { + *x = ProtoDesiredLRPResponse{} + mi := &file_desired_lrp_requests_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -var xxx_messageInfo_DesiredLRPByProcessGuidRequest proto.InternalMessageInfo - -func (m *DesiredLRPByProcessGuidRequest) GetProcessGuid() string { - if m != nil { - return m.ProcessGuid - } - return "" +func (x *ProtoDesiredLRPResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -type DesireLRPRequest struct { - DesiredLrp *DesiredLRP `protobuf:"bytes,1,opt,name=desired_lrp,json=desiredLrp,proto3" json:"desired_lrp,omitempty"` -} +func (*ProtoDesiredLRPResponse) ProtoMessage() {} -func (m *DesireLRPRequest) Reset() { *m = DesireLRPRequest{} } -func (*DesireLRPRequest) ProtoMessage() {} -func (*DesireLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7235cc1a84e38c85, []int{7} -} -func (m *DesireLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DesireLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesireLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoDesiredLRPResponse) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_requests_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil - } -} -func (m *DesireLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesireLRPRequest.Merge(m, src) -} -func (m *DesireLRPRequest) XXX_Size() int { - return m.Size() -} -func (m *DesireLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DesireLRPRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DesireLRPRequest proto.InternalMessageInfo - -func (m *DesireLRPRequest) GetDesiredLrp() *DesiredLRP { - if m != nil { - return m.DesiredLrp + return ms } - return nil + return mi.MessageOf(x) } -type UpdateDesiredLRPRequest struct { - ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,json=processGuid,proto3" json:"process_guid"` - Update *DesiredLRPUpdate `protobuf:"bytes,2,opt,name=update,proto3" json:"update,omitempty"` -} - -func (m *UpdateDesiredLRPRequest) Reset() { *m = UpdateDesiredLRPRequest{} } -func (*UpdateDesiredLRPRequest) ProtoMessage() {} -func (*UpdateDesiredLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7235cc1a84e38c85, []int{8} -} -func (m *UpdateDesiredLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateDesiredLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateDesiredLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateDesiredLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateDesiredLRPRequest.Merge(m, src) -} -func (m *UpdateDesiredLRPRequest) XXX_Size() int { - return m.Size() +// Deprecated: Use ProtoDesiredLRPResponse.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPResponse) Descriptor() ([]byte, []int) { + return file_desired_lrp_requests_proto_rawDescGZIP(), []int{3} } -func (m *UpdateDesiredLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateDesiredLRPRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateDesiredLRPRequest proto.InternalMessageInfo -func (m *UpdateDesiredLRPRequest) GetProcessGuid() string { - if m != nil { - return m.ProcessGuid +func (x *ProtoDesiredLRPResponse) GetError() *ProtoError { + if x != nil { + return x.Error } - return "" + return nil } -func (m *UpdateDesiredLRPRequest) GetUpdate() *DesiredLRPUpdate { - if m != nil { - return m.Update +func (x *ProtoDesiredLRPResponse) GetDesiredLrp() *ProtoDesiredLRP { + if x != nil { + return x.DesiredLrp } return nil } -type RemoveDesiredLRPRequest struct { - ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,json=processGuid,proto3" json:"process_guid"` +type ProtoDesiredLRPSchedulingInfosResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + DesiredLrpSchedulingInfos []*ProtoDesiredLRPSchedulingInfo `protobuf:"bytes,2,rep,name=desired_lrp_scheduling_infos,proto3" json:"desired_lrp_scheduling_infos,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *RemoveDesiredLRPRequest) Reset() { *m = RemoveDesiredLRPRequest{} } -func (*RemoveDesiredLRPRequest) ProtoMessage() {} -func (*RemoveDesiredLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7235cc1a84e38c85, []int{9} -} -func (m *RemoveDesiredLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveDesiredLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveDesiredLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveDesiredLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveDesiredLRPRequest.Merge(m, src) +func (x *ProtoDesiredLRPSchedulingInfosResponse) Reset() { + *x = ProtoDesiredLRPSchedulingInfosResponse{} + mi := &file_desired_lrp_requests_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *RemoveDesiredLRPRequest) XXX_Size() int { - return m.Size() -} -func (m *RemoveDesiredLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveDesiredLRPRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveDesiredLRPRequest proto.InternalMessageInfo -func (m *RemoveDesiredLRPRequest) GetProcessGuid() string { - if m != nil { - return m.ProcessGuid - } - return "" +func (x *ProtoDesiredLRPSchedulingInfosResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func init() { - proto.RegisterType((*DesiredLRPLifecycleResponse)(nil), "models.DesiredLRPLifecycleResponse") - proto.RegisterType((*DesiredLRPsResponse)(nil), "models.DesiredLRPsResponse") - proto.RegisterType((*DesiredLRPsRequest)(nil), "models.DesiredLRPsRequest") - proto.RegisterType((*DesiredLRPResponse)(nil), "models.DesiredLRPResponse") - proto.RegisterType((*DesiredLRPSchedulingInfosResponse)(nil), "models.DesiredLRPSchedulingInfosResponse") - proto.RegisterType((*DesiredLRPSchedulingInfoByProcessGuidResponse)(nil), "models.DesiredLRPSchedulingInfoByProcessGuidResponse") - proto.RegisterType((*DesiredLRPByProcessGuidRequest)(nil), "models.DesiredLRPByProcessGuidRequest") - proto.RegisterType((*DesireLRPRequest)(nil), "models.DesireLRPRequest") - proto.RegisterType((*UpdateDesiredLRPRequest)(nil), "models.UpdateDesiredLRPRequest") - proto.RegisterType((*RemoveDesiredLRPRequest)(nil), "models.RemoveDesiredLRPRequest") -} - -func init() { proto.RegisterFile("desired_lrp_requests.proto", fileDescriptor_7235cc1a84e38c85) } - -var fileDescriptor_7235cc1a84e38c85 = []byte{ - // 493 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4f, 0x6b, 0x13, 0x41, - 0x18, 0xc6, 0x77, 0x2a, 0x06, 0xfa, 0x6e, 0x0a, 0x75, 0x3c, 0x74, 0x4d, 0x65, 0x1a, 0xa7, 0x97, - 0x5e, 0x9a, 0x4a, 0xa3, 0x5f, 0x20, 0x28, 0x45, 0x08, 0x52, 0x46, 0x7a, 0x94, 0x25, 0xd9, 0x9d, - 0x6c, 0x17, 0x92, 0x9d, 0xed, 0x4c, 0x56, 0xe8, 0xad, 0x1f, 0xc1, 0x8f, 0x21, 0x78, 0xf6, 0x3b, - 0x78, 0xcc, 0xb1, 0xa7, 0x62, 0x36, 0x17, 0xe9, 0xa9, 0x1f, 0x41, 0x32, 0x33, 0x75, 0x27, 0xad, - 0x51, 0x23, 0x9e, 0x92, 0x79, 0xff, 0x3c, 0xef, 0xef, 0x7d, 0x79, 0x58, 0x68, 0xc4, 0x5c, 0xa5, - 0x92, 0xc7, 0xe1, 0x50, 0xe6, 0xa1, 0xe4, 0x67, 0x05, 0x57, 0x63, 0xd5, 0xca, 0xa5, 0x18, 0x0b, - 0x5c, 0x1b, 0x89, 0x98, 0x0f, 0x55, 0x63, 0x3f, 0x49, 0xc7, 0xa7, 0x45, 0xbf, 0x15, 0x89, 0xd1, - 0x41, 0x22, 0x12, 0x71, 0xa0, 0xd3, 0xfd, 0x62, 0xa0, 0x5f, 0xfa, 0xa1, 0xff, 0x99, 0xb6, 0xc6, - 0x23, 0x47, 0xd2, 0x86, 0x7c, 0x2e, 0xa5, 0x90, 0xe6, 0x41, 0x3b, 0xb0, 0xfd, 0xca, 0x54, 0x74, - 0xd9, 0x71, 0x37, 0x1d, 0xf0, 0xe8, 0x3c, 0x1a, 0x72, 0xc6, 0x55, 0x2e, 0x32, 0xc5, 0xf1, 0x2e, - 0x3c, 0xd4, 0xd5, 0x01, 0x6a, 0xa2, 0x3d, 0xff, 0x70, 0xa3, 0x65, 0x28, 0x5a, 0xaf, 0xe7, 0x41, - 0x66, 0x72, 0xf4, 0x0c, 0x1e, 0x57, 0x1a, 0x6a, 0xa5, 0x5e, 0xfc, 0x12, 0xea, 0x0e, 0xa1, 0x0a, - 0xd6, 0x9a, 0x0f, 0xf6, 0xfc, 0x43, 0x7c, 0x5b, 0x5b, 0xe9, 0x32, 0xdf, 0xd6, 0x75, 0x65, 0xae, - 0xe8, 0x7b, 0xc0, 0x0b, 0x23, 0xf5, 0xa9, 0x30, 0x85, 0x5a, 0x2c, 0x46, 0xbd, 0x34, 0xd3, 0x23, - 0xd7, 0x3b, 0x70, 0x7d, 0xb5, 0x63, 0x23, 0xcc, 0xfe, 0xe2, 0x5d, 0xd8, 0xc8, 0xa5, 0x88, 0xb8, - 0x52, 0x61, 0x52, 0xa4, 0xb1, 0x99, 0xb8, 0xce, 0xea, 0x36, 0x78, 0x34, 0x8f, 0xd1, 0xcc, 0x95, - 0x5f, 0x6d, 0xa1, 0x36, 0xf8, 0xce, 0x42, 0xc1, 0x9a, 0x2e, 0xfd, 0xd5, 0x3e, 0x50, 0xed, 0x43, - 0x3f, 0x23, 0x78, 0x56, 0xa5, 0xde, 0x45, 0xa7, 0x3c, 0x2e, 0x86, 0x69, 0x96, 0xbc, 0xc9, 0x06, - 0x62, 0xc5, 0x83, 0xf6, 0xe0, 0xa9, 0xeb, 0x22, 0xf5, 0x53, 0x2b, 0x4c, 0xe7, 0x62, 0xf6, 0xc0, - 0xcd, 0xfb, 0x40, 0x8b, 0x53, 0xd9, 0x93, 0x0a, 0xef, 0x0e, 0x0f, 0xfd, 0x82, 0x60, 0x7f, 0x59, - 0x5f, 0xe7, 0xfc, 0xb8, 0x3a, 0xe4, 0x6a, 0xe4, 0x21, 0x6c, 0xff, 0x86, 0xdc, 0x5e, 0xf2, 0xcf, - 0xe0, 0xc1, 0x32, 0x70, 0x7a, 0x02, 0xa4, 0xea, 0xba, 0x03, 0x6a, 0x0c, 0xd4, 0x86, 0xba, 0x6b, - 0x0e, 0x6b, 0xa3, 0xcd, 0xeb, 0xab, 0x9d, 0x85, 0x38, 0xf3, 0x1d, 0xb7, 0xd0, 0x23, 0xd8, 0x34, - 0xb2, 0xda, 0x2b, 0xb7, 0x42, 0x0b, 0x2e, 0x40, 0x7f, 0xe5, 0x82, 0x0b, 0x04, 0x5b, 0x27, 0x79, - 0xdc, 0x1b, 0x73, 0xd7, 0x7c, 0xff, 0x4e, 0x86, 0x9f, 0x43, 0xad, 0xd0, 0x7a, 0xf6, 0x78, 0xc1, - 0x7d, 0x00, 0x33, 0x8f, 0xd9, 0x3a, 0xfa, 0x16, 0xb6, 0x18, 0x1f, 0x89, 0x0f, 0xff, 0x89, 0xa0, - 0xf3, 0x62, 0x32, 0x25, 0xde, 0xe5, 0x94, 0x78, 0x37, 0x53, 0x82, 0x2e, 0x4a, 0x82, 0x3e, 0x95, - 0x04, 0x7d, 0x2d, 0x09, 0x9a, 0x94, 0x04, 0x7d, 0x2b, 0x09, 0xfa, 0x5e, 0x12, 0xef, 0xa6, 0x24, - 0xe8, 0xe3, 0x8c, 0x78, 0x93, 0x19, 0xf1, 0x2e, 0x67, 0xc4, 0xeb, 0xd7, 0xf4, 0xb7, 0xa9, 0xfd, - 0x23, 0x00, 0x00, 0xff, 0xff, 0xca, 0x08, 0x89, 0xe8, 0x10, 0x05, 0x00, 0x00, -} - -func (this *DesiredLRPLifecycleResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoDesiredLRPSchedulingInfosResponse) ProtoMessage() {} - that1, ok := that.(*DesiredLRPLifecycleResponse) - if !ok { - that2, ok := that.(DesiredLRPLifecycleResponse) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoDesiredLRPSchedulingInfosResponse) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_requests_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Error.Equal(that1.Error) { - return false - } - return true + return mi.MessageOf(x) } -func (this *DesiredLRPsResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*DesiredLRPsResponse) - if !ok { - that2, ok := that.(DesiredLRPsResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Error.Equal(that1.Error) { - return false - } - if len(this.DesiredLrps) != len(that1.DesiredLrps) { - return false - } - for i := range this.DesiredLrps { - if !this.DesiredLrps[i].Equal(that1.DesiredLrps[i]) { - return false - } - } - return true -} -func (this *DesiredLRPsRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DesiredLRPsRequest) - if !ok { - that2, ok := that.(DesiredLRPsRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Domain != that1.Domain { - return false - } - if len(this.ProcessGuids) != len(that1.ProcessGuids) { - return false - } - for i := range this.ProcessGuids { - if this.ProcessGuids[i] != that1.ProcessGuids[i] { - return false - } - } - return true -} -func (this *DesiredLRPResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DesiredLRPResponse) - if !ok { - that2, ok := that.(DesiredLRPResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Error.Equal(that1.Error) { - return false - } - if !this.DesiredLrp.Equal(that1.DesiredLrp) { - return false - } - return true +// Deprecated: Use ProtoDesiredLRPSchedulingInfosResponse.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPSchedulingInfosResponse) Descriptor() ([]byte, []int) { + return file_desired_lrp_requests_proto_rawDescGZIP(), []int{4} } -func (this *DesiredLRPSchedulingInfosResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*DesiredLRPSchedulingInfosResponse) - if !ok { - that2, ok := that.(DesiredLRPSchedulingInfosResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Error.Equal(that1.Error) { - return false - } - if len(this.DesiredLrpSchedulingInfos) != len(that1.DesiredLrpSchedulingInfos) { - return false +func (x *ProtoDesiredLRPSchedulingInfosResponse) GetError() *ProtoError { + if x != nil { + return x.Error } - for i := range this.DesiredLrpSchedulingInfos { - if !this.DesiredLrpSchedulingInfos[i].Equal(that1.DesiredLrpSchedulingInfos[i]) { - return false - } - } - return true + return nil } -func (this *DesiredLRPSchedulingInfoByProcessGuidResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*DesiredLRPSchedulingInfoByProcessGuidResponse) - if !ok { - that2, ok := that.(DesiredLRPSchedulingInfoByProcessGuidResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false +func (x *ProtoDesiredLRPSchedulingInfosResponse) GetDesiredLrpSchedulingInfos() []*ProtoDesiredLRPSchedulingInfo { + if x != nil { + return x.DesiredLrpSchedulingInfos } - if !this.Error.Equal(that1.Error) { - return false - } - if !this.DesiredLrpSchedulingInfo.Equal(that1.DesiredLrpSchedulingInfo) { - return false - } - return true + return nil } -func (this *DesiredLRPByProcessGuidRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*DesiredLRPByProcessGuidRequest) - if !ok { - that2, ok := that.(DesiredLRPByProcessGuidRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProcessGuid != that1.ProcessGuid { - return false - } - return true +type ProtoDesiredLRPSchedulingInfoByProcessGuidResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + DesiredLrpSchedulingInfo *ProtoDesiredLRPSchedulingInfo `protobuf:"bytes,2,opt,name=desired_lrp_scheduling_info,proto3" json:"desired_lrp_scheduling_info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (this *DesireLRPRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*DesireLRPRequest) - if !ok { - that2, ok := that.(DesireLRPRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.DesiredLrp.Equal(that1.DesiredLrp) { - return false - } - return true +func (x *ProtoDesiredLRPSchedulingInfoByProcessGuidResponse) Reset() { + *x = ProtoDesiredLRPSchedulingInfoByProcessGuidResponse{} + mi := &file_desired_lrp_requests_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (this *UpdateDesiredLRPRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*UpdateDesiredLRPRequest) - if !ok { - that2, ok := that.(UpdateDesiredLRPRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProcessGuid != that1.ProcessGuid { - return false - } - if !this.Update.Equal(that1.Update) { - return false - } - return true +func (x *ProtoDesiredLRPSchedulingInfoByProcessGuidResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *RemoveDesiredLRPRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*RemoveDesiredLRPRequest) - if !ok { - that2, ok := that.(RemoveDesiredLRPRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProcessGuid != that1.ProcessGuid { - return false - } - return true -} -func (this *DesiredLRPLifecycleResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.DesiredLRPLifecycleResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRPsResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.DesiredLRPsResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - if this.DesiredLrps != nil { - s = append(s, "DesiredLrps: "+fmt.Sprintf("%#v", this.DesiredLrps)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRPsRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.DesiredLRPsRequest{") - s = append(s, "Domain: "+fmt.Sprintf("%#v", this.Domain)+",\n") - s = append(s, "ProcessGuids: "+fmt.Sprintf("%#v", this.ProcessGuids)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRPResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.DesiredLRPResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - if this.DesiredLrp != nil { - s = append(s, "DesiredLrp: "+fmt.Sprintf("%#v", this.DesiredLrp)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRPSchedulingInfosResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.DesiredLRPSchedulingInfosResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - if this.DesiredLrpSchedulingInfos != nil { - s = append(s, "DesiredLrpSchedulingInfos: "+fmt.Sprintf("%#v", this.DesiredLrpSchedulingInfos)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRPSchedulingInfoByProcessGuidResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.DesiredLRPSchedulingInfoByProcessGuidResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - if this.DesiredLrpSchedulingInfo != nil { - s = append(s, "DesiredLrpSchedulingInfo: "+fmt.Sprintf("%#v", this.DesiredLrpSchedulingInfo)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRPByProcessGuidRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.DesiredLRPByProcessGuidRequest{") - s = append(s, "ProcessGuid: "+fmt.Sprintf("%#v", this.ProcessGuid)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesireLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.DesireLRPRequest{") - if this.DesiredLrp != nil { - s = append(s, "DesiredLrp: "+fmt.Sprintf("%#v", this.DesiredLrp)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UpdateDesiredLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.UpdateDesiredLRPRequest{") - s = append(s, "ProcessGuid: "+fmt.Sprintf("%#v", this.ProcessGuid)+",\n") - if this.Update != nil { - s = append(s, "Update: "+fmt.Sprintf("%#v", this.Update)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RemoveDesiredLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.RemoveDesiredLRPRequest{") - s = append(s, "ProcessGuid: "+fmt.Sprintf("%#v", this.ProcessGuid)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringDesiredLrpRequests(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *DesiredLRPLifecycleResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRPLifecycleResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPLifecycleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} +func (*ProtoDesiredLRPSchedulingInfoByProcessGuidResponse) ProtoMessage() {} -func (m *DesiredLRPsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRPsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DesiredLrps) > 0 { - for iNdEx := len(m.DesiredLrps) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DesiredLrps[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func (x *ProtoDesiredLRPSchedulingInfoByProcessGuidResponse) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_requests_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *DesiredLRPsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRPsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProcessGuids) > 0 { - for iNdEx := len(m.ProcessGuids) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ProcessGuids[iNdEx]) - copy(dAtA[i:], m.ProcessGuids[iNdEx]) - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(len(m.ProcessGuids[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Domain) > 0 { - i -= len(m.Domain) - copy(dAtA[i:], m.Domain) - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(len(m.Domain))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +// Deprecated: Use ProtoDesiredLRPSchedulingInfoByProcessGuidResponse.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPSchedulingInfoByProcessGuidResponse) Descriptor() ([]byte, []int) { + return file_desired_lrp_requests_proto_rawDescGZIP(), []int{5} } -func (m *DesiredLRPResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRPResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DesiredLrp != nil { - { - size, err := m.DesiredLrp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func (x *ProtoDesiredLRPSchedulingInfoByProcessGuidResponse) GetError() *ProtoError { + if x != nil { + return x.Error } - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return nil } -func (m *DesiredLRPSchedulingInfosResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoDesiredLRPSchedulingInfoByProcessGuidResponse) GetDesiredLrpSchedulingInfo() *ProtoDesiredLRPSchedulingInfo { + if x != nil { + return x.DesiredLrpSchedulingInfo } - return dAtA[:n], nil -} - -func (m *DesiredLRPSchedulingInfosResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPSchedulingInfosResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DesiredLrpSchedulingInfos) > 0 { - for iNdEx := len(m.DesiredLrpSchedulingInfos) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DesiredLrpSchedulingInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return nil } -func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DesiredLrpSchedulingInfo != nil { - { - size, err := m.DesiredLrpSchedulingInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +type ProtoDesiredLRPByProcessGuidRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,proto3" json:"process_guid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DesiredLRPByProcessGuidRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *ProtoDesiredLRPByProcessGuidRequest) Reset() { + *x = ProtoDesiredLRPByProcessGuidRequest{} + mi := &file_desired_lrp_requests_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DesiredLRPByProcessGuidRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *ProtoDesiredLRPByProcessGuidRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DesiredLRPByProcessGuidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProcessGuid) > 0 { - i -= len(m.ProcessGuid) - copy(dAtA[i:], m.ProcessGuid) - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(len(m.ProcessGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} +func (*ProtoDesiredLRPByProcessGuidRequest) ProtoMessage() {} -func (m *DesireLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesireLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesireLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DesiredLrp != nil { - { - size, err := m.DesiredLrp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(size)) +func (x *ProtoDesiredLRPByProcessGuidRequest) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_requests_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - i-- - dAtA[i] = 0xa + return ms } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *UpdateDesiredLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateDesiredLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateDesiredLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Update != nil { - { - size, err := m.Update.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ProcessGuid) > 0 { - i -= len(m.ProcessGuid) - copy(dAtA[i:], m.ProcessGuid) - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(len(m.ProcessGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +// Deprecated: Use ProtoDesiredLRPByProcessGuidRequest.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPByProcessGuidRequest) Descriptor() ([]byte, []int) { + return file_desired_lrp_requests_proto_rawDescGZIP(), []int{6} } -func (m *RemoveDesiredLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoDesiredLRPByProcessGuidRequest) GetProcessGuid() string { + if x != nil { + return x.ProcessGuid } - return dAtA[:n], nil + return "" } -func (m *RemoveDesiredLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type ProtoDesireLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + DesiredLrp *ProtoDesiredLRP `protobuf:"bytes,1,opt,name=desired_lrp,proto3" json:"desired_lrp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *RemoveDesiredLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProcessGuid) > 0 { - i -= len(m.ProcessGuid) - copy(dAtA[i:], m.ProcessGuid) - i = encodeVarintDesiredLrpRequests(dAtA, i, uint64(len(m.ProcessGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func (x *ProtoDesireLRPRequest) Reset() { + *x = ProtoDesireLRPRequest{} + mi := &file_desired_lrp_requests_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func encodeVarintDesiredLrpRequests(dAtA []byte, offset int, v uint64) int { - offset -= sovDesiredLrpRequests(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *DesiredLRPLifecycleResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } - return n +func (x *ProtoDesireLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DesiredLRPsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } - if len(m.DesiredLrps) > 0 { - for _, e := range m.DesiredLrps { - l = e.Size() - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } - } - return n -} +func (*ProtoDesireLRPRequest) ProtoMessage() {} -func (m *DesiredLRPsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Domain) - if l > 0 { - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } - if len(m.ProcessGuids) > 0 { - for _, s := range m.ProcessGuids { - l = len(s) - n += 1 + l + sovDesiredLrpRequests(uint64(l)) +func (x *ProtoDesireLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_requests_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return n + return mi.MessageOf(x) } -func (m *DesiredLRPResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } - if m.DesiredLrp != nil { - l = m.DesiredLrp.Size() - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } - return n +// Deprecated: Use ProtoDesireLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoDesireLRPRequest) Descriptor() ([]byte, []int) { + return file_desired_lrp_requests_proto_rawDescGZIP(), []int{7} } -func (m *DesiredLRPSchedulingInfosResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } - if len(m.DesiredLrpSchedulingInfos) > 0 { - for _, e := range m.DesiredLrpSchedulingInfos { - l = e.Size() - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } +func (x *ProtoDesireLRPRequest) GetDesiredLrp() *ProtoDesiredLRP { + if x != nil { + return x.DesiredLrp } - return n + return nil } -func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } - if m.DesiredLrpSchedulingInfo != nil { - l = m.DesiredLrpSchedulingInfo.Size() - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } - return n +type ProtoUpdateDesiredLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,proto3" json:"process_guid,omitempty"` + Update *ProtoDesiredLRPUpdate `protobuf:"bytes,2,opt,name=update,proto3" json:"update,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DesiredLRPByProcessGuidRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProcessGuid) - if l > 0 { - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } - return n +func (x *ProtoUpdateDesiredLRPRequest) Reset() { + *x = ProtoUpdateDesiredLRPRequest{} + mi := &file_desired_lrp_requests_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DesireLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DesiredLrp != nil { - l = m.DesiredLrp.Size() - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } - return n +func (x *ProtoUpdateDesiredLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *UpdateDesiredLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProcessGuid) - if l > 0 { - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } - if m.Update != nil { - l = m.Update.Size() - n += 1 + l + sovDesiredLrpRequests(uint64(l)) - } - return n -} +func (*ProtoUpdateDesiredLRPRequest) ProtoMessage() {} -func (m *RemoveDesiredLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProcessGuid) - if l > 0 { - n += 1 + l + sovDesiredLrpRequests(uint64(l)) +func (x *ProtoUpdateDesiredLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_requests_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return n + return mi.MessageOf(x) } -func sovDesiredLrpRequests(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +// Deprecated: Use ProtoUpdateDesiredLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoUpdateDesiredLRPRequest) Descriptor() ([]byte, []int) { + return file_desired_lrp_requests_proto_rawDescGZIP(), []int{8} } -func sozDesiredLrpRequests(x uint64) (n int) { - return sovDesiredLrpRequests(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *DesiredLRPLifecycleResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesiredLRPLifecycleResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPsResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForDesiredLrps := "[]*DesiredLRP{" - for _, f := range this.DesiredLrps { - repeatedStringForDesiredLrps += strings.Replace(fmt.Sprintf("%v", f), "DesiredLRP", "DesiredLRP", 1) + "," - } - repeatedStringForDesiredLrps += "}" - s := strings.Join([]string{`&DesiredLRPsResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `DesiredLrps:` + repeatedStringForDesiredLrps + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPsRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesiredLRPsRequest{`, - `Domain:` + fmt.Sprintf("%v", this.Domain) + `,`, - `ProcessGuids:` + fmt.Sprintf("%v", this.ProcessGuids) + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesiredLRPResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `DesiredLrp:` + strings.Replace(fmt.Sprintf("%v", this.DesiredLrp), "DesiredLRP", "DesiredLRP", 1) + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPSchedulingInfosResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForDesiredLrpSchedulingInfos := "[]*DesiredLRPSchedulingInfo{" - for _, f := range this.DesiredLrpSchedulingInfos { - repeatedStringForDesiredLrpSchedulingInfos += strings.Replace(fmt.Sprintf("%v", f), "DesiredLRPSchedulingInfo", "DesiredLRPSchedulingInfo", 1) + "," - } - repeatedStringForDesiredLrpSchedulingInfos += "}" - s := strings.Join([]string{`&DesiredLRPSchedulingInfosResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `DesiredLrpSchedulingInfos:` + repeatedStringForDesiredLrpSchedulingInfos + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPSchedulingInfoByProcessGuidResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesiredLRPSchedulingInfoByProcessGuidResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `DesiredLrpSchedulingInfo:` + strings.Replace(fmt.Sprintf("%v", this.DesiredLrpSchedulingInfo), "DesiredLRPSchedulingInfo", "DesiredLRPSchedulingInfo", 1) + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPByProcessGuidRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesiredLRPByProcessGuidRequest{`, - `ProcessGuid:` + fmt.Sprintf("%v", this.ProcessGuid) + `,`, - `}`, - }, "") - return s -} -func (this *DesireLRPRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesireLRPRequest{`, - `DesiredLrp:` + strings.Replace(fmt.Sprintf("%v", this.DesiredLrp), "DesiredLRP", "DesiredLRP", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateDesiredLRPRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateDesiredLRPRequest{`, - `ProcessGuid:` + fmt.Sprintf("%v", this.ProcessGuid) + `,`, - `Update:` + strings.Replace(fmt.Sprintf("%v", this.Update), "DesiredLRPUpdate", "DesiredLRPUpdate", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveDesiredLRPRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveDesiredLRPRequest{`, - `ProcessGuid:` + fmt.Sprintf("%v", this.ProcessGuid) + `,`, - `}`, - }, "") - return s -} -func valueToStringDesiredLrpRequests(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *DesiredLRPLifecycleResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPLifecycleResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPLifecycleResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoUpdateDesiredLRPRequest) GetProcessGuid() string { + if x != nil { + return x.ProcessGuid } - return nil + return "" } -func (m *DesiredLRPsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredLrps", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DesiredLrps = append(m.DesiredLrps, &DesiredLRP{}) - if err := m.DesiredLrps[len(m.DesiredLrps)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoUpdateDesiredLRPRequest) GetUpdate() *ProtoDesiredLRPUpdate { + if x != nil { + return x.Update } return nil } -func (m *DesiredLRPsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessGuids", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessGuids = append(m.ProcessGuids, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +type ProtoRemoveDesiredLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProcessGuid string `protobuf:"bytes,1,opt,name=process_guid,proto3" json:"process_guid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DesiredLRPResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredLrp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DesiredLrp == nil { - m.DesiredLrp = &DesiredLRP{} - } - if err := m.DesiredLrp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func (x *ProtoRemoveDesiredLRPRequest) Reset() { + *x = ProtoRemoveDesiredLRPRequest{} + mi := &file_desired_lrp_requests_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DesiredLRPSchedulingInfosResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPSchedulingInfosResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPSchedulingInfosResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredLrpSchedulingInfos", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DesiredLrpSchedulingInfos = append(m.DesiredLrpSchedulingInfos, &DesiredLRPSchedulingInfo{}) - if err := m.DesiredLrpSchedulingInfos[len(m.DesiredLrpSchedulingInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func (x *ProtoRemoveDesiredLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPSchedulingInfoByProcessGuidResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPSchedulingInfoByProcessGuidResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredLrpSchedulingInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DesiredLrpSchedulingInfo == nil { - m.DesiredLrpSchedulingInfo = &DesiredLRPSchedulingInfo{} - } - if err := m.DesiredLrpSchedulingInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DesiredLRPByProcessGuidRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPByProcessGuidRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPByProcessGuidRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +func (*ProtoRemoveDesiredLRPRequest) ProtoMessage() {} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DesireLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesireLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesireLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) +func (x *ProtoRemoveDesiredLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_desired_lrp_requests_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredLrp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DesiredLrp == nil { - m.DesiredLrp = &DesiredLRP{} - } - if err := m.DesiredLrp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF + return ms } - return nil + return mi.MessageOf(x) } -func (m *UpdateDesiredLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UpdateDesiredLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateDesiredLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Update", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Update == nil { - m.Update = &DesiredLRPUpdate{} - } - if err := m.Update.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use ProtoRemoveDesiredLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoRemoveDesiredLRPRequest) Descriptor() ([]byte, []int) { + return file_desired_lrp_requests_proto_rawDescGZIP(), []int{9} } -func (m *RemoveDesiredLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RemoveDesiredLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveDesiredLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDesiredLrpRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDesiredLrpRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoRemoveDesiredLRPRequest) GetProcessGuid() string { + if x != nil { + return x.ProcessGuid } - return nil -} -func skipDesiredLrpRequests(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDesiredLrpRequests - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthDesiredLrpRequests - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupDesiredLrpRequests - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthDesiredLrpRequests - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF + return "" } +var File_desired_lrp_requests_proto protoreflect.FileDescriptor + +const file_desired_lrp_requests_proto_rawDesc = "" + + "\n" + + "\x1adesired_lrp_requests.proto\x12\x06models\x1a\tbbs.proto\x1a\x11desired_lrp.proto\x1a\verror.proto\"L\n" + + " ProtoDesiredLRPLifecycleResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\"\x81\x01\n" + + "\x18ProtoDesiredLRPsResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\x12;\n" + + "\fdesired_lrps\x18\x02 \x03(\v2\x17.models.ProtoDesiredLRPR\fdesired_lrps\"\\\n" + + "\x17ProtoDesiredLRPsRequest\x12\x1b\n" + + "\x06domain\x18\x01 \x01(\tB\x03\xc0>\x01R\x06domain\x12$\n" + + "\rprocess_guids\x18\x02 \x03(\tR\rprocess_guids\"~\n" + + "\x17ProtoDesiredLRPResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\x129\n" + + "\vdesired_lrp\x18\x02 \x01(\v2\x17.models.ProtoDesiredLRPR\vdesired_lrp\"\xbd\x01\n" + + "&ProtoDesiredLRPSchedulingInfosResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\x12i\n" + + "\x1cdesired_lrp_scheduling_infos\x18\x02 \x03(\v2%.models.ProtoDesiredLRPSchedulingInfoR\x1cdesired_lrp_scheduling_infos\"\xc7\x01\n" + + "2ProtoDesiredLRPSchedulingInfoByProcessGuidResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\x12g\n" + + "\x1bdesired_lrp_scheduling_info\x18\x02 \x01(\v2%.models.ProtoDesiredLRPSchedulingInfoR\x1bdesired_lrp_scheduling_info\"N\n" + + "#ProtoDesiredLRPByProcessGuidRequest\x12'\n" + + "\fprocess_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\fprocess_guid\"R\n" + + "\x15ProtoDesireLRPRequest\x129\n" + + "\vdesired_lrp\x18\x01 \x01(\v2\x17.models.ProtoDesiredLRPR\vdesired_lrp\"~\n" + + "\x1cProtoUpdateDesiredLRPRequest\x12'\n" + + "\fprocess_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\fprocess_guid\x125\n" + + "\x06update\x18\x02 \x01(\v2\x1d.models.ProtoDesiredLRPUpdateR\x06update\"G\n" + + "\x1cProtoRemoveDesiredLRPRequest\x12'\n" + + "\fprocess_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\fprocess_guidB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" + var ( - ErrInvalidLengthDesiredLrpRequests = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDesiredLrpRequests = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupDesiredLrpRequests = fmt.Errorf("proto: unexpected end of group") + file_desired_lrp_requests_proto_rawDescOnce sync.Once + file_desired_lrp_requests_proto_rawDescData []byte ) + +func file_desired_lrp_requests_proto_rawDescGZIP() []byte { + file_desired_lrp_requests_proto_rawDescOnce.Do(func() { + file_desired_lrp_requests_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_desired_lrp_requests_proto_rawDesc), len(file_desired_lrp_requests_proto_rawDesc))) + }) + return file_desired_lrp_requests_proto_rawDescData +} + +var file_desired_lrp_requests_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_desired_lrp_requests_proto_goTypes = []any{ + (*ProtoDesiredLRPLifecycleResponse)(nil), // 0: models.ProtoDesiredLRPLifecycleResponse + (*ProtoDesiredLRPsResponse)(nil), // 1: models.ProtoDesiredLRPsResponse + (*ProtoDesiredLRPsRequest)(nil), // 2: models.ProtoDesiredLRPsRequest + (*ProtoDesiredLRPResponse)(nil), // 3: models.ProtoDesiredLRPResponse + (*ProtoDesiredLRPSchedulingInfosResponse)(nil), // 4: models.ProtoDesiredLRPSchedulingInfosResponse + (*ProtoDesiredLRPSchedulingInfoByProcessGuidResponse)(nil), // 5: models.ProtoDesiredLRPSchedulingInfoByProcessGuidResponse + (*ProtoDesiredLRPByProcessGuidRequest)(nil), // 6: models.ProtoDesiredLRPByProcessGuidRequest + (*ProtoDesireLRPRequest)(nil), // 7: models.ProtoDesireLRPRequest + (*ProtoUpdateDesiredLRPRequest)(nil), // 8: models.ProtoUpdateDesiredLRPRequest + (*ProtoRemoveDesiredLRPRequest)(nil), // 9: models.ProtoRemoveDesiredLRPRequest + (*ProtoError)(nil), // 10: models.ProtoError + (*ProtoDesiredLRP)(nil), // 11: models.ProtoDesiredLRP + (*ProtoDesiredLRPSchedulingInfo)(nil), // 12: models.ProtoDesiredLRPSchedulingInfo + (*ProtoDesiredLRPUpdate)(nil), // 13: models.ProtoDesiredLRPUpdate +} +var file_desired_lrp_requests_proto_depIdxs = []int32{ + 10, // 0: models.ProtoDesiredLRPLifecycleResponse.error:type_name -> models.ProtoError + 10, // 1: models.ProtoDesiredLRPsResponse.error:type_name -> models.ProtoError + 11, // 2: models.ProtoDesiredLRPsResponse.desired_lrps:type_name -> models.ProtoDesiredLRP + 10, // 3: models.ProtoDesiredLRPResponse.error:type_name -> models.ProtoError + 11, // 4: models.ProtoDesiredLRPResponse.desired_lrp:type_name -> models.ProtoDesiredLRP + 10, // 5: models.ProtoDesiredLRPSchedulingInfosResponse.error:type_name -> models.ProtoError + 12, // 6: models.ProtoDesiredLRPSchedulingInfosResponse.desired_lrp_scheduling_infos:type_name -> models.ProtoDesiredLRPSchedulingInfo + 10, // 7: models.ProtoDesiredLRPSchedulingInfoByProcessGuidResponse.error:type_name -> models.ProtoError + 12, // 8: models.ProtoDesiredLRPSchedulingInfoByProcessGuidResponse.desired_lrp_scheduling_info:type_name -> models.ProtoDesiredLRPSchedulingInfo + 11, // 9: models.ProtoDesireLRPRequest.desired_lrp:type_name -> models.ProtoDesiredLRP + 13, // 10: models.ProtoUpdateDesiredLRPRequest.update:type_name -> models.ProtoDesiredLRPUpdate + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_desired_lrp_requests_proto_init() } +func file_desired_lrp_requests_proto_init() { + if File_desired_lrp_requests_proto != nil { + return + } + file_bbs_proto_init() + file_desired_lrp_proto_init() + file_error_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_desired_lrp_requests_proto_rawDesc), len(file_desired_lrp_requests_proto_rawDesc)), + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_desired_lrp_requests_proto_goTypes, + DependencyIndexes: file_desired_lrp_requests_proto_depIdxs, + MessageInfos: file_desired_lrp_requests_proto_msgTypes, + }.Build() + File_desired_lrp_requests_proto = out.File + file_desired_lrp_requests_proto_goTypes = nil + file_desired_lrp_requests_proto_depIdxs = nil +} diff --git a/models/desired_lrp_requests.proto b/models/desired_lrp_requests.proto index be746255..ccae18b4 100644 --- a/models/desired_lrp_requests.proto +++ b/models/desired_lrp_requests.proto @@ -1,53 +1,54 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; import "desired_lrp.proto"; import "error.proto"; -message DesiredLRPLifecycleResponse { - Error error = 1; +message ProtoDesiredLRPLifecycleResponse { + ProtoError error = 1; } -message DesiredLRPsResponse { - Error error = 1; - repeated DesiredLRP desired_lrps = 2; +message ProtoDesiredLRPsResponse { + ProtoError error = 1; + repeated ProtoDesiredLRP desired_lrps = 2 [json_name = "desired_lrps"]; } -message DesiredLRPsRequest { - string domain = 1 [(gogoproto.jsontag) = "domain"]; - repeated string process_guids = 2; +message ProtoDesiredLRPsRequest { + string domain = 1 [json_name = "domain", (bbs.bbs_json_always_emit) = true]; + repeated string process_guids = 2 [json_name = "process_guids"]; } -message DesiredLRPResponse { - Error error = 1; - DesiredLRP desired_lrp = 2; +message ProtoDesiredLRPResponse { + ProtoError error = 1; + ProtoDesiredLRP desired_lrp = 2 [json_name = "desired_lrp"]; } -message DesiredLRPSchedulingInfosResponse { - Error error = 1; - repeated DesiredLRPSchedulingInfo desired_lrp_scheduling_infos = 2; +message ProtoDesiredLRPSchedulingInfosResponse { + ProtoError error = 1; + repeated ProtoDesiredLRPSchedulingInfo desired_lrp_scheduling_infos = 2 [json_name = "desired_lrp_scheduling_infos"]; } -message DesiredLRPSchedulingInfoByProcessGuidResponse { - Error error = 1; - DesiredLRPSchedulingInfo desired_lrp_scheduling_info = 2; +message ProtoDesiredLRPSchedulingInfoByProcessGuidResponse { + ProtoError error = 1; + ProtoDesiredLRPSchedulingInfo desired_lrp_scheduling_info = 2 [json_name = "desired_lrp_scheduling_info"]; } -message DesiredLRPByProcessGuidRequest { - string process_guid = 1 [(gogoproto.jsontag) = "process_guid"]; +message ProtoDesiredLRPByProcessGuidRequest { + string process_guid = 1 [json_name = "process_guid", (bbs.bbs_json_always_emit) = true]; } -message DesireLRPRequest { - DesiredLRP desired_lrp = 1; +message ProtoDesireLRPRequest { + ProtoDesiredLRP desired_lrp = 1 [json_name = "desired_lrp"]; } -message UpdateDesiredLRPRequest { - string process_guid = 1 [(gogoproto.jsontag) = "process_guid"]; - DesiredLRPUpdate update = 2; +message ProtoUpdateDesiredLRPRequest { + string process_guid = 1 [json_name = "process_guid", (bbs.bbs_json_always_emit) = true]; + ProtoDesiredLRPUpdate update = 2; } -message RemoveDesiredLRPRequest { - string process_guid = 1 [(gogoproto.jsontag) = "process_guid"]; +message ProtoRemoveDesiredLRPRequest { + string process_guid = 1 [json_name = "process_guid", (bbs.bbs_json_always_emit) = true]; } diff --git a/models/desired_lrp_requests_bbs.pb.go b/models/desired_lrp_requests_bbs.pb.go new file mode 100644 index 00000000..f293f7fb --- /dev/null +++ b/models/desired_lrp_requests_bbs.pb.go @@ -0,0 +1,1050 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: desired_lrp_requests.proto + +package models + +// Prevent copylock errors when using ProtoDesiredLRPLifecycleResponse directly +type DesiredLRPLifecycleResponse struct { + Error *Error `json:"error,omitempty"` +} + +func (this *DesiredLRPLifecycleResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPLifecycleResponse) + if !ok { + that2, ok := that.(DesiredLRPLifecycleResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + return true +} +func (m *DesiredLRPLifecycleResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *DesiredLRPLifecycleResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (x *DesiredLRPLifecycleResponse) ToProto() *ProtoDesiredLRPLifecycleResponse { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPLifecycleResponse{ + Error: x.Error.ToProto(), + } + return proto +} + +func (x *ProtoDesiredLRPLifecycleResponse) FromProto() *DesiredLRPLifecycleResponse { + if x == nil { + return nil + } + + copysafe := &DesiredLRPLifecycleResponse{ + Error: x.Error.FromProto(), + } + return copysafe +} + +func DesiredLRPLifecycleResponseToProtoSlice(values []*DesiredLRPLifecycleResponse) []*ProtoDesiredLRPLifecycleResponse { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPLifecycleResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPLifecycleResponseFromProtoSlice(values []*ProtoDesiredLRPLifecycleResponse) []*DesiredLRPLifecycleResponse { + if values == nil { + return nil + } + result := make([]*DesiredLRPLifecycleResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRPsResponse directly +type DesiredLRPsResponse struct { + Error *Error `json:"error,omitempty"` + DesiredLrps []*DesiredLRP `json:"desired_lrps,omitempty"` +} + +func (this *DesiredLRPsResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPsResponse) + if !ok { + that2, ok := that.(DesiredLRPsResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + if this.DesiredLrps == nil { + if that1.DesiredLrps != nil { + return false + } + } else if len(this.DesiredLrps) != len(that1.DesiredLrps) { + return false + } + for i := range this.DesiredLrps { + if !this.DesiredLrps[i].Equal(that1.DesiredLrps[i]) { + return false + } + } + return true +} +func (m *DesiredLRPsResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *DesiredLRPsResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (m *DesiredLRPsResponse) GetDesiredLrps() []*DesiredLRP { + if m != nil { + return m.DesiredLrps + } + return nil +} +func (m *DesiredLRPsResponse) SetDesiredLrps(value []*DesiredLRP) { + if m != nil { + m.DesiredLrps = value + } +} +func (x *DesiredLRPsResponse) ToProto() *ProtoDesiredLRPsResponse { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPsResponse{ + Error: x.Error.ToProto(), + DesiredLrps: DesiredLRPToProtoSlice(x.DesiredLrps), + } + return proto +} + +func (x *ProtoDesiredLRPsResponse) FromProto() *DesiredLRPsResponse { + if x == nil { + return nil + } + + copysafe := &DesiredLRPsResponse{ + Error: x.Error.FromProto(), + DesiredLrps: DesiredLRPFromProtoSlice(x.DesiredLrps), + } + return copysafe +} + +func DesiredLRPsResponseToProtoSlice(values []*DesiredLRPsResponse) []*ProtoDesiredLRPsResponse { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPsResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPsResponseFromProtoSlice(values []*ProtoDesiredLRPsResponse) []*DesiredLRPsResponse { + if values == nil { + return nil + } + result := make([]*DesiredLRPsResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRPsRequest directly +type DesiredLRPsRequest struct { + Domain string `json:"domain"` + ProcessGuids []string `json:"process_guids,omitempty"` +} + +func (this *DesiredLRPsRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPsRequest) + if !ok { + that2, ok := that.(DesiredLRPsRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Domain != that1.Domain { + return false + } + if this.ProcessGuids == nil { + if that1.ProcessGuids != nil { + return false + } + } else if len(this.ProcessGuids) != len(that1.ProcessGuids) { + return false + } + for i := range this.ProcessGuids { + if this.ProcessGuids[i] != that1.ProcessGuids[i] { + return false + } + } + return true +} +func (m *DesiredLRPsRequest) GetDomain() string { + if m != nil { + return m.Domain + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPsRequest) SetDomain(value string) { + if m != nil { + m.Domain = value + } +} +func (m *DesiredLRPsRequest) GetProcessGuids() []string { + if m != nil { + return m.ProcessGuids + } + return nil +} +func (m *DesiredLRPsRequest) SetProcessGuids(value []string) { + if m != nil { + m.ProcessGuids = value + } +} +func (x *DesiredLRPsRequest) ToProto() *ProtoDesiredLRPsRequest { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPsRequest{ + Domain: x.Domain, + ProcessGuids: x.ProcessGuids, + } + return proto +} + +func (x *ProtoDesiredLRPsRequest) FromProto() *DesiredLRPsRequest { + if x == nil { + return nil + } + + copysafe := &DesiredLRPsRequest{ + Domain: x.Domain, + ProcessGuids: x.ProcessGuids, + } + return copysafe +} + +func DesiredLRPsRequestToProtoSlice(values []*DesiredLRPsRequest) []*ProtoDesiredLRPsRequest { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPsRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPsRequestFromProtoSlice(values []*ProtoDesiredLRPsRequest) []*DesiredLRPsRequest { + if values == nil { + return nil + } + result := make([]*DesiredLRPsRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRPResponse directly +type DesiredLRPResponse struct { + Error *Error `json:"error,omitempty"` + DesiredLrp *DesiredLRP `json:"desired_lrp,omitempty"` +} + +func (this *DesiredLRPResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPResponse) + if !ok { + that2, ok := that.(DesiredLRPResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + if this.DesiredLrp == nil { + if that1.DesiredLrp != nil { + return false + } + } else if !this.DesiredLrp.Equal(*that1.DesiredLrp) { + return false + } + return true +} +func (m *DesiredLRPResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *DesiredLRPResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (m *DesiredLRPResponse) GetDesiredLrp() *DesiredLRP { + if m != nil { + return m.DesiredLrp + } + return nil +} +func (m *DesiredLRPResponse) SetDesiredLrp(value *DesiredLRP) { + if m != nil { + m.DesiredLrp = value + } +} +func (x *DesiredLRPResponse) ToProto() *ProtoDesiredLRPResponse { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPResponse{ + Error: x.Error.ToProto(), + DesiredLrp: x.DesiredLrp.ToProto(), + } + return proto +} + +func (x *ProtoDesiredLRPResponse) FromProto() *DesiredLRPResponse { + if x == nil { + return nil + } + + copysafe := &DesiredLRPResponse{ + Error: x.Error.FromProto(), + DesiredLrp: x.DesiredLrp.FromProto(), + } + return copysafe +} + +func DesiredLRPResponseToProtoSlice(values []*DesiredLRPResponse) []*ProtoDesiredLRPResponse { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPResponseFromProtoSlice(values []*ProtoDesiredLRPResponse) []*DesiredLRPResponse { + if values == nil { + return nil + } + result := make([]*DesiredLRPResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRPSchedulingInfosResponse directly +type DesiredLRPSchedulingInfosResponse struct { + Error *Error `json:"error,omitempty"` + DesiredLrpSchedulingInfos []*DesiredLRPSchedulingInfo `json:"desired_lrp_scheduling_infos,omitempty"` +} + +func (this *DesiredLRPSchedulingInfosResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPSchedulingInfosResponse) + if !ok { + that2, ok := that.(DesiredLRPSchedulingInfosResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + if this.DesiredLrpSchedulingInfos == nil { + if that1.DesiredLrpSchedulingInfos != nil { + return false + } + } else if len(this.DesiredLrpSchedulingInfos) != len(that1.DesiredLrpSchedulingInfos) { + return false + } + for i := range this.DesiredLrpSchedulingInfos { + if !this.DesiredLrpSchedulingInfos[i].Equal(that1.DesiredLrpSchedulingInfos[i]) { + return false + } + } + return true +} +func (m *DesiredLRPSchedulingInfosResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *DesiredLRPSchedulingInfosResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (m *DesiredLRPSchedulingInfosResponse) GetDesiredLrpSchedulingInfos() []*DesiredLRPSchedulingInfo { + if m != nil { + return m.DesiredLrpSchedulingInfos + } + return nil +} +func (m *DesiredLRPSchedulingInfosResponse) SetDesiredLrpSchedulingInfos(value []*DesiredLRPSchedulingInfo) { + if m != nil { + m.DesiredLrpSchedulingInfos = value + } +} +func (x *DesiredLRPSchedulingInfosResponse) ToProto() *ProtoDesiredLRPSchedulingInfosResponse { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPSchedulingInfosResponse{ + Error: x.Error.ToProto(), + DesiredLrpSchedulingInfos: DesiredLRPSchedulingInfoToProtoSlice(x.DesiredLrpSchedulingInfos), + } + return proto +} + +func (x *ProtoDesiredLRPSchedulingInfosResponse) FromProto() *DesiredLRPSchedulingInfosResponse { + if x == nil { + return nil + } + + copysafe := &DesiredLRPSchedulingInfosResponse{ + Error: x.Error.FromProto(), + DesiredLrpSchedulingInfos: DesiredLRPSchedulingInfoFromProtoSlice(x.DesiredLrpSchedulingInfos), + } + return copysafe +} + +func DesiredLRPSchedulingInfosResponseToProtoSlice(values []*DesiredLRPSchedulingInfosResponse) []*ProtoDesiredLRPSchedulingInfosResponse { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPSchedulingInfosResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPSchedulingInfosResponseFromProtoSlice(values []*ProtoDesiredLRPSchedulingInfosResponse) []*DesiredLRPSchedulingInfosResponse { + if values == nil { + return nil + } + result := make([]*DesiredLRPSchedulingInfosResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRPSchedulingInfoByProcessGuidResponse directly +type DesiredLRPSchedulingInfoByProcessGuidResponse struct { + Error *Error `json:"error,omitempty"` + DesiredLrpSchedulingInfo *DesiredLRPSchedulingInfo `json:"desired_lrp_scheduling_info,omitempty"` +} + +func (this *DesiredLRPSchedulingInfoByProcessGuidResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPSchedulingInfoByProcessGuidResponse) + if !ok { + that2, ok := that.(DesiredLRPSchedulingInfoByProcessGuidResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + if this.DesiredLrpSchedulingInfo == nil { + if that1.DesiredLrpSchedulingInfo != nil { + return false + } + } else if !this.DesiredLrpSchedulingInfo.Equal(*that1.DesiredLrpSchedulingInfo) { + return false + } + return true +} +func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) GetDesiredLrpSchedulingInfo() *DesiredLRPSchedulingInfo { + if m != nil { + return m.DesiredLrpSchedulingInfo + } + return nil +} +func (m *DesiredLRPSchedulingInfoByProcessGuidResponse) SetDesiredLrpSchedulingInfo(value *DesiredLRPSchedulingInfo) { + if m != nil { + m.DesiredLrpSchedulingInfo = value + } +} +func (x *DesiredLRPSchedulingInfoByProcessGuidResponse) ToProto() *ProtoDesiredLRPSchedulingInfoByProcessGuidResponse { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPSchedulingInfoByProcessGuidResponse{ + Error: x.Error.ToProto(), + DesiredLrpSchedulingInfo: x.DesiredLrpSchedulingInfo.ToProto(), + } + return proto +} + +func (x *ProtoDesiredLRPSchedulingInfoByProcessGuidResponse) FromProto() *DesiredLRPSchedulingInfoByProcessGuidResponse { + if x == nil { + return nil + } + + copysafe := &DesiredLRPSchedulingInfoByProcessGuidResponse{ + Error: x.Error.FromProto(), + DesiredLrpSchedulingInfo: x.DesiredLrpSchedulingInfo.FromProto(), + } + return copysafe +} + +func DesiredLRPSchedulingInfoByProcessGuidResponseToProtoSlice(values []*DesiredLRPSchedulingInfoByProcessGuidResponse) []*ProtoDesiredLRPSchedulingInfoByProcessGuidResponse { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPSchedulingInfoByProcessGuidResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPSchedulingInfoByProcessGuidResponseFromProtoSlice(values []*ProtoDesiredLRPSchedulingInfoByProcessGuidResponse) []*DesiredLRPSchedulingInfoByProcessGuidResponse { + if values == nil { + return nil + } + result := make([]*DesiredLRPSchedulingInfoByProcessGuidResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRPByProcessGuidRequest directly +type DesiredLRPByProcessGuidRequest struct { + ProcessGuid string `json:"process_guid"` +} + +func (this *DesiredLRPByProcessGuidRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPByProcessGuidRequest) + if !ok { + that2, ok := that.(DesiredLRPByProcessGuidRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ProcessGuid != that1.ProcessGuid { + return false + } + return true +} +func (m *DesiredLRPByProcessGuidRequest) GetProcessGuid() string { + if m != nil { + return m.ProcessGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPByProcessGuidRequest) SetProcessGuid(value string) { + if m != nil { + m.ProcessGuid = value + } +} +func (x *DesiredLRPByProcessGuidRequest) ToProto() *ProtoDesiredLRPByProcessGuidRequest { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPByProcessGuidRequest{ + ProcessGuid: x.ProcessGuid, + } + return proto +} + +func (x *ProtoDesiredLRPByProcessGuidRequest) FromProto() *DesiredLRPByProcessGuidRequest { + if x == nil { + return nil + } + + copysafe := &DesiredLRPByProcessGuidRequest{ + ProcessGuid: x.ProcessGuid, + } + return copysafe +} + +func DesiredLRPByProcessGuidRequestToProtoSlice(values []*DesiredLRPByProcessGuidRequest) []*ProtoDesiredLRPByProcessGuidRequest { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPByProcessGuidRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPByProcessGuidRequestFromProtoSlice(values []*ProtoDesiredLRPByProcessGuidRequest) []*DesiredLRPByProcessGuidRequest { + if values == nil { + return nil + } + result := make([]*DesiredLRPByProcessGuidRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesireLRPRequest directly +type DesireLRPRequest struct { + DesiredLrp *DesiredLRP `json:"desired_lrp,omitempty"` +} + +func (this *DesireLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesireLRPRequest) + if !ok { + that2, ok := that.(DesireLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.DesiredLrp == nil { + if that1.DesiredLrp != nil { + return false + } + } else if !this.DesiredLrp.Equal(*that1.DesiredLrp) { + return false + } + return true +} +func (m *DesireLRPRequest) GetDesiredLrp() *DesiredLRP { + if m != nil { + return m.DesiredLrp + } + return nil +} +func (m *DesireLRPRequest) SetDesiredLrp(value *DesiredLRP) { + if m != nil { + m.DesiredLrp = value + } +} +func (x *DesireLRPRequest) ToProto() *ProtoDesireLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoDesireLRPRequest{ + DesiredLrp: x.DesiredLrp.ToProto(), + } + return proto +} + +func (x *ProtoDesireLRPRequest) FromProto() *DesireLRPRequest { + if x == nil { + return nil + } + + copysafe := &DesireLRPRequest{ + DesiredLrp: x.DesiredLrp.FromProto(), + } + return copysafe +} + +func DesireLRPRequestToProtoSlice(values []*DesireLRPRequest) []*ProtoDesireLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoDesireLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesireLRPRequestFromProtoSlice(values []*ProtoDesireLRPRequest) []*DesireLRPRequest { + if values == nil { + return nil + } + result := make([]*DesireLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoUpdateDesiredLRPRequest directly +type UpdateDesiredLRPRequest struct { + ProcessGuid string `json:"process_guid"` + Update *DesiredLRPUpdate `json:"update,omitempty"` +} + +func (this *UpdateDesiredLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*UpdateDesiredLRPRequest) + if !ok { + that2, ok := that.(UpdateDesiredLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ProcessGuid != that1.ProcessGuid { + return false + } + if this.Update == nil { + if that1.Update != nil { + return false + } + } else if !this.Update.Equal(*that1.Update) { + return false + } + return true +} +func (m *UpdateDesiredLRPRequest) GetProcessGuid() string { + if m != nil { + return m.ProcessGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *UpdateDesiredLRPRequest) SetProcessGuid(value string) { + if m != nil { + m.ProcessGuid = value + } +} +func (m *UpdateDesiredLRPRequest) GetUpdate() *DesiredLRPUpdate { + if m != nil { + return m.Update + } + return nil +} +func (m *UpdateDesiredLRPRequest) SetUpdate(value *DesiredLRPUpdate) { + if m != nil { + m.Update = value + } +} +func (x *UpdateDesiredLRPRequest) ToProto() *ProtoUpdateDesiredLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoUpdateDesiredLRPRequest{ + ProcessGuid: x.ProcessGuid, + Update: x.Update.ToProto(), + } + return proto +} + +func (x *ProtoUpdateDesiredLRPRequest) FromProto() *UpdateDesiredLRPRequest { + if x == nil { + return nil + } + + copysafe := &UpdateDesiredLRPRequest{ + ProcessGuid: x.ProcessGuid, + Update: x.Update.FromProto(), + } + return copysafe +} + +func UpdateDesiredLRPRequestToProtoSlice(values []*UpdateDesiredLRPRequest) []*ProtoUpdateDesiredLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoUpdateDesiredLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func UpdateDesiredLRPRequestFromProtoSlice(values []*ProtoUpdateDesiredLRPRequest) []*UpdateDesiredLRPRequest { + if values == nil { + return nil + } + result := make([]*UpdateDesiredLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoRemoveDesiredLRPRequest directly +type RemoveDesiredLRPRequest struct { + ProcessGuid string `json:"process_guid"` +} + +func (this *RemoveDesiredLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*RemoveDesiredLRPRequest) + if !ok { + that2, ok := that.(RemoveDesiredLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ProcessGuid != that1.ProcessGuid { + return false + } + return true +} +func (m *RemoveDesiredLRPRequest) GetProcessGuid() string { + if m != nil { + return m.ProcessGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *RemoveDesiredLRPRequest) SetProcessGuid(value string) { + if m != nil { + m.ProcessGuid = value + } +} +func (x *RemoveDesiredLRPRequest) ToProto() *ProtoRemoveDesiredLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoRemoveDesiredLRPRequest{ + ProcessGuid: x.ProcessGuid, + } + return proto +} + +func (x *ProtoRemoveDesiredLRPRequest) FromProto() *RemoveDesiredLRPRequest { + if x == nil { + return nil + } + + copysafe := &RemoveDesiredLRPRequest{ + ProcessGuid: x.ProcessGuid, + } + return copysafe +} + +func RemoveDesiredLRPRequestToProtoSlice(values []*RemoveDesiredLRPRequest) []*ProtoRemoveDesiredLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoRemoveDesiredLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func RemoveDesiredLRPRequestFromProtoSlice(values []*ProtoRemoveDesiredLRPRequest) []*RemoveDesiredLRPRequest { + if values == nil { + return nil + } + result := make([]*RemoveDesiredLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/desired_lrp_requests_test.go b/models/desired_lrp_requests_test.go index 50c708c8..d2692c28 100644 --- a/models/desired_lrp_requests_test.go +++ b/models/desired_lrp_requests_test.go @@ -103,7 +103,8 @@ var _ = Describe("DesiredLRP Requests", func() { Context("when the Update is invalid", func() { BeforeEach(func() { request.Update = &models.DesiredLRPUpdate{} - request.Update.SetInstances(-1) + instances := int32(-1) + request.Update.SetInstances(&instances) }) It("returns a validation error", func() { diff --git a/models/desired_lrp_test.go b/models/desired_lrp_test.go index 17c3c9b3..b0dd2810 100644 --- a/models/desired_lrp_test.go +++ b/models/desired_lrp_test.go @@ -10,11 +10,12 @@ import ( "code.cloudfoundry.org/bbs/format" "code.cloudfoundry.org/bbs/models" "code.cloudfoundry.org/bbs/models/test/model_helpers" - "github.com/gogo/protobuf/proto" + "google.golang.org/protobuf/proto" . "code.cloudfoundry.org/bbs/test_helpers" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + gomegaformat "github.com/onsi/gomega/format" ) var _ = Describe("DesiredLRP", func() { @@ -344,28 +345,34 @@ var _ = Describe("DesiredLRP", func() { Describe("serialization", func() { It("successfully round trips through json and protobuf", func() { + // JSON jsonSerialization, err := json.Marshal(desiredLRP) Expect(err).NotTo(HaveOccurred()) Expect(jsonSerialization).To(MatchJSON(jsonDesiredLRP)) - protoSerialization, err := proto.Marshal(&desiredLRP) + // Protobuf + protoDesiredLrp := desiredLRP.ToProto() + protoSerialization, err := proto.Marshal(protoDesiredLrp) Expect(err).NotTo(HaveOccurred()) - var protoDeserialization models.DesiredLRP + var protoDeserialization models.ProtoDesiredLRP err = proto.Unmarshal(protoSerialization, &protoDeserialization) Expect(err).NotTo(HaveOccurred()) desiredRoutes := *desiredLRP.Routes - deserializedRoutes := *protoDeserialization.Routes + deserializedRoutes := protoDeserialization.Routes - Expect(deserializedRoutes).To(HaveLen(len(desiredRoutes))) + Expect(deserializedRoutes.Routes).To(HaveLen(len(desiredRoutes))) for k := range desiredRoutes { - Expect(string(*deserializedRoutes[k])).To(MatchJSON(string(*desiredRoutes[k]))) + Expect(string(deserializedRoutes.Routes[k])).To(MatchJSON(string(*desiredRoutes[k]))) } desiredLRP.Routes = nil protoDeserialization.Routes = nil - Expect(protoDeserialization).To(Equal(desiredLRP)) + fromProtoDesiredLrp := *protoDeserialization.FromProto() + gomegaformat.MaxLength = 0 + Expect(fromProtoDesiredLrp.Equal(desiredLRP)).To(BeTrue()) + Expect(fromProtoDesiredLrp).To(Equal(desiredLRP)) }) }) @@ -373,7 +380,7 @@ var _ = Describe("DesiredLRP", func() { It("updates instances", func() { instances := int32(100) update := &models.DesiredLRPUpdate{} - update.SetInstances(instances) + update.SetInstances(&instances) schedulingInfo := desiredLRP.DesiredLRPSchedulingInfo() expectedSchedulingInfo := schedulingInfo @@ -392,7 +399,7 @@ var _ = Describe("DesiredLRP", func() { schedulingInfo := desiredLRP.DesiredLRPSchedulingInfo() expectedSchedulingInfo := schedulingInfo - expectedSchedulingInfo.Routes = models.Routes{} + expectedSchedulingInfo.Routes = &models.Routes{} expectedSchedulingInfo.ModificationTag.Increment() schedulingInfo.ApplyUpdate(update) @@ -402,7 +409,7 @@ var _ = Describe("DesiredLRP", func() { It("allows annotation to be set", func() { annotation := "new-annotation" update := &models.DesiredLRPUpdate{} - update.SetAnnotation(annotation) + update.SetAnnotation(&annotation) schedulingInfo := desiredLRP.DesiredLRPSchedulingInfo() @@ -417,7 +424,7 @@ var _ = Describe("DesiredLRP", func() { It("allows empty annotation to be set", func() { emptyAnnotation := "" update := &models.DesiredLRPUpdate{} - update.SetAnnotation(emptyAnnotation) + update.SetAnnotation(&emptyAnnotation) schedulingInfo := desiredLRP.DesiredLRPSchedulingInfo() @@ -431,18 +438,17 @@ var _ = Describe("DesiredLRP", func() { It("updates routes", func() { rawMessage := json.RawMessage([]byte(`{"port": 8080,"hosts":["new-route-1","new-route-2"]}`)) + routes := &models.Routes{ + "router": &rawMessage, + } update := &models.DesiredLRPUpdate{ - Routes: &models.Routes{ - "router": &rawMessage, - }, + Routes: routes, } schedulingInfo := desiredLRP.DesiredLRPSchedulingInfo() expectedSchedulingInfo := schedulingInfo - expectedSchedulingInfo.Routes = models.Routes{ - "router": &rawMessage, - } + expectedSchedulingInfo.Routes = routes expectedSchedulingInfo.ModificationTag.Increment() schedulingInfo.ApplyUpdate(update) @@ -465,7 +471,8 @@ var _ = Describe("DesiredLRP", func() { Context("when update does not contain routes", func() { BeforeEach(func() { - update.SetInstances(2) + instances := int32(2) + update.SetInstances(&instances) }) It("returns false", func() { @@ -688,17 +695,17 @@ var _ = Describe("DesiredLRP", func() { Name: "dep0", Url: "u0", DestinationPath: "/tmp/0", - LayerType: models.LayerTypeExclusive, - MediaType: models.MediaTypeTgz, - DigestAlgorithm: models.DigestAlgorithmSha256, + LayerType: models.ImageLayer_LayerTypeExclusive, + MediaType: models.ImageLayer_MediaTypeTgz, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, DigestValue: "some-sha", }, { Name: "dep1", Url: "u1", DestinationPath: "/tmp/1", - LayerType: models.LayerTypeShared, - MediaType: models.MediaTypeTgz, + LayerType: models.ImageLayer_LayerTypeShared, + MediaType: models.ImageLayer_MediaTypeTgz, }, } desiredLRP.CachedDependencies = []*models.CachedDependency{ @@ -783,17 +790,17 @@ var _ = Describe("DesiredLRP", func() { Name: "dep0", Url: "u0", DestinationPath: "/tmp/0", - LayerType: models.LayerTypeShared, - MediaType: models.MediaTypeTgz, - DigestAlgorithm: models.DigestAlgorithmSha256, + LayerType: models.ImageLayer_LayerTypeShared, + MediaType: models.ImageLayer_MediaTypeTgz, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, DigestValue: "some-sha", }, { Name: "dep1", Url: "u1", DestinationPath: "/tmp/1", - LayerType: models.LayerTypeShared, - MediaType: models.MediaTypeTgz, + LayerType: models.ImageLayer_LayerTypeShared, + MediaType: models.ImageLayer_MediaTypeTgz, }, } desiredLRP.CachedDependencies = []*models.CachedDependency{ @@ -853,18 +860,18 @@ var _ = Describe("DesiredLRP", func() { Name: "dep0", Url: "u0", DestinationPath: "/tmp/0", - LayerType: models.LayerTypeExclusive, - MediaType: models.MediaTypeTgz, - DigestAlgorithm: models.DigestAlgorithmSha256, + LayerType: models.ImageLayer_LayerTypeExclusive, + MediaType: models.ImageLayer_MediaTypeTgz, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, DigestValue: "some-sha", }, { Name: "dep1", Url: "u1", DestinationPath: "/tmp/1", - LayerType: models.LayerTypeExclusive, - MediaType: models.MediaTypeTgz, - DigestAlgorithm: models.DigestAlgorithmSha256, + LayerType: models.ImageLayer_LayerTypeExclusive, + MediaType: models.ImageLayer_MediaTypeTgz, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, DigestValue: "some-other-sha", }, } @@ -1252,7 +1259,7 @@ var _ = Describe("DesiredLRP", func() { { Url: "here", DestinationPath: "there", - DigestAlgorithm: models.DigestAlgorithmSha256, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, }, } assertDesiredLRPValidationFailsWithMessage(desiredLRP, "value") @@ -1265,9 +1272,9 @@ var _ = Describe("DesiredLRP", func() { { Url: "here", DestinationPath: "there", - DigestAlgorithm: models.DigestAlgorithmSha256, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, DigestValue: "sum value", - LayerType: models.LayerTypeExclusive, + LayerType: models.ImageLayer_LayerTypeExclusive, }, } assertDesiredLRPValidationFailsWithMessage(desiredLRP, "legacy_download_user") @@ -1278,7 +1285,7 @@ var _ = Describe("DesiredLRP", func() { Context("metric tags", func() { It("is invalid when both static and dynamic values are provided", func() { desiredLRP.MetricTags = map[string]*models.MetricTagValue{ - "some_metric": {Static: "some-value", Dynamic: models.MetricTagDynamicValueIndex}, + "some_metric": {Static: "some-value", Dynamic: models.MetricTagValue_MetricTagDynamicValueIndex}, } assertDesiredLRPValidationFailsWithMessage(desiredLRP, "metric_tags") assertDesiredLRPValidationFailsWithMessage(desiredLRP, "static") @@ -1343,11 +1350,15 @@ var _ = Describe("DesiredLRPUpdate", func() { var desiredLRPUpdate models.DesiredLRPUpdate BeforeEach(func() { - desiredLRPUpdate.SetInstances(2) - desiredLRPUpdate.Routes = &models.Routes{ + instances := int32(2) + desiredLRPUpdate.Instances = &instances + routes := &models.Routes{ "foo": &json.RawMessage{'"', 'b', 'a', 'r', '"'}, } - desiredLRPUpdate.SetAnnotation("some-text") + + desiredLRPUpdate.Routes = routes + annotation := "some-text" + desiredLRPUpdate.SetAnnotation(&annotation) desiredLRPUpdate.MetricTags = map[string]*models.MetricTagValue{ "some-tag": {Static: "some-value"}, } @@ -1361,28 +1372,31 @@ var _ = Describe("DesiredLRPUpdate", func() { } It("requires a positive nonzero number of instances", func() { - desiredLRPUpdate.SetInstances(-1) + invalidInstances := int32(-1) + desiredLRPUpdate.Instances = &invalidInstances assertDesiredLRPValidationFailsWithMessage(desiredLRPUpdate, "instances") - desiredLRPUpdate.SetInstances(0) + zeroInstances := int32(0) + desiredLRPUpdate.Instances = &zeroInstances validationErr := desiredLRPUpdate.Validate() Expect(validationErr).NotTo(HaveOccurred()) - desiredLRPUpdate.SetInstances(1) + oneInstance := int32(1) + desiredLRPUpdate.Instances = &oneInstance validationErr = desiredLRPUpdate.Validate() Expect(validationErr).NotTo(HaveOccurred()) }) It("limits the annotation length", func() { largeString := randStringBytes(50000) - desiredLRPUpdate.SetAnnotation(largeString) + desiredLRPUpdate.Annotation = &largeString assertDesiredLRPValidationFailsWithMessage(desiredLRPUpdate, "annotation") }) Context("metric tags", func() { It("is invalid when both static and dynamic values are provided for the same key", func() { desiredLRPUpdate.MetricTags = map[string]*models.MetricTagValue{ - "some_metric": {Static: "some-value", Dynamic: models.MetricTagDynamicValueIndex}, + "some_metric": {Static: "some-value", Dynamic: models.MetricTagValue_DynamicValue(models.ProtoMetricTagValue_INDEX)}, } assertDesiredLRPValidationFailsWithMessage(desiredLRPUpdate, "metric_tags") assertDesiredLRPValidationFailsWithMessage(desiredLRPUpdate, "static") @@ -1419,9 +1433,10 @@ var _ = Describe("DesiredLRPUpdate", func() { }) It("can marshal to JSON and back", func() { - Expect(json.Marshal(desiredLRPUpdate)).To(MatchJSON(expectedJSON)) + actual, _ := json.Marshal(&desiredLRPUpdate) + Expect(actual).To(MatchJSON(expectedJSON)) - var testV models.DesiredLRPUpdate + testV := models.DesiredLRPUpdate{} Expect(json.Unmarshal([]byte(expectedJSON), &testV)).To(Succeed()) Expect(testV).To(Equal(desiredLRPUpdate)) }) @@ -1444,8 +1459,8 @@ var _ = Describe("DesiredLRPUpdate", func() { }) Context("when the metric tags differ in a single dynamic value", func() { It("returns true", func() { - existingTags := map[string]*models.MetricTagValue{"some-tag": {Dynamic: models.MetricTagDynamicValueIndex}} - update := &models.DesiredLRPUpdate{MetricTags: map[string]*models.MetricTagValue{"some-tag": {Dynamic: models.MetricTagDynamicValueInstanceGuid}}} + existingTags := map[string]*models.MetricTagValue{"some-tag": {Dynamic: models.MetricTagValue_MetricTagDynamicValueIndex}} + update := &models.DesiredLRPUpdate{MetricTags: map[string]*models.MetricTagValue{"some-tag": {Dynamic: models.MetricTagValue_MetricTagDynamicValueInstanceGuid}}} Expect(update.IsMetricTagsUpdated(existingTags)).To(BeTrue()) }) }) @@ -1577,12 +1592,12 @@ var _ = Describe("DesiredLRPSchedulingInfo", func() { Expect(err.Error()).To(ContainSubstring(expectedErr)) } }, - Entry("valid scheduling info", models.NewDesiredLRPSchedulingInfo(newValidLRPKey(), annotation, instances, newValidResource(), routes, tag, nil, nil), ""), - Entry("invalid annotation", models.NewDesiredLRPSchedulingInfo(newValidLRPKey(), largeString, instances, newValidResource(), routes, tag, nil, nil), "annotation"), - Entry("invalid instances", models.NewDesiredLRPSchedulingInfo(newValidLRPKey(), annotation, -2, newValidResource(), routes, tag, nil, nil), "instances"), - Entry("invalid key", models.NewDesiredLRPSchedulingInfo(models.DesiredLRPKey{}, annotation, instances, newValidResource(), routes, tag, nil, nil), "process_guid"), - Entry("invalid resource", models.NewDesiredLRPSchedulingInfo(newValidLRPKey(), annotation, instances, models.DesiredLRPResource{}, routes, tag, nil, nil), "rootfs"), - Entry("invalid routes", models.NewDesiredLRPSchedulingInfo(newValidLRPKey(), annotation, instances, newValidResource(), largeRoutes, tag, nil, nil), "routes"), + Entry("valid scheduling info", models.NewDesiredLRPSchedulingInfo(newValidLRPKey(), annotation, instances, newValidResource(), &routes, tag, nil, nil), ""), + Entry("invalid annotation", models.NewDesiredLRPSchedulingInfo(newValidLRPKey(), largeString, instances, newValidResource(), &routes, tag, nil, nil), "annotation"), + Entry("invalid instances", models.NewDesiredLRPSchedulingInfo(newValidLRPKey(), annotation, -2, newValidResource(), &routes, tag, nil, nil), "instances"), + Entry("invalid key", models.NewDesiredLRPSchedulingInfo(models.DesiredLRPKey{}, annotation, instances, newValidResource(), &routes, tag, nil, nil), "process_guid"), + Entry("invalid resource", models.NewDesiredLRPSchedulingInfo(newValidLRPKey(), annotation, instances, models.DesiredLRPResource{}, &routes, tag, nil, nil), "rootfs"), + Entry("invalid routes", models.NewDesiredLRPSchedulingInfo(newValidLRPKey(), annotation, instances, newValidResource(), &largeRoutes, tag, nil, nil), "routes"), ) }) @@ -1614,12 +1629,12 @@ var _ = Describe("DesiredLRPRoutingInfo", func() { Entry("invalid instances", models.NewDesiredLRPRoutingInfo(newValidLRPKey(), -2, &routes, &tag, map[string]*models.MetricTagValue{}), "instances"), Entry("invalid key", models.NewDesiredLRPRoutingInfo(models.DesiredLRPKey{}, instances, &routes, &tag, map[string]*models.MetricTagValue{}), "process_guid"), Entry("invalid routes", models.NewDesiredLRPRoutingInfo(newValidLRPKey(), instances, &largeRoutes, &tag, map[string]*models.MetricTagValue{}), "routes"), - Entry("invalid metricTags", models.NewDesiredLRPRoutingInfo(newValidLRPKey(), instances, &routes, &tag, map[string]*models.MetricTagValue{"foo": {Dynamic: models.DynamicValueInvalid}}), "metric_tags"), + Entry("invalid metricTags", models.NewDesiredLRPRoutingInfo(newValidLRPKey(), instances, &routes, &tag, map[string]*models.MetricTagValue{"foo": {Dynamic: models.MetricTagValue_DynamicValueInvalid}}), "metric_tags"), ) }) var _ = Describe("DesiredLRPRunInfo", func() { - var envVars = []models.EnvironmentVariable{{"FOO", "bar"}} + var envVars = []*models.EnvironmentVariable{{"FOO", "bar"}} var action = model_helpers.NewValidAction() const startTimeoutMs int64 = 12 const privileged = true @@ -1666,14 +1681,14 @@ var _ = Describe("DesiredLRPRunInfo", func() { }, Entry("valid run info", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, envVars, nil, action, action, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "legacy-jim", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "", httpCheckDef, nil, []*models.Sidecar{{Action: action}}, logRateLimit, volumeMountedFiles), ""), Entry("invalid key", models.NewDesiredLRPRunInfo(models.DesiredLRPKey{}, createdAt, envVars, nil, action, action, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "legacy-jim", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "", httpCheckDef, nil, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "process_guid"), - Entry("invalid env vars", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, append(envVars, models.EnvironmentVariable{}), nil, action, action, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "legacy-jim", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "", httpCheckDef, nil, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "name"), + Entry("invalid env vars", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, append(envVars, &models.EnvironmentVariable{}), nil, action, action, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "legacy-jim", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "", httpCheckDef, nil, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "name"), Entry("invalid setup action", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, envVars, nil, &models.Action{}, action, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "legacy-jim", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "", httpCheckDef, nil, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "inner-action"), Entry("invalid run action", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, envVars, nil, action, &models.Action{}, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "legacy-jim", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "", httpCheckDef, nil, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "inner-action"), Entry("invalid monitor action", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, envVars, nil, action, action, &models.Action{}, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "legacy-jim", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "", httpCheckDef, nil, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "inner-action"), Entry("invalid http check definition", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, envVars, nil, action, action, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "legacy-jim", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "", &models.CheckDefinition{[]*models.Check{&models.Check{HttpCheck: &models.HTTPCheck{Port: 65536}}}, "healthcheck_log_source", []*models.Check{&models.Check{HttpCheck: &models.HTTPCheck{Port: 77777}}}}, nil, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "port"), Entry("invalid tcp check definition", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, envVars, nil, action, action, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "legacy-jim", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "", &models.CheckDefinition{[]*models.Check{&models.Check{TcpCheck: &models.TCPCheck{}}}, "healthcheck_log_source", []*models.Check{&models.Check{TcpCheck: &models.TCPCheck{}}}}, nil, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "port"), Entry("invalid check in check definition", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, envVars, nil, action, action, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "legacy-jim", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "", &models.CheckDefinition{[]*models.Check{&models.Check{HttpCheck: &models.HTTPCheck{}, TcpCheck: &models.TCPCheck{}}}, "healthcheck_log_source", []*models.Check{&models.Check{HttpCheck: &models.HTTPCheck{}, TcpCheck: &models.TCPCheck{}}}}, nil, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "check"), - Entry("invalid legacy download user", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, envVars, nil, action, action, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "", httpCheckDef, []*models.ImageLayer{{Url: "url", DestinationPath: "path", MediaType: models.MediaTypeTgz, LayerType: models.LayerTypeExclusive}}, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "legacy_download_user"), + Entry("invalid legacy download user", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, envVars, nil, action, action, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "", httpCheckDef, []*models.ImageLayer{{Url: "url", DestinationPath: "path", MediaType: models.ImageLayer_MediaTypeTgz, LayerType: models.ImageLayer_LayerTypeExclusive}}, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "legacy_download_user"), Entry("invalid cached dependency", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, envVars, []*models.CachedDependency{{To: "here"}}, action, action, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "user", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "", httpCheckDef, nil, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "cached_dependency"), Entry("invalid volume mount", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, envVars, nil, action, action, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "user", trustedSystemCertificatesPath, []*models.VolumeMount{{Mode: "lol"}}, nil, nil, "", "", httpCheckDef, nil, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "volume_mount"), Entry("invalid image username", models.NewDesiredLRPRunInfo(newValidLRPKey(), createdAt, envVars, nil, action, action, action, startTimeoutMs, privileged, cpuWeight, ports, egressRules, logSource, metricsGuid, "user", trustedSystemCertificatesPath, []*models.VolumeMount{}, nil, nil, "", "password", httpCheckDef, nil, []*models.Sidecar{}, logRateLimit, volumeMountedFiles), "image_username"), diff --git a/models/domain.pb.go b/models/domain.pb.go index 08777240..8d66ef35 100644 --- a/models/domain.pb.go +++ b/models/domain.pb.go @@ -1,853 +1,239 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: domain.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -type DomainsResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - Domains []string `protobuf:"bytes,2,rep,name=domains,proto3" json:"domains,omitempty"` +type ProtoDomainsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Domains []string `protobuf:"bytes,2,rep,name=domains,proto3" json:"domains,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DomainsResponse) Reset() { *m = DomainsResponse{} } -func (*DomainsResponse) ProtoMessage() {} -func (*DomainsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_73e6234e76dbdb84, []int{0} -} -func (m *DomainsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DomainsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DomainsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DomainsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DomainsResponse.Merge(m, src) -} -func (m *DomainsResponse) XXX_Size() int { - return m.Size() +func (x *ProtoDomainsResponse) Reset() { + *x = ProtoDomainsResponse{} + mi := &file_domain_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DomainsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DomainsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DomainsResponse proto.InternalMessageInfo -func (m *DomainsResponse) GetError() *Error { - if m != nil { - return m.Error - } - return nil +func (x *ProtoDomainsResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DomainsResponse) GetDomains() []string { - if m != nil { - return m.Domains - } - return nil -} +func (*ProtoDomainsResponse) ProtoMessage() {} -type UpsertDomainResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *UpsertDomainResponse) Reset() { *m = UpsertDomainResponse{} } -func (*UpsertDomainResponse) ProtoMessage() {} -func (*UpsertDomainResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_73e6234e76dbdb84, []int{1} -} -func (m *UpsertDomainResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpsertDomainResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpsertDomainResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoDomainsResponse) ProtoReflect() protoreflect.Message { + mi := &file_domain_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil - } -} -func (m *UpsertDomainResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpsertDomainResponse.Merge(m, src) -} -func (m *UpsertDomainResponse) XXX_Size() int { - return m.Size() -} -func (m *UpsertDomainResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpsertDomainResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UpsertDomainResponse proto.InternalMessageInfo - -func (m *UpsertDomainResponse) GetError() *Error { - if m != nil { - return m.Error + return ms } - return nil -} - -type UpsertDomainRequest struct { - Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain"` - Ttl uint32 `protobuf:"varint,2,opt,name=ttl,proto3" json:"ttl"` + return mi.MessageOf(x) } -func (m *UpsertDomainRequest) Reset() { *m = UpsertDomainRequest{} } -func (*UpsertDomainRequest) ProtoMessage() {} -func (*UpsertDomainRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_73e6234e76dbdb84, []int{2} +// Deprecated: Use ProtoDomainsResponse.ProtoReflect.Descriptor instead. +func (*ProtoDomainsResponse) Descriptor() ([]byte, []int) { + return file_domain_proto_rawDescGZIP(), []int{0} } -func (m *UpsertDomainRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpsertDomainRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpsertDomainRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpsertDomainRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpsertDomainRequest.Merge(m, src) -} -func (m *UpsertDomainRequest) XXX_Size() int { - return m.Size() -} -func (m *UpsertDomainRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpsertDomainRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpsertDomainRequest proto.InternalMessageInfo -func (m *UpsertDomainRequest) GetDomain() string { - if m != nil { - return m.Domain +func (x *ProtoDomainsResponse) GetError() *ProtoError { + if x != nil { + return x.Error } - return "" + return nil } -func (m *UpsertDomainRequest) GetTtl() uint32 { - if m != nil { - return m.Ttl +func (x *ProtoDomainsResponse) GetDomains() []string { + if x != nil { + return x.Domains } - return 0 + return nil } -func init() { - proto.RegisterType((*DomainsResponse)(nil), "models.DomainsResponse") - proto.RegisterType((*UpsertDomainResponse)(nil), "models.UpsertDomainResponse") - proto.RegisterType((*UpsertDomainRequest)(nil), "models.UpsertDomainRequest") +type ProtoUpsertDomainResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { proto.RegisterFile("domain.proto", fileDescriptor_73e6234e76dbdb84) } - -var fileDescriptor_73e6234e76dbdb84 = []byte{ - // 271 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0xc9, 0xcf, 0x4d, - 0xcc, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xcb, 0xcd, 0x4f, 0x49, 0xcd, 0x29, - 0x96, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, - 0xcf, 0xd7, 0x07, 0x4b, 0x27, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0xd1, 0x26, 0xc5, - 0x9d, 0x5a, 0x54, 0x94, 0x5f, 0x04, 0xe1, 0x28, 0x05, 0x70, 0xf1, 0xbb, 0x80, 0xcd, 0x2c, 0x0e, - 0x4a, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x15, 0x52, 0xe6, 0x62, 0x05, 0xab, 0x90, 0x60, 0x54, - 0x60, 0xd4, 0xe0, 0x36, 0xe2, 0xd5, 0x83, 0x58, 0xa3, 0xe7, 0x0a, 0x12, 0x0c, 0x82, 0xc8, 0x09, - 0x49, 0x70, 0xb1, 0x43, 0xdc, 0x52, 0x2c, 0xc1, 0xa4, 0xc0, 0xac, 0xc1, 0x19, 0x04, 0xe3, 0x2a, - 0x59, 0x73, 0x89, 0x84, 0x16, 0x14, 0xa7, 0x16, 0x95, 0x40, 0xcc, 0x25, 0xc9, 0x58, 0xa5, 0x10, - 0x2e, 0x61, 0x54, 0xcd, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x42, 0x4a, 0x5c, 0x6c, 0x10, 0xe3, 0xc1, - 0x9a, 0x39, 0x9d, 0xb8, 0x5e, 0xdd, 0x93, 0x87, 0x8a, 0x04, 0x41, 0x69, 0x21, 0x49, 0x2e, 0xe6, - 0x92, 0x92, 0x1c, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x5e, 0x27, 0xf6, 0x57, 0xf7, 0xe4, 0x41, 0xdc, - 0x20, 0x10, 0xe1, 0x64, 0x72, 0xe1, 0xa1, 0x1c, 0xc3, 0x8d, 0x87, 0x72, 0x0c, 0x1f, 0x1e, 0xca, - 0x31, 0x36, 0x3c, 0x92, 0x63, 0x5c, 0xf1, 0x48, 0x8e, 0xe1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, - 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x7c, 0xf1, 0x48, 0x8e, 0xe1, 0xc3, 0x23, 0x39, 0xc6, 0x09, - 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x89, 0x0d, 0x1c, 0x42, - 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2a, 0xd1, 0x20, 0xc4, 0x75, 0x01, 0x00, 0x00, +func (x *ProtoUpsertDomainResponse) Reset() { + *x = ProtoUpsertDomainResponse{} + mi := &file_domain_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (this *DomainsResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.DomainsResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - s = append(s, "Domains: "+fmt.Sprintf("%#v", this.Domains)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UpsertDomainResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.UpsertDomainResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UpsertDomainRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.UpsertDomainRequest{") - s = append(s, "Domain: "+fmt.Sprintf("%#v", this.Domain)+",\n") - s = append(s, "Ttl: "+fmt.Sprintf("%#v", this.Ttl)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringDomain(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *DomainsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *ProtoUpsertDomainResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DomainsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func (*ProtoUpsertDomainResponse) ProtoMessage() {} -func (m *DomainsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Domains) > 0 { - for iNdEx := len(m.Domains) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Domains[iNdEx]) - copy(dAtA[i:], m.Domains[iNdEx]) - i = encodeVarintDomain(dAtA, i, uint64(len(m.Domains[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDomain(dAtA, i, uint64(size)) +func (x *ProtoUpsertDomainResponse) ProtoReflect() protoreflect.Message { + mi := &file_domain_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpsertDomainResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + return ms } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *UpsertDomainResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoUpsertDomainResponse.ProtoReflect.Descriptor instead. +func (*ProtoUpsertDomainResponse) Descriptor() ([]byte, []int) { + return file_domain_proto_rawDescGZIP(), []int{1} } -func (m *UpsertDomainResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDomain(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func (x *ProtoUpsertDomainResponse) GetError() *ProtoError { + if x != nil { + return x.Error } - return len(dAtA) - i, nil + return nil } -func (m *UpsertDomainRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +type ProtoUpsertDomainRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` + Ttl uint32 `protobuf:"varint,2,opt,name=ttl,proto3" json:"ttl,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *UpsertDomainRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *ProtoUpsertDomainRequest) Reset() { + *x = ProtoUpsertDomainRequest{} + mi := &file_domain_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *UpsertDomainRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Ttl != 0 { - i = encodeVarintDomain(dAtA, i, uint64(m.Ttl)) - i-- - dAtA[i] = 0x10 - } - if len(m.Domain) > 0 { - i -= len(m.Domain) - copy(dAtA[i:], m.Domain) - i = encodeVarintDomain(dAtA, i, uint64(len(m.Domain))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func (x *ProtoUpsertDomainRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func encodeVarintDomain(dAtA []byte, offset int, v uint64) int { - offset -= sovDomain(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *DomainsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovDomain(uint64(l)) - } - if len(m.Domains) > 0 { - for _, s := range m.Domains { - l = len(s) - n += 1 + l + sovDomain(uint64(l)) +func (*ProtoUpsertDomainRequest) ProtoMessage() {} + +func (x *ProtoUpsertDomainRequest) ProtoReflect() protoreflect.Message { + mi := &file_domain_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return n + return mi.MessageOf(x) } -func (m *UpsertDomainResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovDomain(uint64(l)) - } - return n +// Deprecated: Use ProtoUpsertDomainRequest.ProtoReflect.Descriptor instead. +func (*ProtoUpsertDomainRequest) Descriptor() ([]byte, []int) { + return file_domain_proto_rawDescGZIP(), []int{2} } -func (m *UpsertDomainRequest) Size() (n int) { - if m == nil { - return 0 +func (x *ProtoUpsertDomainRequest) GetDomain() string { + if x != nil { + return x.Domain } - var l int - _ = l - l = len(m.Domain) - if l > 0 { - n += 1 + l + sovDomain(uint64(l)) - } - if m.Ttl != 0 { - n += 1 + sovDomain(uint64(m.Ttl)) - } - return n + return "" } -func sovDomain(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozDomain(x uint64) (n int) { - return sovDomain(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *DomainsResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DomainsResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `Domains:` + fmt.Sprintf("%v", this.Domains) + `,`, - `}`, - }, "") - return s -} -func (this *UpsertDomainResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpsertDomainResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpsertDomainRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpsertDomainRequest{`, - `Domain:` + fmt.Sprintf("%v", this.Domain) + `,`, - `Ttl:` + fmt.Sprintf("%v", this.Ttl) + `,`, - `}`, - }, "") - return s -} -func valueToStringDomain(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *DomainsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDomain - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DomainsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DomainsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDomain - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDomain - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDomain - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domains", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDomain - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDomain - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDomain - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domains = append(m.Domains, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDomain(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDomain - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } +func (x *ProtoUpsertDomainRequest) GetTtl() uint32 { + if x != nil { + return x.Ttl } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil + return 0 } -func (m *UpsertDomainResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDomain - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UpsertDomainResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpsertDomainResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDomain - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDomain - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDomain - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDomain(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDomain - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpsertDomainRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDomain - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UpsertDomainRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpsertDomainRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDomain - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDomain - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDomain - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Ttl", wireType) - } - m.Ttl = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDomain - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Ttl |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipDomain(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDomain - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var File_domain_proto protoreflect.FileDescriptor - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDomain(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDomain - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDomain - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDomain - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthDomain - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupDomain - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthDomain - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +const file_domain_proto_rawDesc = "" + + "\n" + + "\fdomain.proto\x12\x06models\x1a\tbbs.proto\x1a\verror.proto\"Z\n" + + "\x14ProtoDomainsResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\x12\x18\n" + + "\adomains\x18\x02 \x03(\tR\adomains\"E\n" + + "\x19ProtoUpsertDomainResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\"N\n" + + "\x18ProtoUpsertDomainRequest\x12\x1b\n" + + "\x06domain\x18\x01 \x01(\tB\x03\xc0>\x01R\x06domain\x12\x15\n" + + "\x03ttl\x18\x02 \x01(\rB\x03\xc0>\x01R\x03ttlB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthDomain = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDomain = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupDomain = fmt.Errorf("proto: unexpected end of group") + file_domain_proto_rawDescOnce sync.Once + file_domain_proto_rawDescData []byte ) + +func file_domain_proto_rawDescGZIP() []byte { + file_domain_proto_rawDescOnce.Do(func() { + file_domain_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_domain_proto_rawDesc), len(file_domain_proto_rawDesc))) + }) + return file_domain_proto_rawDescData +} + +var file_domain_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_domain_proto_goTypes = []any{ + (*ProtoDomainsResponse)(nil), // 0: models.ProtoDomainsResponse + (*ProtoUpsertDomainResponse)(nil), // 1: models.ProtoUpsertDomainResponse + (*ProtoUpsertDomainRequest)(nil), // 2: models.ProtoUpsertDomainRequest + (*ProtoError)(nil), // 3: models.ProtoError +} +var file_domain_proto_depIdxs = []int32{ + 3, // 0: models.ProtoDomainsResponse.error:type_name -> models.ProtoError + 3, // 1: models.ProtoUpsertDomainResponse.error:type_name -> models.ProtoError + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_domain_proto_init() } +func file_domain_proto_init() { + if File_domain_proto != nil { + return + } + file_bbs_proto_init() + file_error_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_domain_proto_rawDesc), len(file_domain_proto_rawDesc)), + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_domain_proto_goTypes, + DependencyIndexes: file_domain_proto_depIdxs, + MessageInfos: file_domain_proto_msgTypes, + }.Build() + File_domain_proto = out.File + file_domain_proto_goTypes = nil + file_domain_proto_depIdxs = nil +} diff --git a/models/domain.proto b/models/domain.proto index 7028f0f7..d21a0dc9 100644 --- a/models/domain.proto +++ b/models/domain.proto @@ -1,22 +1,21 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; import "error.proto"; -option (gogoproto.equal_all) = false; - -message DomainsResponse { - Error error = 1; +message ProtoDomainsResponse { + ProtoError error = 1; repeated string domains = 2; } -message UpsertDomainResponse { - Error error = 1; +message ProtoUpsertDomainResponse { + ProtoError error = 1; } -message UpsertDomainRequest { - string domain = 1 [(gogoproto.jsontag) = "domain"]; - uint32 ttl = 2 [(gogoproto.jsontag) = "ttl"]; +message ProtoUpsertDomainRequest { + string domain = 1 [json_name = "domain", (bbs.bbs_json_always_emit) = true]; + uint32 ttl = 2 [json_name = "ttl", (bbs.bbs_json_always_emit) = true]; } diff --git a/models/domain_bbs.pb.go b/models/domain_bbs.pb.go new file mode 100644 index 00000000..880722e8 --- /dev/null +++ b/models/domain_bbs.pb.go @@ -0,0 +1,323 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: domain.proto + +package models + +// Prevent copylock errors when using ProtoDomainsResponse directly +type DomainsResponse struct { + Error *Error `json:"error,omitempty"` + Domains []string `json:"domains,omitempty"` +} + +func (this *DomainsResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DomainsResponse) + if !ok { + that2, ok := that.(DomainsResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + if this.Domains == nil { + if that1.Domains != nil { + return false + } + } else if len(this.Domains) != len(that1.Domains) { + return false + } + for i := range this.Domains { + if this.Domains[i] != that1.Domains[i] { + return false + } + } + return true +} +func (m *DomainsResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *DomainsResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (m *DomainsResponse) GetDomains() []string { + if m != nil { + return m.Domains + } + return nil +} +func (m *DomainsResponse) SetDomains(value []string) { + if m != nil { + m.Domains = value + } +} +func (x *DomainsResponse) ToProto() *ProtoDomainsResponse { + if x == nil { + return nil + } + + proto := &ProtoDomainsResponse{ + Error: x.Error.ToProto(), + Domains: x.Domains, + } + return proto +} + +func (x *ProtoDomainsResponse) FromProto() *DomainsResponse { + if x == nil { + return nil + } + + copysafe := &DomainsResponse{ + Error: x.Error.FromProto(), + Domains: x.Domains, + } + return copysafe +} + +func DomainsResponseToProtoSlice(values []*DomainsResponse) []*ProtoDomainsResponse { + if values == nil { + return nil + } + result := make([]*ProtoDomainsResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DomainsResponseFromProtoSlice(values []*ProtoDomainsResponse) []*DomainsResponse { + if values == nil { + return nil + } + result := make([]*DomainsResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoUpsertDomainResponse directly +type UpsertDomainResponse struct { + Error *Error `json:"error,omitempty"` +} + +func (this *UpsertDomainResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*UpsertDomainResponse) + if !ok { + that2, ok := that.(UpsertDomainResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + return true +} +func (m *UpsertDomainResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *UpsertDomainResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (x *UpsertDomainResponse) ToProto() *ProtoUpsertDomainResponse { + if x == nil { + return nil + } + + proto := &ProtoUpsertDomainResponse{ + Error: x.Error.ToProto(), + } + return proto +} + +func (x *ProtoUpsertDomainResponse) FromProto() *UpsertDomainResponse { + if x == nil { + return nil + } + + copysafe := &UpsertDomainResponse{ + Error: x.Error.FromProto(), + } + return copysafe +} + +func UpsertDomainResponseToProtoSlice(values []*UpsertDomainResponse) []*ProtoUpsertDomainResponse { + if values == nil { + return nil + } + result := make([]*ProtoUpsertDomainResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func UpsertDomainResponseFromProtoSlice(values []*ProtoUpsertDomainResponse) []*UpsertDomainResponse { + if values == nil { + return nil + } + result := make([]*UpsertDomainResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoUpsertDomainRequest directly +type UpsertDomainRequest struct { + Domain string `json:"domain"` + Ttl uint32 `json:"ttl"` +} + +func (this *UpsertDomainRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*UpsertDomainRequest) + if !ok { + that2, ok := that.(UpsertDomainRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Domain != that1.Domain { + return false + } + if this.Ttl != that1.Ttl { + return false + } + return true +} +func (m *UpsertDomainRequest) GetDomain() string { + if m != nil { + return m.Domain + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *UpsertDomainRequest) SetDomain(value string) { + if m != nil { + m.Domain = value + } +} +func (m *UpsertDomainRequest) GetTtl() uint32 { + if m != nil { + return m.Ttl + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} +func (m *UpsertDomainRequest) SetTtl(value uint32) { + if m != nil { + m.Ttl = value + } +} +func (x *UpsertDomainRequest) ToProto() *ProtoUpsertDomainRequest { + if x == nil { + return nil + } + + proto := &ProtoUpsertDomainRequest{ + Domain: x.Domain, + Ttl: x.Ttl, + } + return proto +} + +func (x *ProtoUpsertDomainRequest) FromProto() *UpsertDomainRequest { + if x == nil { + return nil + } + + copysafe := &UpsertDomainRequest{ + Domain: x.Domain, + Ttl: x.Ttl, + } + return copysafe +} + +func UpsertDomainRequestToProtoSlice(values []*UpsertDomainRequest) []*ProtoUpsertDomainRequest { + if values == nil { + return nil + } + result := make([]*ProtoUpsertDomainRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func UpsertDomainRequestFromProtoSlice(values []*ProtoUpsertDomainRequest) []*UpsertDomainRequest { + if values == nil { + return nil + } + result := make([]*UpsertDomainRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/domains.go b/models/domains.go index a94ee90c..b5bdd0f8 100644 --- a/models/domains.go +++ b/models/domains.go @@ -25,6 +25,10 @@ func NewDomainSet(domains []string) DomainSet { return domainSet } +func (request *ProtoUpsertDomainRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *UpsertDomainRequest) Validate() error { var validationError ValidationError diff --git a/models/environment_variables.go b/models/environment_variables.go index 49185848..6e4381ae 100644 --- a/models/environment_variables.go +++ b/models/environment_variables.go @@ -1,8 +1,10 @@ package models -import "errors" +import ( + "errors" +) -func (envVar EnvironmentVariable) Validate() error { +func (envVar *EnvironmentVariable) Validate() error { if envVar.Name == "" { return errors.New("invalid field: name cannot be blank") } diff --git a/models/environment_variables.pb.go b/models/environment_variables.pb.go index c3db470a..b1679266 100644 --- a/models/environment_variables.pb.go +++ b/models/environment_variables.pb.go @@ -1,436 +1,132 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: environment_variables.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type EnvironmentVariable struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value"` -} - -func (m *EnvironmentVariable) Reset() { *m = EnvironmentVariable{} } -func (*EnvironmentVariable) ProtoMessage() {} -func (*EnvironmentVariable) Descriptor() ([]byte, []int) { - return fileDescriptor_8938dda491bd78a1, []int{0} -} -func (m *EnvironmentVariable) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EnvironmentVariable) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EnvironmentVariable.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EnvironmentVariable) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnvironmentVariable.Merge(m, src) -} -func (m *EnvironmentVariable) XXX_Size() int { - return m.Size() -} -func (m *EnvironmentVariable) XXX_DiscardUnknown() { - xxx_messageInfo_EnvironmentVariable.DiscardUnknown(m) -} - -var xxx_messageInfo_EnvironmentVariable proto.InternalMessageInfo - -func (m *EnvironmentVariable) GetName() string { - if m != nil { - return m.Name - } - return "" -} +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -func (m *EnvironmentVariable) GetValue() string { - if m != nil { - return m.Value - } - return "" +type ProtoEnvironmentVariable struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { - proto.RegisterType((*EnvironmentVariable)(nil), "models.EnvironmentVariable") +func (x *ProtoEnvironmentVariable) Reset() { + *x = ProtoEnvironmentVariable{} + mi := &file_environment_variables_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func init() { proto.RegisterFile("environment_variables.proto", fileDescriptor_8938dda491bd78a1) } - -var fileDescriptor_8938dda491bd78a1 = []byte{ - // 209 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xcd, 0x2b, 0xcb, - 0x2c, 0xca, 0xcf, 0xcb, 0x4d, 0xcd, 0x2b, 0x89, 0x2f, 0x4b, 0x2c, 0xca, 0x4c, 0x4c, 0xca, 0x49, - 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xcb, 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0x96, - 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, - 0xd7, 0x07, 0x4b, 0x27, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0xd1, 0xa6, 0x14, 0xc2, - 0x25, 0xec, 0x8a, 0x30, 0x35, 0x0c, 0x6a, 0xa8, 0x90, 0x0c, 0x17, 0x4b, 0x5e, 0x62, 0x6e, 0xaa, - 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xa7, 0x13, 0xc7, 0xab, 0x7b, 0xf2, 0x60, 0x7e, 0x10, 0x98, 0x14, - 0x92, 0xe7, 0x62, 0x2d, 0x4b, 0xcc, 0x29, 0x4d, 0x95, 0x60, 0x02, 0x4b, 0x73, 0xbe, 0xba, 0x27, - 0x0f, 0x11, 0x08, 0x82, 0x50, 0x4e, 0x26, 0x17, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xf0, - 0xe1, 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, - 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x3c, 0x92, - 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0x92, 0xd8, - 0xc0, 0x4e, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x1b, 0x8a, 0x91, 0xe1, 0xe8, 0x00, 0x00, - 0x00, +func (x *ProtoEnvironmentVariable) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *EnvironmentVariable) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoEnvironmentVariable) ProtoMessage() {} - that1, ok := that.(*EnvironmentVariable) - if !ok { - that2, ok := that.(EnvironmentVariable) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoEnvironmentVariable) ProtoReflect() protoreflect.Message { + mi := &file_environment_variables_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Value != that1.Value { - return false - } - return true -} -func (this *EnvironmentVariable) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.EnvironmentVariable{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringEnvironmentVariables(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *EnvironmentVariable) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *EnvironmentVariable) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoEnvironmentVariable.ProtoReflect.Descriptor instead. +func (*ProtoEnvironmentVariable) Descriptor() ([]byte, []int) { + return file_environment_variables_proto_rawDescGZIP(), []int{0} } -func (m *EnvironmentVariable) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintEnvironmentVariables(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintEnvironmentVariables(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa +func (x *ProtoEnvironmentVariable) GetName() string { + if x != nil { + return x.Name } - return len(dAtA) - i, nil + return "" } -func encodeVarintEnvironmentVariables(dAtA []byte, offset int, v uint64) int { - offset -= sovEnvironmentVariables(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EnvironmentVariable) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovEnvironmentVariables(uint64(l)) +func (x *ProtoEnvironmentVariable) GetValue() string { + if x != nil { + return x.Value } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovEnvironmentVariables(uint64(l)) - } - return n + return "" } -func sovEnvironmentVariables(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEnvironmentVariables(x uint64) (n int) { - return sovEnvironmentVariables(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *EnvironmentVariable) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&EnvironmentVariable{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s -} -func valueToStringEnvironmentVariables(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *EnvironmentVariable) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEnvironmentVariables - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EnvironmentVariable: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EnvironmentVariable: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEnvironmentVariables - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEnvironmentVariables - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEnvironmentVariables - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEnvironmentVariables - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEnvironmentVariables - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEnvironmentVariables - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEnvironmentVariables(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEnvironmentVariables - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var File_environment_variables_proto protoreflect.FileDescriptor - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEnvironmentVariables(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEnvironmentVariables - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEnvironmentVariables - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEnvironmentVariables - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthEnvironmentVariables - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEnvironmentVariables - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEnvironmentVariables - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +const file_environment_variables_proto_rawDesc = "" + + "\n" + + "\x1benvironment_variables.proto\x12\x06models\x1a\tbbs.proto\"N\n" + + "\x18ProtoEnvironmentVariable\x12\x17\n" + + "\x04name\x18\x01 \x01(\tB\x03\xc0>\x01R\x04name\x12\x19\n" + + "\x05value\x18\x02 \x01(\tB\x03\xc0>\x01R\x05valueB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthEnvironmentVariables = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEnvironmentVariables = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEnvironmentVariables = fmt.Errorf("proto: unexpected end of group") + file_environment_variables_proto_rawDescOnce sync.Once + file_environment_variables_proto_rawDescData []byte ) + +func file_environment_variables_proto_rawDescGZIP() []byte { + file_environment_variables_proto_rawDescOnce.Do(func() { + file_environment_variables_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_environment_variables_proto_rawDesc), len(file_environment_variables_proto_rawDesc))) + }) + return file_environment_variables_proto_rawDescData +} + +var file_environment_variables_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_environment_variables_proto_goTypes = []any{ + (*ProtoEnvironmentVariable)(nil), // 0: models.ProtoEnvironmentVariable +} +var file_environment_variables_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_environment_variables_proto_init() } +func file_environment_variables_proto_init() { + if File_environment_variables_proto != nil { + return + } + file_bbs_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_environment_variables_proto_rawDesc), len(file_environment_variables_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_environment_variables_proto_goTypes, + DependencyIndexes: file_environment_variables_proto_depIdxs, + MessageInfos: file_environment_variables_proto_msgTypes, + }.Build() + File_environment_variables_proto = out.File + file_environment_variables_proto_goTypes = nil + file_environment_variables_proto_depIdxs = nil +} diff --git a/models/environment_variables.proto b/models/environment_variables.proto index 390aa783..36464506 100644 --- a/models/environment_variables.proto +++ b/models/environment_variables.proto @@ -1,10 +1,11 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; -message EnvironmentVariable { - string name = 1 [(gogoproto.jsontag) = "name"]; - string value = 2 [(gogoproto.jsontag) = "value"]; +message ProtoEnvironmentVariable { + string name = 1 [json_name = "name", (bbs.bbs_json_always_emit) = true]; + string value = 2 [json_name = "value", (bbs.bbs_json_always_emit) = true]; } diff --git a/models/environment_variables_bbs.pb.go b/models/environment_variables_bbs.pb.go new file mode 100644 index 00000000..fc19804f --- /dev/null +++ b/models/environment_variables_bbs.pb.go @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: environment_variables.proto + +package models + +// Prevent copylock errors when using ProtoEnvironmentVariable directly +type EnvironmentVariable struct { + Name string `json:"name"` + Value string `json:"value"` +} + +func (this *EnvironmentVariable) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*EnvironmentVariable) + if !ok { + that2, ok := that.(EnvironmentVariable) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Name != that1.Name { + return false + } + if this.Value != that1.Value { + return false + } + return true +} +func (m *EnvironmentVariable) GetName() string { + if m != nil { + return m.Name + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *EnvironmentVariable) SetName(value string) { + if m != nil { + m.Name = value + } +} +func (m *EnvironmentVariable) GetValue() string { + if m != nil { + return m.Value + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *EnvironmentVariable) SetValue(value string) { + if m != nil { + m.Value = value + } +} +func (x *EnvironmentVariable) ToProto() *ProtoEnvironmentVariable { + if x == nil { + return nil + } + + proto := &ProtoEnvironmentVariable{ + Name: x.Name, + Value: x.Value, + } + return proto +} + +func (x *ProtoEnvironmentVariable) FromProto() *EnvironmentVariable { + if x == nil { + return nil + } + + copysafe := &EnvironmentVariable{ + Name: x.Name, + Value: x.Value, + } + return copysafe +} + +func EnvironmentVariableToProtoSlice(values []*EnvironmentVariable) []*ProtoEnvironmentVariable { + if values == nil { + return nil + } + result := make([]*ProtoEnvironmentVariable, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func EnvironmentVariableFromProtoSlice(values []*ProtoEnvironmentVariable) []*EnvironmentVariable { + if values == nil { + return nil + } + result := make([]*EnvironmentVariable, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/error.pb.go b/models/error.pb.go index 039ca6d6..00fe87c6 100644 --- a/models/error.pb.go +++ b/models/error.pb.go @@ -1,515 +1,280 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: error.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strconv "strconv" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -type Error_Type int32 +type ProtoError_Type int32 const ( - Error_UnknownError Error_Type = 0 - Error_InvalidRecord Error_Type = 3 - Error_InvalidRequest Error_Type = 4 - Error_InvalidResponse Error_Type = 5 - Error_InvalidProtobufMessage Error_Type = 6 - Error_InvalidJSON Error_Type = 7 - Error_FailedToOpenEnvelope Error_Type = 8 - Error_InvalidStateTransition Error_Type = 9 - Error_ResourceConflict Error_Type = 11 - Error_ResourceExists Error_Type = 12 - Error_ResourceNotFound Error_Type = 13 - Error_RouterError Error_Type = 14 - Error_ActualLRPCannotBeClaimed Error_Type = 15 - Error_ActualLRPCannotBeStarted Error_Type = 16 - Error_ActualLRPCannotBeCrashed Error_Type = 17 - Error_ActualLRPCannotBeFailed Error_Type = 18 - Error_ActualLRPCannotBeRemoved Error_Type = 19 - Error_ActualLRPCannotBeUnclaimed Error_Type = 21 - Error_RunningOnDifferentCell Error_Type = 24 - Error_GUIDGeneration Error_Type = 26 - Error_Deserialize Error_Type = 27 - Error_Deadlock Error_Type = 28 - Error_Unrecoverable Error_Type = 29 - Error_LockCollision Error_Type = 30 - Error_Timeout Error_Type = 31 + ProtoError_UnknownError ProtoError_Type = 0 + ProtoError_InvalidRecord ProtoError_Type = 3 + ProtoError_InvalidRequest ProtoError_Type = 4 + ProtoError_InvalidResponse ProtoError_Type = 5 + ProtoError_InvalidProtobufMessage ProtoError_Type = 6 + ProtoError_InvalidJSON ProtoError_Type = 7 + ProtoError_FailedToOpenEnvelope ProtoError_Type = 8 + ProtoError_InvalidStateTransition ProtoError_Type = 9 + ProtoError_ResourceConflict ProtoError_Type = 11 + ProtoError_ResourceExists ProtoError_Type = 12 + ProtoError_ResourceNotFound ProtoError_Type = 13 + ProtoError_RouterError ProtoError_Type = 14 + ProtoError_ActualLRPCannotBeClaimed ProtoError_Type = 15 + ProtoError_ActualLRPCannotBeStarted ProtoError_Type = 16 + ProtoError_ActualLRPCannotBeCrashed ProtoError_Type = 17 + ProtoError_ActualLRPCannotBeFailed ProtoError_Type = 18 + ProtoError_ActualLRPCannotBeRemoved ProtoError_Type = 19 + ProtoError_ActualLRPCannotBeUnclaimed ProtoError_Type = 21 + ProtoError_RunningOnDifferentCell ProtoError_Type = 24 + ProtoError_GUIDGeneration ProtoError_Type = 26 + ProtoError_Deserialize ProtoError_Type = 27 + ProtoError_Deadlock ProtoError_Type = 28 + ProtoError_Unrecoverable ProtoError_Type = 29 + ProtoError_LockCollision ProtoError_Type = 30 + ProtoError_Timeout ProtoError_Type = 31 ) -var Error_Type_name = map[int32]string{ - 0: "UnknownError", - 3: "InvalidRecord", - 4: "InvalidRequest", - 5: "InvalidResponse", - 6: "InvalidProtobufMessage", - 7: "InvalidJSON", - 8: "FailedToOpenEnvelope", - 9: "InvalidStateTransition", - 11: "ResourceConflict", - 12: "ResourceExists", - 13: "ResourceNotFound", - 14: "RouterError", - 15: "ActualLRPCannotBeClaimed", - 16: "ActualLRPCannotBeStarted", - 17: "ActualLRPCannotBeCrashed", - 18: "ActualLRPCannotBeFailed", - 19: "ActualLRPCannotBeRemoved", - 21: "ActualLRPCannotBeUnclaimed", - 24: "RunningOnDifferentCell", - 26: "GUIDGeneration", - 27: "Deserialize", - 28: "Deadlock", - 29: "Unrecoverable", - 30: "LockCollision", - 31: "Timeout", -} +// Enum value maps for ProtoError_Type. +var ( + ProtoError_Type_name = map[int32]string{ + 0: "UnknownError", + 3: "InvalidRecord", + 4: "InvalidRequest", + 5: "InvalidResponse", + 6: "InvalidProtobufMessage", + 7: "InvalidJSON", + 8: "FailedToOpenEnvelope", + 9: "InvalidStateTransition", + 11: "ResourceConflict", + 12: "ResourceExists", + 13: "ResourceNotFound", + 14: "RouterError", + 15: "ActualLRPCannotBeClaimed", + 16: "ActualLRPCannotBeStarted", + 17: "ActualLRPCannotBeCrashed", + 18: "ActualLRPCannotBeFailed", + 19: "ActualLRPCannotBeRemoved", + 21: "ActualLRPCannotBeUnclaimed", + 24: "RunningOnDifferentCell", + 26: "GUIDGeneration", + 27: "Deserialize", + 28: "Deadlock", + 29: "Unrecoverable", + 30: "LockCollision", + 31: "Timeout", + } + ProtoError_Type_value = map[string]int32{ + "UnknownError": 0, + "InvalidRecord": 3, + "InvalidRequest": 4, + "InvalidResponse": 5, + "InvalidProtobufMessage": 6, + "InvalidJSON": 7, + "FailedToOpenEnvelope": 8, + "InvalidStateTransition": 9, + "ResourceConflict": 11, + "ResourceExists": 12, + "ResourceNotFound": 13, + "RouterError": 14, + "ActualLRPCannotBeClaimed": 15, + "ActualLRPCannotBeStarted": 16, + "ActualLRPCannotBeCrashed": 17, + "ActualLRPCannotBeFailed": 18, + "ActualLRPCannotBeRemoved": 19, + "ActualLRPCannotBeUnclaimed": 21, + "RunningOnDifferentCell": 24, + "GUIDGeneration": 26, + "Deserialize": 27, + "Deadlock": 28, + "Unrecoverable": 29, + "LockCollision": 30, + "Timeout": 31, + } +) -var Error_Type_value = map[string]int32{ - "UnknownError": 0, - "InvalidRecord": 3, - "InvalidRequest": 4, - "InvalidResponse": 5, - "InvalidProtobufMessage": 6, - "InvalidJSON": 7, - "FailedToOpenEnvelope": 8, - "InvalidStateTransition": 9, - "ResourceConflict": 11, - "ResourceExists": 12, - "ResourceNotFound": 13, - "RouterError": 14, - "ActualLRPCannotBeClaimed": 15, - "ActualLRPCannotBeStarted": 16, - "ActualLRPCannotBeCrashed": 17, - "ActualLRPCannotBeFailed": 18, - "ActualLRPCannotBeRemoved": 19, - "ActualLRPCannotBeUnclaimed": 21, - "RunningOnDifferentCell": 24, - "GUIDGeneration": 26, - "Deserialize": 27, - "Deadlock": 28, - "Unrecoverable": 29, - "LockCollision": 30, - "Timeout": 31, +func (x ProtoError_Type) Enum() *ProtoError_Type { + p := new(ProtoError_Type) + *p = x + return p } -func (Error_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0579b252106fcf4a, []int{0, 0} +func (x ProtoError_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -type Error struct { - Type Error_Type `protobuf:"varint,1,opt,name=type,proto3,enum=models.Error_Type" json:"type"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message"` +func (ProtoError_Type) Descriptor() protoreflect.EnumDescriptor { + return file_error_proto_enumTypes[0].Descriptor() } -func (m *Error) Reset() { *m = Error{} } -func (*Error) ProtoMessage() {} -func (*Error) Descriptor() ([]byte, []int) { - return fileDescriptor_0579b252106fcf4a, []int{0} -} -func (m *Error) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Error.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Error) XXX_Merge(src proto.Message) { - xxx_messageInfo_Error.Merge(m, src) -} -func (m *Error) XXX_Size() int { - return m.Size() -} -func (m *Error) XXX_DiscardUnknown() { - xxx_messageInfo_Error.DiscardUnknown(m) +func (ProtoError_Type) Type() protoreflect.EnumType { + return &file_error_proto_enumTypes[0] } -var xxx_messageInfo_Error proto.InternalMessageInfo - -func (m *Error) GetType() Error_Type { - if m != nil { - return m.Type - } - return Error_UnknownError +func (x ProtoError_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *Error) GetMessage() string { - if m != nil { - return m.Message - } - return "" +// Deprecated: Use ProtoError_Type.Descriptor instead. +func (ProtoError_Type) EnumDescriptor() ([]byte, []int) { + return file_error_proto_rawDescGZIP(), []int{0, 0} } -func init() { - proto.RegisterEnum("models.Error_Type", Error_Type_name, Error_Type_value) - proto.RegisterType((*Error)(nil), "models.Error") +type ProtoError struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type ProtoError_Type `protobuf:"varint,1,opt,name=type,proto3,enum=models.ProtoError_Type" json:"type,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { proto.RegisterFile("error.proto", fileDescriptor_0579b252106fcf4a) } - -var fileDescriptor_0579b252106fcf4a = []byte{ - // 585 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0xcd, 0x4e, 0xdb, 0x4c, - 0x14, 0xb5, 0xf9, 0x0c, 0x98, 0x09, 0x3f, 0x97, 0x21, 0x1f, 0x84, 0x40, 0x07, 0x64, 0xa9, 0x12, - 0x9b, 0x86, 0xaa, 0xed, 0x0b, 0x34, 0x09, 0x20, 0x2a, 0x0a, 0xc8, 0x24, 0x0f, 0x30, 0xb1, 0x6f, - 0xc2, 0x88, 0xc9, 0x4c, 0x3a, 0x1e, 0xa7, 0xa5, 0xab, 0x3e, 0x42, 0x1f, 0xa3, 0x8f, 0xd2, 0x45, - 0x17, 0x2c, 0x59, 0xa1, 0x62, 0x36, 0x2d, 0x2b, 0x1e, 0xa1, 0xb2, 0x13, 0x10, 0x12, 0x6c, 0xac, - 0x7b, 0xcf, 0xb9, 0xe7, 0xf8, 0x9e, 0x6b, 0x99, 0x94, 0xd0, 0x18, 0x6d, 0x6a, 0x03, 0xa3, 0xad, - 0xa6, 0x53, 0x7d, 0x1d, 0xa3, 0x4c, 0xaa, 0xaf, 0x7a, 0xc2, 0x9e, 0xa6, 0x9d, 0x5a, 0xa4, 0xfb, - 0xdb, 0x3d, 0xdd, 0xd3, 0xdb, 0x05, 0xdd, 0x49, 0xbb, 0x45, 0x57, 0x34, 0x45, 0x35, 0x92, 0x05, - 0xbf, 0x26, 0xc9, 0xe4, 0x4e, 0x6e, 0x43, 0x5f, 0x13, 0xcf, 0x9e, 0x0f, 0xb0, 0xe2, 0x6e, 0xba, - 0x5b, 0xf3, 0x6f, 0x68, 0x6d, 0xe4, 0x57, 0x2b, 0xc8, 0x5a, 0xeb, 0x7c, 0x80, 0x75, 0xff, 0xf6, - 0x6a, 0xa3, 0x98, 0x09, 0x8b, 0x27, 0x7d, 0x49, 0xa6, 0xfb, 0x98, 0x24, 0xbc, 0x87, 0x95, 0x89, - 0x4d, 0x77, 0x6b, 0xa6, 0x5e, 0xba, 0xbd, 0xda, 0xb8, 0x87, 0xc2, 0xfb, 0x22, 0xf8, 0xeb, 0x11, - 0x2f, 0xd7, 0x53, 0x20, 0xb3, 0x6d, 0x75, 0xa6, 0xf4, 0x67, 0x55, 0x98, 0x82, 0x43, 0x17, 0xc9, - 0xdc, 0xbe, 0x1a, 0x72, 0x29, 0xe2, 0x10, 0x23, 0x6d, 0x62, 0xf8, 0x8f, 0x52, 0x32, 0xff, 0x00, - 0x7d, 0x4a, 0x31, 0xb1, 0xe0, 0xd1, 0x25, 0xb2, 0xf0, 0x80, 0x25, 0x03, 0xad, 0x12, 0x84, 0x49, - 0x5a, 0x25, 0xcb, 0x63, 0xf0, 0x78, 0x9c, 0xf0, 0xe3, 0xe8, 0x85, 0x30, 0x45, 0x17, 0x48, 0x69, - 0xcc, 0x7d, 0x38, 0x39, 0x3a, 0x84, 0x69, 0x5a, 0x21, 0xe5, 0x5d, 0x2e, 0x24, 0xc6, 0x2d, 0x7d, - 0x34, 0x40, 0xb5, 0xa3, 0x86, 0x28, 0xf5, 0x00, 0xc1, 0x7f, 0x64, 0x73, 0x62, 0xb9, 0xc5, 0x96, - 0xe1, 0x2a, 0x11, 0x56, 0x68, 0x05, 0x33, 0xb4, 0x4c, 0x20, 0xc4, 0x44, 0xa7, 0x26, 0xc2, 0x86, - 0x56, 0x5d, 0x29, 0x22, 0x0b, 0xa5, 0x7c, 0xc3, 0x7b, 0x74, 0xe7, 0x8b, 0x48, 0x6c, 0x02, 0xb3, - 0x8f, 0x27, 0x0f, 0xb5, 0xdd, 0xd5, 0xa9, 0x8a, 0x61, 0x2e, 0x5f, 0x23, 0xd4, 0xa9, 0x45, 0x33, - 0xca, 0x3b, 0x4f, 0xd7, 0x49, 0xe5, 0x7d, 0x64, 0x53, 0x2e, 0x0f, 0xc2, 0xe3, 0x06, 0x57, 0x4a, - 0xdb, 0x3a, 0x36, 0x24, 0x17, 0x7d, 0x8c, 0x61, 0xe1, 0x59, 0xf6, 0xc4, 0x72, 0x63, 0x31, 0x06, - 0x78, 0x5e, 0x6b, 0x78, 0x72, 0x8a, 0x31, 0x2c, 0xd2, 0x35, 0xb2, 0xf2, 0x84, 0x1d, 0x25, 0x06, - 0xfa, 0xac, 0x34, 0xc4, 0xbe, 0x1e, 0x62, 0x0c, 0x4b, 0x94, 0x91, 0xea, 0x13, 0xb6, 0xad, 0xa2, - 0xf1, 0x5a, 0xff, 0xe7, 0x17, 0x0a, 0x53, 0xa5, 0x84, 0xea, 0x1d, 0xa9, 0xa6, 0xe8, 0x76, 0xd1, - 0xa0, 0xb2, 0x0d, 0x94, 0x12, 0x2a, 0xf9, 0x2d, 0xf6, 0xda, 0xfb, 0xcd, 0x3d, 0x54, 0x68, 0x78, - 0x71, 0xb5, 0x6a, 0x9e, 0xba, 0x89, 0x09, 0x1a, 0xc1, 0xa5, 0xf8, 0x8a, 0xb0, 0x46, 0x67, 0x89, - 0xdf, 0x44, 0x1e, 0x4b, 0x1d, 0x9d, 0xc1, 0x7a, 0xfe, 0xcd, 0xdb, 0xca, 0x60, 0xa4, 0x87, 0x68, - 0x78, 0x47, 0x22, 0xbc, 0xc8, 0xa1, 0x03, 0x1d, 0x9d, 0x35, 0xb4, 0x94, 0x22, 0xc9, 0x4d, 0x18, - 0x2d, 0x91, 0xe9, 0x96, 0xe8, 0xa3, 0x4e, 0x2d, 0x6c, 0x04, 0x9e, 0xef, 0x82, 0x1b, 0x78, 0xfe, - 0x04, 0x4c, 0x04, 0x9e, 0x4f, 0x80, 0x04, 0x9e, 0x5f, 0x86, 0x72, 0xe0, 0xf9, 0xcb, 0xb0, 0x1c, - 0x78, 0xfe, 0x0a, 0xac, 0x04, 0x9e, 0xbf, 0x0a, 0xab, 0xf5, 0x77, 0x17, 0xd7, 0xcc, 0xbd, 0xbc, - 0x66, 0xce, 0xdd, 0x35, 0x73, 0xbf, 0x65, 0xcc, 0xfd, 0x91, 0x31, 0xe7, 0x67, 0xc6, 0xdc, 0x8b, - 0x8c, 0xb9, 0xbf, 0x33, 0xe6, 0xfe, 0xc9, 0x98, 0x73, 0x97, 0x31, 0xf7, 0xfb, 0x0d, 0x73, 0x2e, - 0x6e, 0x98, 0x73, 0x79, 0xc3, 0x9c, 0xce, 0x54, 0xf1, 0x2f, 0xbc, 0xfd, 0x17, 0x00, 0x00, 0xff, - 0xff, 0xf2, 0xb4, 0xa0, 0xf2, 0x51, 0x03, 0x00, 0x00, +func (x *ProtoError) Reset() { + *x = ProtoError{} + mi := &file_error_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (x Error_Type) String() string { - s, ok := Error_Type_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} -func (this *Error) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.Error{") - s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") - s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringError(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +func (x *ProtoError) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Error) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + +func (*ProtoError) ProtoMessage() {} + +func (x *ProtoError) ProtoReflect() protoreflect.Message { + mi := &file_error_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *Error) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoError.ProtoReflect.Descriptor instead. +func (*ProtoError) Descriptor() ([]byte, []int) { + return file_error_proto_rawDescGZIP(), []int{0} } -func (m *Error) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintError(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintError(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 +func (x *ProtoError) GetType() ProtoError_Type { + if x != nil { + return x.Type } - return len(dAtA) - i, nil + return ProtoError_UnknownError } -func encodeVarintError(dAtA []byte, offset int, v uint64) int { - offset -= sovError(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (x *ProtoError) GetMessage() string { + if x != nil { + return x.Message } - dAtA[offset] = uint8(v) - return base -} -func (m *Error) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovError(uint64(m.Type)) - } - l = len(m.Message) - if l > 0 { - n += 1 + l + sovError(uint64(l)) - } - return n + return "" } -func sovError(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozError(x uint64) (n int) { - return sovError(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +var File_error_proto protoreflect.FileDescriptor + +const file_error_proto_rawDesc = "" + + "\n" + + "\verror.proto\x12\x06models\x1a\tbbs.proto\"\xcc\x05\n" + + "\n" + + "ProtoError\x120\n" + + "\x04type\x18\x01 \x01(\x0e2\x17.models.ProtoError.TypeB\x03\xc0>\x01R\x04type\x12 \n" + + "\amessage\x18\x02 \x01(\tB\x06\xc0>\x01\xe0?\x01R\amessage\"\xe9\x04\n" + + "\x04Type\x12\x10\n" + + "\fUnknownError\x10\x00\x12\x11\n" + + "\rInvalidRecord\x10\x03\x12\x12\n" + + "\x0eInvalidRequest\x10\x04\x12\x13\n" + + "\x0fInvalidResponse\x10\x05\x12\x1a\n" + + "\x16InvalidProtobufMessage\x10\x06\x12\x0f\n" + + "\vInvalidJSON\x10\a\x12\x18\n" + + "\x14FailedToOpenEnvelope\x10\b\x12\x1a\n" + + "\x16InvalidStateTransition\x10\t\x12\x14\n" + + "\x10ResourceConflict\x10\v\x12\x12\n" + + "\x0eResourceExists\x10\f\x12\x14\n" + + "\x10ResourceNotFound\x10\r\x12\x0f\n" + + "\vRouterError\x10\x0e\x12\x1c\n" + + "\x18ActualLRPCannotBeClaimed\x10\x0f\x12\x1c\n" + + "\x18ActualLRPCannotBeStarted\x10\x10\x12\x1c\n" + + "\x18ActualLRPCannotBeCrashed\x10\x11\x12\x1b\n" + + "\x17ActualLRPCannotBeFailed\x10\x12\x12\x1c\n" + + "\x18ActualLRPCannotBeRemoved\x10\x13\x12\x1e\n" + + "\x1aActualLRPCannotBeUnclaimed\x10\x15\x12\x1a\n" + + "\x16RunningOnDifferentCell\x10\x18\x12\x12\n" + + "\x0eGUIDGeneration\x10\x1a\x12\x0f\n" + + "\vDeserialize\x10\x1b\x12\f\n" + + "\bDeadlock\x10\x1c\x12\x11\n" + + "\rUnrecoverable\x10\x1d\x12\x11\n" + + "\rLockCollision\x10\x1e\x12\v\n" + + "\aTimeout\x10\x1f\"\x04\b\x01\x10\x01\"\x04\b\x02\x10\x02\"\x04\b\n" + + "\x10\n" + + "\"\x04\b\x14\x10\x14\"\x04\b\x16\x10\x16\"\x04\b\x17\x10\x17\"\x04\b\x19\x10\x19B\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" + +var ( + file_error_proto_rawDescOnce sync.Once + file_error_proto_rawDescData []byte +) + +func file_error_proto_rawDescGZIP() []byte { + file_error_proto_rawDescOnce.Do(func() { + file_error_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_error_proto_rawDesc), len(file_error_proto_rawDesc))) + }) + return file_error_proto_rawDescData } -func (this *Error) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Error{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, - `}`, - }, "") - return s + +var file_error_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_error_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_error_proto_goTypes = []any{ + (ProtoError_Type)(0), // 0: models.ProtoError.Type + (*ProtoError)(nil), // 1: models.ProtoError } -func valueToStringError(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) +var file_error_proto_depIdxs = []int32{ + 0, // 0: models.ProtoError.type:type_name -> models.ProtoError.Type + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } -func (m *Error) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowError - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Error: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Error: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowError - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= Error_Type(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowError - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthError - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthError - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipError(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthError - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipError(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowError - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowError - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowError - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthError - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupError - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthError - } - if depth == 0 { - return iNdEx, nil - } +func init() { file_error_proto_init() } +func file_error_proto_init() { + if File_error_proto != nil { + return } - return 0, io.ErrUnexpectedEOF + file_bbs_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_error_proto_rawDesc), len(file_error_proto_rawDesc)), + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_error_proto_goTypes, + DependencyIndexes: file_error_proto_depIdxs, + EnumInfos: file_error_proto_enumTypes, + MessageInfos: file_error_proto_msgTypes, + }.Build() + File_error_proto = out.File + file_error_proto_goTypes = nil + file_error_proto_depIdxs = nil } - -var ( - ErrInvalidLengthError = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowError = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupError = fmt.Errorf("proto: unexpected end of group") -) diff --git a/models/error.proto b/models/error.proto index 7aa1a9c8..0f3c9742 100644 --- a/models/error.proto +++ b/models/error.proto @@ -1,13 +1,11 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; -option (gogoproto.equal_all) = false; -option (gogoproto.goproto_enum_prefix_all) = true; - -message Error { +message ProtoError { enum Type { reserved 1, 2, 10, 20, 22, 23, 25; // previously used and removed values @@ -47,6 +45,6 @@ message Error { Timeout = 31; } - Type type = 1 [(gogoproto.jsontag) = "type"]; - string message = 2 [(gogoproto.jsontag) = "message"]; + Type type = 1 [json_name = "type", (bbs.bbs_json_always_emit) = true]; + string message = 2 [json_name = "message", (bbs.bbs_json_always_emit) = true, (bbs.bbs_exclude_from_equal) = true]; } diff --git a/models/error_bbs.pb.go b/models/error_bbs.pb.go new file mode 100644 index 00000000..47d7e022 --- /dev/null +++ b/models/error_bbs.pb.go @@ -0,0 +1,212 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: error.proto + +package models + +import ( + strconv "strconv" +) + +type Error_Type int32 + +const ( + Error_UnknownError Error_Type = 0 + Error_InvalidRecord Error_Type = 3 + Error_InvalidRequest Error_Type = 4 + Error_InvalidResponse Error_Type = 5 + Error_InvalidProtobufMessage Error_Type = 6 + Error_InvalidJSON Error_Type = 7 + Error_FailedToOpenEnvelope Error_Type = 8 + Error_InvalidStateTransition Error_Type = 9 + Error_ResourceConflict Error_Type = 11 + Error_ResourceExists Error_Type = 12 + Error_ResourceNotFound Error_Type = 13 + Error_RouterError Error_Type = 14 + Error_ActualLRPCannotBeClaimed Error_Type = 15 + Error_ActualLRPCannotBeStarted Error_Type = 16 + Error_ActualLRPCannotBeCrashed Error_Type = 17 + Error_ActualLRPCannotBeFailed Error_Type = 18 + Error_ActualLRPCannotBeRemoved Error_Type = 19 + Error_ActualLRPCannotBeUnclaimed Error_Type = 21 + Error_RunningOnDifferentCell Error_Type = 24 + Error_GUIDGeneration Error_Type = 26 + Error_Deserialize Error_Type = 27 + Error_Deadlock Error_Type = 28 + Error_Unrecoverable Error_Type = 29 + Error_LockCollision Error_Type = 30 + Error_Timeout Error_Type = 31 +) + +// Enum value maps for Error_Type +var ( + Error_Type_name = map[int32]string{ + 0: "UnknownError", + 3: "InvalidRecord", + 4: "InvalidRequest", + 5: "InvalidResponse", + 6: "InvalidProtobufMessage", + 7: "InvalidJSON", + 8: "FailedToOpenEnvelope", + 9: "InvalidStateTransition", + 11: "ResourceConflict", + 12: "ResourceExists", + 13: "ResourceNotFound", + 14: "RouterError", + 15: "ActualLRPCannotBeClaimed", + 16: "ActualLRPCannotBeStarted", + 17: "ActualLRPCannotBeCrashed", + 18: "ActualLRPCannotBeFailed", + 19: "ActualLRPCannotBeRemoved", + 21: "ActualLRPCannotBeUnclaimed", + 24: "RunningOnDifferentCell", + 26: "GUIDGeneration", + 27: "Deserialize", + 28: "Deadlock", + 29: "Unrecoverable", + 30: "LockCollision", + 31: "Timeout", + } + Error_Type_value = map[string]int32{ + "UnknownError": 0, + "InvalidRecord": 3, + "InvalidRequest": 4, + "InvalidResponse": 5, + "InvalidProtobufMessage": 6, + "InvalidJSON": 7, + "FailedToOpenEnvelope": 8, + "InvalidStateTransition": 9, + "ResourceConflict": 11, + "ResourceExists": 12, + "ResourceNotFound": 13, + "RouterError": 14, + "ActualLRPCannotBeClaimed": 15, + "ActualLRPCannotBeStarted": 16, + "ActualLRPCannotBeCrashed": 17, + "ActualLRPCannotBeFailed": 18, + "ActualLRPCannotBeRemoved": 19, + "ActualLRPCannotBeUnclaimed": 21, + "RunningOnDifferentCell": 24, + "GUIDGeneration": 26, + "Deserialize": 27, + "Deadlock": 28, + "Unrecoverable": 29, + "LockCollision": 30, + "Timeout": 31, + } +) + +func (m Error_Type) String() string { + s, ok := Error_Type_name[int32(m)] + if ok { + return s + } + return strconv.Itoa(int(m)) +} + +// Prevent copylock errors when using ProtoError directly +type Error struct { + Type Error_Type `json:"type"` + Message string `json:"message"` +} + +func (this *Error) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*Error) + if !ok { + that2, ok := that.(Error) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Type != that1.Type { + return false + } + return true +} +func (m *Error) GetType() Error_Type { + if m != nil { + return m.Type + } + var defaultValue Error_Type + defaultValue = 0 + return defaultValue +} +func (m *Error) SetType(value Error_Type) { + if m != nil { + m.Type = value + } +} +func (m *Error) GetMessage() string { + if m != nil { + return m.Message + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *Error) SetMessage(value string) { + if m != nil { + m.Message = value + } +} +func (x *Error) ToProto() *ProtoError { + if x == nil { + return nil + } + + proto := &ProtoError{ + Type: ProtoError_Type(x.Type), + Message: x.Message, + } + return proto +} + +func (x *ProtoError) FromProto() *Error { + if x == nil { + return nil + } + + copysafe := &Error{ + Type: Error_Type(x.Type), + Message: x.Message, + } + return copysafe +} + +func ErrorToProtoSlice(values []*Error) []*ProtoError { + if values == nil { + return nil + } + result := make([]*ProtoError, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ErrorFromProtoSlice(values []*ProtoError) []*Error { + if values == nil { + return nil + } + result := make([]*Error, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/errors.go b/models/errors.go index fec8e3f7..fc00bc26 100644 --- a/models/errors.go +++ b/models/errors.go @@ -32,16 +32,6 @@ func (err *Error) ToError() error { return err } -func (err *Error) Equal(other error) bool { - if e, ok := other.(*Error); ok { - if err == nil && e != nil { - return false - } - return e.GetType() == err.GetType() - } - return false -} - func (err *Error) Error() string { return err.GetMessage() } diff --git a/models/evacuation.go b/models/evacuation.go index 82aa828e..2640e7f9 100644 --- a/models/evacuation.go +++ b/models/evacuation.go @@ -1,12 +1 @@ package models - -func (request *EvacuateRunningActualLRPRequest) SetRoutable(routable bool) { - request.OptionalRoutable = &EvacuateRunningActualLRPRequest_Routable{ - Routable: routable, - } -} - -func (request *EvacuateRunningActualLRPRequest) RoutableExists() bool { - _, ok := request.GetOptionalRoutable().(*EvacuateRunningActualLRPRequest_Routable) - return ok -} diff --git a/models/evacuation.pb.go b/models/evacuation.pb.go index b759f031..09667c78 100644 --- a/models/evacuation.pb.go +++ b/models/evacuation.pb.go @@ -1,2503 +1,541 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: evacuation.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -type EvacuationResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - KeepContainer bool `protobuf:"varint,2,opt,name=keep_container,json=keepContainer,proto3" json:"keep_container"` +type ProtoEvacuationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + KeepContainer bool `protobuf:"varint,2,opt,name=keep_container,proto3" json:"keep_container,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *EvacuationResponse) Reset() { *m = EvacuationResponse{} } -func (*EvacuationResponse) ProtoMessage() {} -func (*EvacuationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5cec7f656fd69c9d, []int{0} -} -func (m *EvacuationResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EvacuationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EvacuationResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EvacuationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_EvacuationResponse.Merge(m, src) -} -func (m *EvacuationResponse) XXX_Size() int { - return m.Size() +func (x *ProtoEvacuationResponse) Reset() { + *x = ProtoEvacuationResponse{} + mi := &file_evacuation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *EvacuationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_EvacuationResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_EvacuationResponse proto.InternalMessageInfo -func (m *EvacuationResponse) GetError() *Error { - if m != nil { - return m.Error - } - return nil +func (x *ProtoEvacuationResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *EvacuationResponse) GetKeepContainer() bool { - if m != nil { - return m.KeepContainer - } - return false -} +func (*ProtoEvacuationResponse) ProtoMessage() {} -type EvacuateClaimedActualLRPRequest struct { - ActualLrpKey *ActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,json=actualLrpKey,proto3" json:"actual_lrp_key,omitempty"` - ActualLrpInstanceKey *ActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,json=actualLrpInstanceKey,proto3" json:"actual_lrp_instance_key,omitempty"` -} - -func (m *EvacuateClaimedActualLRPRequest) Reset() { *m = EvacuateClaimedActualLRPRequest{} } -func (*EvacuateClaimedActualLRPRequest) ProtoMessage() {} -func (*EvacuateClaimedActualLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5cec7f656fd69c9d, []int{1} -} -func (m *EvacuateClaimedActualLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EvacuateClaimedActualLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EvacuateClaimedActualLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoEvacuationResponse) ProtoReflect() protoreflect.Message { + mi := &file_evacuation_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *EvacuateClaimedActualLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_EvacuateClaimedActualLRPRequest.Merge(m, src) -} -func (m *EvacuateClaimedActualLRPRequest) XXX_Size() int { - return m.Size() -} -func (m *EvacuateClaimedActualLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_EvacuateClaimedActualLRPRequest.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_EvacuateClaimedActualLRPRequest proto.InternalMessageInfo - -func (m *EvacuateClaimedActualLRPRequest) GetActualLrpKey() *ActualLRPKey { - if m != nil { - return m.ActualLrpKey - } - return nil +// Deprecated: Use ProtoEvacuationResponse.ProtoReflect.Descriptor instead. +func (*ProtoEvacuationResponse) Descriptor() ([]byte, []int) { + return file_evacuation_proto_rawDescGZIP(), []int{0} } -func (m *EvacuateClaimedActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { - if m != nil { - return m.ActualLrpInstanceKey +func (x *ProtoEvacuationResponse) GetError() *ProtoError { + if x != nil { + return x.Error } return nil } -type EvacuateRunningActualLRPRequest struct { - ActualLrpKey *ActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,json=actualLrpKey,proto3" json:"actual_lrp_key,omitempty"` - ActualLrpInstanceKey *ActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,json=actualLrpInstanceKey,proto3" json:"actual_lrp_instance_key,omitempty"` - ActualLrpNetInfo *ActualLRPNetInfo `protobuf:"bytes,3,opt,name=actual_lrp_net_info,json=actualLrpNetInfo,proto3" json:"actual_lrp_net_info,omitempty"` - ActualLrpInternalRoutes []*ActualLRPInternalRoute `protobuf:"bytes,5,rep,name=actual_lrp_internal_routes,json=actualLrpInternalRoutes,proto3" json:"actual_lrp_internal_routes,omitempty"` - MetricTags map[string]string `protobuf:"bytes,6,rep,name=metric_tags,json=metricTags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Types that are valid to be assigned to OptionalRoutable: - // *EvacuateRunningActualLRPRequest_Routable - OptionalRoutable isEvacuateRunningActualLRPRequest_OptionalRoutable `protobuf_oneof:"optional_routable"` - AvailabilityZone string `protobuf:"bytes,8,opt,name=availability_zone,json=availabilityZone,proto3" json:"availability_zone"` -} - -func (m *EvacuateRunningActualLRPRequest) Reset() { *m = EvacuateRunningActualLRPRequest{} } -func (*EvacuateRunningActualLRPRequest) ProtoMessage() {} -func (*EvacuateRunningActualLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5cec7f656fd69c9d, []int{2} -} -func (m *EvacuateRunningActualLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EvacuateRunningActualLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EvacuateRunningActualLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ProtoEvacuationResponse) GetKeepContainer() bool { + if x != nil { + return x.KeepContainer } -} -func (m *EvacuateRunningActualLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_EvacuateRunningActualLRPRequest.Merge(m, src) -} -func (m *EvacuateRunningActualLRPRequest) XXX_Size() int { - return m.Size() -} -func (m *EvacuateRunningActualLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_EvacuateRunningActualLRPRequest.DiscardUnknown(m) + return false } -var xxx_messageInfo_EvacuateRunningActualLRPRequest proto.InternalMessageInfo - -type isEvacuateRunningActualLRPRequest_OptionalRoutable interface { - isEvacuateRunningActualLRPRequest_OptionalRoutable() - MarshalTo([]byte) (int, error) - Size() int +type ProtoEvacuateClaimedActualLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpKey *ProtoActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,proto3" json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ProtoActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,proto3" json:"actual_lrp_instance_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -type EvacuateRunningActualLRPRequest_Routable struct { - Routable bool `protobuf:"varint,7,opt,name=Routable,proto3,oneof" json:"Routable,omitempty"` +func (x *ProtoEvacuateClaimedActualLRPRequest) Reset() { + *x = ProtoEvacuateClaimedActualLRPRequest{} + mi := &file_evacuation_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (*EvacuateRunningActualLRPRequest_Routable) isEvacuateRunningActualLRPRequest_OptionalRoutable() { +func (x *ProtoEvacuateClaimedActualLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *EvacuateRunningActualLRPRequest) GetOptionalRoutable() isEvacuateRunningActualLRPRequest_OptionalRoutable { - if m != nil { - return m.OptionalRoutable - } - return nil -} +func (*ProtoEvacuateClaimedActualLRPRequest) ProtoMessage() {} -func (m *EvacuateRunningActualLRPRequest) GetActualLrpKey() *ActualLRPKey { - if m != nil { - return m.ActualLrpKey +func (x *ProtoEvacuateClaimedActualLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_evacuation_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (m *EvacuateRunningActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { - if m != nil { - return m.ActualLrpInstanceKey - } - return nil +// Deprecated: Use ProtoEvacuateClaimedActualLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoEvacuateClaimedActualLRPRequest) Descriptor() ([]byte, []int) { + return file_evacuation_proto_rawDescGZIP(), []int{1} } -func (m *EvacuateRunningActualLRPRequest) GetActualLrpNetInfo() *ActualLRPNetInfo { - if m != nil { - return m.ActualLrpNetInfo +func (x *ProtoEvacuateClaimedActualLRPRequest) GetActualLrpKey() *ProtoActualLRPKey { + if x != nil { + return x.ActualLrpKey } return nil } -func (m *EvacuateRunningActualLRPRequest) GetActualLrpInternalRoutes() []*ActualLRPInternalRoute { - if m != nil { - return m.ActualLrpInternalRoutes +func (x *ProtoEvacuateClaimedActualLRPRequest) GetActualLrpInstanceKey() *ProtoActualLRPInstanceKey { + if x != nil { + return x.ActualLrpInstanceKey } return nil } -func (m *EvacuateRunningActualLRPRequest) GetMetricTags() map[string]string { - if m != nil { - return m.MetricTags - } - return nil +type ProtoEvacuateRunningActualLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpKey *ProtoActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,proto3" json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ProtoActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,proto3" json:"actual_lrp_instance_key,omitempty"` + ActualLrpNetInfo *ProtoActualLRPNetInfo `protobuf:"bytes,3,opt,name=actual_lrp_net_info,proto3" json:"actual_lrp_net_info,omitempty"` + ActualLrpInternalRoutes []*ProtoActualLRPInternalRoute `protobuf:"bytes,5,rep,name=actual_lrp_internal_routes,proto3" json:"actual_lrp_internal_routes,omitempty"` + MetricTags map[string]string `protobuf:"bytes,6,rep,name=metric_tags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Routable *bool `protobuf:"varint,7,opt,name=Routable,proto3,oneof" json:"Routable,omitempty"` + AvailabilityZone string `protobuf:"bytes,8,opt,name=availability_zone,proto3" json:"availability_zone,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *EvacuateRunningActualLRPRequest) GetRoutable() bool { - if x, ok := m.GetOptionalRoutable().(*EvacuateRunningActualLRPRequest_Routable); ok { - return x.Routable - } - return false +func (x *ProtoEvacuateRunningActualLRPRequest) Reset() { + *x = ProtoEvacuateRunningActualLRPRequest{} + mi := &file_evacuation_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *EvacuateRunningActualLRPRequest) GetAvailabilityZone() string { - if m != nil { - return m.AvailabilityZone - } - return "" +func (x *ProtoEvacuateRunningActualLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*EvacuateRunningActualLRPRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*EvacuateRunningActualLRPRequest_Routable)(nil), - } -} +func (*ProtoEvacuateRunningActualLRPRequest) ProtoMessage() {} -type EvacuateStoppedActualLRPRequest struct { - ActualLrpKey *ActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,json=actualLrpKey,proto3" json:"actual_lrp_key,omitempty"` - ActualLrpInstanceKey *ActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,json=actualLrpInstanceKey,proto3" json:"actual_lrp_instance_key,omitempty"` -} - -func (m *EvacuateStoppedActualLRPRequest) Reset() { *m = EvacuateStoppedActualLRPRequest{} } -func (*EvacuateStoppedActualLRPRequest) ProtoMessage() {} -func (*EvacuateStoppedActualLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5cec7f656fd69c9d, []int{3} -} -func (m *EvacuateStoppedActualLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EvacuateStoppedActualLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EvacuateStoppedActualLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoEvacuateRunningActualLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_evacuation_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *EvacuateStoppedActualLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_EvacuateStoppedActualLRPRequest.Merge(m, src) -} -func (m *EvacuateStoppedActualLRPRequest) XXX_Size() int { - return m.Size() -} -func (m *EvacuateStoppedActualLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_EvacuateStoppedActualLRPRequest.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_EvacuateStoppedActualLRPRequest proto.InternalMessageInfo - -func (m *EvacuateStoppedActualLRPRequest) GetActualLrpKey() *ActualLRPKey { - if m != nil { - return m.ActualLrpKey - } - return nil +// Deprecated: Use ProtoEvacuateRunningActualLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoEvacuateRunningActualLRPRequest) Descriptor() ([]byte, []int) { + return file_evacuation_proto_rawDescGZIP(), []int{2} } -func (m *EvacuateStoppedActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { - if m != nil { - return m.ActualLrpInstanceKey +func (x *ProtoEvacuateRunningActualLRPRequest) GetActualLrpKey() *ProtoActualLRPKey { + if x != nil { + return x.ActualLrpKey } return nil } -type EvacuateCrashedActualLRPRequest struct { - ActualLrpKey *ActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,json=actualLrpKey,proto3" json:"actual_lrp_key,omitempty"` - ActualLrpInstanceKey *ActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,json=actualLrpInstanceKey,proto3" json:"actual_lrp_instance_key,omitempty"` - ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,json=errorMessage,proto3" json:"error_message"` -} - -func (m *EvacuateCrashedActualLRPRequest) Reset() { *m = EvacuateCrashedActualLRPRequest{} } -func (*EvacuateCrashedActualLRPRequest) ProtoMessage() {} -func (*EvacuateCrashedActualLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5cec7f656fd69c9d, []int{4} -} -func (m *EvacuateCrashedActualLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EvacuateCrashedActualLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EvacuateCrashedActualLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EvacuateCrashedActualLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_EvacuateCrashedActualLRPRequest.Merge(m, src) -} -func (m *EvacuateCrashedActualLRPRequest) XXX_Size() int { - return m.Size() -} -func (m *EvacuateCrashedActualLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_EvacuateCrashedActualLRPRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_EvacuateCrashedActualLRPRequest proto.InternalMessageInfo - -func (m *EvacuateCrashedActualLRPRequest) GetActualLrpKey() *ActualLRPKey { - if m != nil { - return m.ActualLrpKey +func (x *ProtoEvacuateRunningActualLRPRequest) GetActualLrpInstanceKey() *ProtoActualLRPInstanceKey { + if x != nil { + return x.ActualLrpInstanceKey } return nil } -func (m *EvacuateCrashedActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { - if m != nil { - return m.ActualLrpInstanceKey +func (x *ProtoEvacuateRunningActualLRPRequest) GetActualLrpNetInfo() *ProtoActualLRPNetInfo { + if x != nil { + return x.ActualLrpNetInfo } return nil } -func (m *EvacuateCrashedActualLRPRequest) GetErrorMessage() string { - if m != nil { - return m.ErrorMessage - } - return "" -} - -type RemoveEvacuatingActualLRPRequest struct { - ActualLrpKey *ActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,json=actualLrpKey,proto3" json:"actual_lrp_key,omitempty"` - ActualLrpInstanceKey *ActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,json=actualLrpInstanceKey,proto3" json:"actual_lrp_instance_key,omitempty"` -} - -func (m *RemoveEvacuatingActualLRPRequest) Reset() { *m = RemoveEvacuatingActualLRPRequest{} } -func (*RemoveEvacuatingActualLRPRequest) ProtoMessage() {} -func (*RemoveEvacuatingActualLRPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5cec7f656fd69c9d, []int{5} -} -func (m *RemoveEvacuatingActualLRPRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveEvacuatingActualLRPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveEvacuatingActualLRPRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveEvacuatingActualLRPRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveEvacuatingActualLRPRequest.Merge(m, src) -} -func (m *RemoveEvacuatingActualLRPRequest) XXX_Size() int { - return m.Size() -} -func (m *RemoveEvacuatingActualLRPRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveEvacuatingActualLRPRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveEvacuatingActualLRPRequest proto.InternalMessageInfo - -func (m *RemoveEvacuatingActualLRPRequest) GetActualLrpKey() *ActualLRPKey { - if m != nil { - return m.ActualLrpKey +func (x *ProtoEvacuateRunningActualLRPRequest) GetActualLrpInternalRoutes() []*ProtoActualLRPInternalRoute { + if x != nil { + return x.ActualLrpInternalRoutes } return nil } -func (m *RemoveEvacuatingActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { - if m != nil { - return m.ActualLrpInstanceKey +func (x *ProtoEvacuateRunningActualLRPRequest) GetMetricTags() map[string]string { + if x != nil { + return x.MetricTags } return nil } -type RemoveEvacuatingActualLRPResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *RemoveEvacuatingActualLRPResponse) Reset() { *m = RemoveEvacuatingActualLRPResponse{} } -func (*RemoveEvacuatingActualLRPResponse) ProtoMessage() {} -func (*RemoveEvacuatingActualLRPResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5cec7f656fd69c9d, []int{6} -} -func (m *RemoveEvacuatingActualLRPResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveEvacuatingActualLRPResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveEvacuatingActualLRPResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ProtoEvacuateRunningActualLRPRequest) GetRoutable() bool { + if x != nil && x.Routable != nil { + return *x.Routable } -} -func (m *RemoveEvacuatingActualLRPResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveEvacuatingActualLRPResponse.Merge(m, src) -} -func (m *RemoveEvacuatingActualLRPResponse) XXX_Size() int { - return m.Size() -} -func (m *RemoveEvacuatingActualLRPResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveEvacuatingActualLRPResponse.DiscardUnknown(m) + return false } -var xxx_messageInfo_RemoveEvacuatingActualLRPResponse proto.InternalMessageInfo - -func (m *RemoveEvacuatingActualLRPResponse) GetError() *Error { - if m != nil { - return m.Error +func (x *ProtoEvacuateRunningActualLRPRequest) GetAvailabilityZone() string { + if x != nil { + return x.AvailabilityZone } - return nil + return "" } -func init() { - proto.RegisterType((*EvacuationResponse)(nil), "models.EvacuationResponse") - proto.RegisterType((*EvacuateClaimedActualLRPRequest)(nil), "models.EvacuateClaimedActualLRPRequest") - proto.RegisterType((*EvacuateRunningActualLRPRequest)(nil), "models.EvacuateRunningActualLRPRequest") - proto.RegisterMapType((map[string]string)(nil), "models.EvacuateRunningActualLRPRequest.MetricTagsEntry") - proto.RegisterType((*EvacuateStoppedActualLRPRequest)(nil), "models.EvacuateStoppedActualLRPRequest") - proto.RegisterType((*EvacuateCrashedActualLRPRequest)(nil), "models.EvacuateCrashedActualLRPRequest") - proto.RegisterType((*RemoveEvacuatingActualLRPRequest)(nil), "models.RemoveEvacuatingActualLRPRequest") - proto.RegisterType((*RemoveEvacuatingActualLRPResponse)(nil), "models.RemoveEvacuatingActualLRPResponse") +type ProtoEvacuateStoppedActualLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpKey *ProtoActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,proto3" json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ProtoActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,proto3" json:"actual_lrp_instance_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { proto.RegisterFile("evacuation.proto", fileDescriptor_5cec7f656fd69c9d) } - -var fileDescriptor_5cec7f656fd69c9d = []byte{ - // 628 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0xcd, 0x4e, 0xdb, 0x4c, - 0x14, 0xf5, 0x00, 0xe1, 0x4b, 0x26, 0xc0, 0x17, 0x06, 0x2a, 0xac, 0x08, 0x4d, 0xd2, 0x74, 0x93, - 0x4d, 0x83, 0x44, 0xab, 0xfe, 0x20, 0x75, 0xd1, 0x20, 0x54, 0x28, 0x50, 0x55, 0x43, 0x17, 0x55, - 0xbb, 0xb0, 0x26, 0xe1, 0x62, 0x2c, 0xec, 0x19, 0xd7, 0x1e, 0x47, 0x4a, 0x57, 0x7d, 0x84, 0x3e, - 0x46, 0xd7, 0xed, 0x4b, 0x74, 0xc9, 0x92, 0x15, 0x2a, 0x66, 0x53, 0x65, 0x51, 0xf1, 0x08, 0x95, - 0xc7, 0x89, 0x31, 0x50, 0x21, 0x75, 0xd7, 0xec, 0xe6, 0x9c, 0x7b, 0xef, 0xb9, 0x47, 0x33, 0x73, - 0x67, 0x70, 0x05, 0x7a, 0xbc, 0x1b, 0x71, 0xe5, 0x48, 0xd1, 0xf2, 0x03, 0xa9, 0x24, 0x99, 0xf6, - 0xe4, 0x3e, 0xb8, 0x61, 0xf5, 0xbe, 0xed, 0xa8, 0xc3, 0xa8, 0xd3, 0xea, 0x4a, 0x6f, 0xc5, 0x96, - 0xb6, 0x5c, 0xd1, 0xe1, 0x4e, 0x74, 0xa0, 0x91, 0x06, 0x7a, 0x95, 0x96, 0x55, 0x2b, 0xbc, 0xab, - 0x22, 0xee, 0x5a, 0x6e, 0xe0, 0x0f, 0x99, 0x32, 0x04, 0x81, 0x0c, 0x52, 0xd0, 0x50, 0x98, 0x6c, - 0x64, 0x9d, 0x18, 0x84, 0xbe, 0x14, 0x21, 0x90, 0x7b, 0xb8, 0xa0, 0x93, 0x4c, 0x54, 0x47, 0xcd, - 0xf2, 0xea, 0x6c, 0x2b, 0xed, 0xdd, 0xda, 0x48, 0x48, 0x96, 0xc6, 0xc8, 0x53, 0x3c, 0x77, 0x04, - 0xe0, 0x5b, 0x5d, 0x29, 0x14, 0x77, 0x04, 0x04, 0xe6, 0x44, 0x1d, 0x35, 0x8b, 0x6d, 0x32, 0x38, - 0xad, 0x5d, 0x8b, 0xb0, 0xd9, 0x04, 0xaf, 0x8f, 0x60, 0xe3, 0x2b, 0xc2, 0xb5, 0x61, 0x5b, 0x58, - 0x77, 0xb9, 0xe3, 0xc1, 0xfe, 0x73, 0x6d, 0x73, 0x87, 0xbd, 0x66, 0xf0, 0x21, 0x82, 0x50, 0x91, - 0x35, 0x3c, 0x77, 0x69, 0xdd, 0x3a, 0x82, 0xfe, 0xd0, 0xcc, 0xe2, 0xc8, 0x4c, 0x56, 0xb1, 0x0d, - 0x7d, 0x36, 0x93, 0xe6, 0xee, 0x04, 0xfe, 0x36, 0xf4, 0xc9, 0x1e, 0x5e, 0xca, 0xd5, 0x3a, 0x22, - 0x54, 0x5c, 0x74, 0x41, 0x8b, 0x4c, 0x68, 0x91, 0xe5, 0x1b, 0x22, 0x5b, 0xc3, 0xa4, 0x44, 0x6c, - 0x31, 0x13, 0xcb, 0xb1, 0x8d, 0x5f, 0x53, 0x97, 0xa6, 0x59, 0x24, 0x84, 0x23, 0xec, 0x7f, 0xde, - 0x34, 0x79, 0x81, 0x17, 0x72, 0xa2, 0x02, 0x94, 0xe5, 0x88, 0x03, 0x69, 0x4e, 0x6a, 0x41, 0xf3, - 0x86, 0xe0, 0x2b, 0x50, 0x5b, 0xe2, 0x40, 0xb2, 0x4a, 0x26, 0x36, 0x64, 0xc8, 0x7b, 0x5c, 0xbd, - 0xe2, 0x4e, 0x41, 0x20, 0xb8, 0x6b, 0x05, 0x32, 0x52, 0x10, 0x9a, 0x85, 0xfa, 0x64, 0xb3, 0xbc, - 0x4a, 0xff, 0x60, 0x30, 0xcd, 0x63, 0x49, 0x1a, 0x5b, 0xca, 0x59, 0xcc, 0xf1, 0x21, 0x79, 0x8b, - 0xcb, 0x1e, 0xa8, 0xc0, 0xe9, 0x5a, 0x8a, 0xdb, 0xa1, 0x39, 0xad, 0xd5, 0x1e, 0x67, 0xb7, 0xee, - 0xf6, 0x4d, 0x6f, 0xed, 0xea, 0xd2, 0x37, 0xdc, 0x0e, 0x37, 0x84, 0x0a, 0xfa, 0x0c, 0x7b, 0x19, - 0x41, 0x96, 0x71, 0x31, 0xe9, 0xc1, 0x3b, 0x2e, 0x98, 0xff, 0x25, 0xd7, 0x73, 0xd3, 0x60, 0x19, - 0x43, 0xda, 0x78, 0x9e, 0xf7, 0xb8, 0xe3, 0xf2, 0x8e, 0xe3, 0x3a, 0xaa, 0x6f, 0x7d, 0x94, 0x02, - 0xcc, 0x62, 0x1d, 0x35, 0x4b, 0xed, 0x3b, 0x83, 0xd3, 0xda, 0xcd, 0x20, 0xab, 0xe4, 0xa9, 0x77, - 0x52, 0x40, 0xf5, 0x19, 0xfe, 0xff, 0x9a, 0x01, 0x52, 0xc1, 0x93, 0xa3, 0xa3, 0x2f, 0xb1, 0x64, - 0x49, 0x16, 0x71, 0xa1, 0xc7, 0xdd, 0x08, 0xf4, 0x49, 0x96, 0x58, 0x0a, 0xd6, 0x26, 0x9e, 0xa0, - 0xf6, 0x02, 0x9e, 0x97, 0x7e, 0x32, 0x7c, 0xc3, 0xcd, 0x4c, 0x7c, 0xbd, 0x9c, 0x2a, 0x4e, 0x55, - 0x0a, 0x57, 0xa6, 0x64, 0x4f, 0x49, 0xdf, 0x1f, 0x87, 0x29, 0x19, 0xe4, 0x47, 0x3b, 0xe0, 0xe1, - 0xe1, 0x18, 0x98, 0x26, 0x8f, 0xf0, 0xac, 0x7e, 0xd3, 0x2c, 0x0f, 0xc2, 0x90, 0xdb, 0xa0, 0xe7, - 0xa3, 0xd4, 0x9e, 0x1f, 0x9c, 0xd6, 0xae, 0x06, 0xd8, 0x8c, 0x86, 0xbb, 0x29, 0x6a, 0x7c, 0x43, - 0xb8, 0xce, 0xc0, 0x93, 0x3d, 0x18, 0x3d, 0xa2, 0x63, 0xf0, 0x26, 0x34, 0x36, 0xf1, 0xdd, 0x5b, - 0x4c, 0xff, 0xc5, 0x17, 0xd0, 0x7e, 0x78, 0x7c, 0x46, 0x8d, 0x93, 0x33, 0x6a, 0x5c, 0x9c, 0x51, - 0xf4, 0x29, 0xa6, 0xe8, 0x4b, 0x4c, 0x8d, 0xef, 0x31, 0x45, 0xc7, 0x31, 0x45, 0x3f, 0x62, 0x8a, - 0x7e, 0xc6, 0xd4, 0xb8, 0x88, 0x29, 0xfa, 0x7c, 0x4e, 0x8d, 0xe3, 0x73, 0x6a, 0x9c, 0x9c, 0x53, - 0xa3, 0x33, 0xad, 0xbf, 0x9e, 0x07, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x02, 0x9c, 0x2f, 0xec, - 0xe4, 0x06, 0x00, 0x00, +func (x *ProtoEvacuateStoppedActualLRPRequest) Reset() { + *x = ProtoEvacuateStoppedActualLRPRequest{} + mi := &file_evacuation_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (this *EvacuationResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.EvacuationResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - s = append(s, "KeepContainer: "+fmt.Sprintf("%#v", this.KeepContainer)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EvacuateClaimedActualLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.EvacuateClaimedActualLRPRequest{") - if this.ActualLrpKey != nil { - s = append(s, "ActualLrpKey: "+fmt.Sprintf("%#v", this.ActualLrpKey)+",\n") - } - if this.ActualLrpInstanceKey != nil { - s = append(s, "ActualLrpInstanceKey: "+fmt.Sprintf("%#v", this.ActualLrpInstanceKey)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EvacuateRunningActualLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&models.EvacuateRunningActualLRPRequest{") - if this.ActualLrpKey != nil { - s = append(s, "ActualLrpKey: "+fmt.Sprintf("%#v", this.ActualLrpKey)+",\n") - } - if this.ActualLrpInstanceKey != nil { - s = append(s, "ActualLrpInstanceKey: "+fmt.Sprintf("%#v", this.ActualLrpInstanceKey)+",\n") - } - if this.ActualLrpNetInfo != nil { - s = append(s, "ActualLrpNetInfo: "+fmt.Sprintf("%#v", this.ActualLrpNetInfo)+",\n") - } - if this.ActualLrpInternalRoutes != nil { - s = append(s, "ActualLrpInternalRoutes: "+fmt.Sprintf("%#v", this.ActualLrpInternalRoutes)+",\n") - } - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]string{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%#v: %#v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - if this.MetricTags != nil { - s = append(s, "MetricTags: "+mapStringForMetricTags+",\n") - } - if this.OptionalRoutable != nil { - s = append(s, "OptionalRoutable: "+fmt.Sprintf("%#v", this.OptionalRoutable)+",\n") - } - s = append(s, "AvailabilityZone: "+fmt.Sprintf("%#v", this.AvailabilityZone)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EvacuateRunningActualLRPRequest_Routable) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&models.EvacuateRunningActualLRPRequest_Routable{` + - `Routable:` + fmt.Sprintf("%#v", this.Routable) + `}`}, ", ") - return s -} -func (this *EvacuateStoppedActualLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.EvacuateStoppedActualLRPRequest{") - if this.ActualLrpKey != nil { - s = append(s, "ActualLrpKey: "+fmt.Sprintf("%#v", this.ActualLrpKey)+",\n") - } - if this.ActualLrpInstanceKey != nil { - s = append(s, "ActualLrpInstanceKey: "+fmt.Sprintf("%#v", this.ActualLrpInstanceKey)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EvacuateCrashedActualLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&models.EvacuateCrashedActualLRPRequest{") - if this.ActualLrpKey != nil { - s = append(s, "ActualLrpKey: "+fmt.Sprintf("%#v", this.ActualLrpKey)+",\n") - } - if this.ActualLrpInstanceKey != nil { - s = append(s, "ActualLrpInstanceKey: "+fmt.Sprintf("%#v", this.ActualLrpInstanceKey)+",\n") - } - s = append(s, "ErrorMessage: "+fmt.Sprintf("%#v", this.ErrorMessage)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RemoveEvacuatingActualLRPRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.RemoveEvacuatingActualLRPRequest{") - if this.ActualLrpKey != nil { - s = append(s, "ActualLrpKey: "+fmt.Sprintf("%#v", this.ActualLrpKey)+",\n") - } - if this.ActualLrpInstanceKey != nil { - s = append(s, "ActualLrpInstanceKey: "+fmt.Sprintf("%#v", this.ActualLrpInstanceKey)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RemoveEvacuatingActualLRPResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.RemoveEvacuatingActualLRPResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringEvacuation(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *EvacuationResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *ProtoEvacuateStoppedActualLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *EvacuationResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func (*ProtoEvacuateStoppedActualLRPRequest) ProtoMessage() {} -func (m *EvacuationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.KeepContainer { - i-- - if m.KeepContainer { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) +func (x *ProtoEvacuateStoppedActualLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_evacuation_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EvacuateClaimedActualLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + return ms } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *EvacuateClaimedActualLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoEvacuateStoppedActualLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoEvacuateStoppedActualLRPRequest) Descriptor() ([]byte, []int) { + return file_evacuation_proto_rawDescGZIP(), []int{3} } -func (m *EvacuateClaimedActualLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ActualLrpInstanceKey != nil { - { - size, err := m.ActualLrpInstanceKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ActualLrpKey != nil { - { - size, err := m.ActualLrpKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func (x *ProtoEvacuateStoppedActualLRPRequest) GetActualLrpKey() *ProtoActualLRPKey { + if x != nil { + return x.ActualLrpKey } - return len(dAtA) - i, nil + return nil } -func (m *EvacuateRunningActualLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoEvacuateStoppedActualLRPRequest) GetActualLrpInstanceKey() *ProtoActualLRPInstanceKey { + if x != nil { + return x.ActualLrpInstanceKey } - return dAtA[:n], nil + return nil } -func (m *EvacuateRunningActualLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type ProtoEvacuateCrashedActualLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpKey *ProtoActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,proto3" json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ProtoActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,proto3" json:"actual_lrp_instance_key,omitempty"` + ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,proto3" json:"error_message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *EvacuateRunningActualLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AvailabilityZone) > 0 { - i -= len(m.AvailabilityZone) - copy(dAtA[i:], m.AvailabilityZone) - i = encodeVarintEvacuation(dAtA, i, uint64(len(m.AvailabilityZone))) - i-- - dAtA[i] = 0x42 - } - if m.OptionalRoutable != nil { - { - size := m.OptionalRoutable.Size() - i -= size - if _, err := m.OptionalRoutable.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.MetricTags) > 0 { - for k := range m.MetricTags { - v := m.MetricTags[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintEvacuation(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintEvacuation(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintEvacuation(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x32 - } - } - if len(m.ActualLrpInternalRoutes) > 0 { - for iNdEx := len(m.ActualLrpInternalRoutes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ActualLrpInternalRoutes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.ActualLrpNetInfo != nil { - { - size, err := m.ActualLrpNetInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.ActualLrpInstanceKey != nil { - { - size, err := m.ActualLrpInstanceKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ActualLrpKey != nil { - { - size, err := m.ActualLrpKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func (x *ProtoEvacuateCrashedActualLRPRequest) Reset() { + *x = ProtoEvacuateCrashedActualLRPRequest{} + mi := &file_evacuation_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *EvacuateRunningActualLRPRequest_Routable) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *ProtoEvacuateCrashedActualLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *EvacuateRunningActualLRPRequest_Routable) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i-- - if m.Routable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - return len(dAtA) - i, nil -} -func (m *EvacuateStoppedActualLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} +func (*ProtoEvacuateCrashedActualLRPRequest) ProtoMessage() {} -func (m *EvacuateStoppedActualLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EvacuateStoppedActualLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ActualLrpInstanceKey != nil { - { - size, err := m.ActualLrpInstanceKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ActualLrpKey != nil { - { - size, err := m.ActualLrpKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) +func (x *ProtoEvacuateCrashedActualLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_evacuation_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - i-- - dAtA[i] = 0xa + return ms } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *EvacuateCrashedActualLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EvacuateCrashedActualLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoEvacuateCrashedActualLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoEvacuateCrashedActualLRPRequest) Descriptor() ([]byte, []int) { + return file_evacuation_proto_rawDescGZIP(), []int{4} } -func (m *EvacuateCrashedActualLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ErrorMessage) > 0 { - i -= len(m.ErrorMessage) - copy(dAtA[i:], m.ErrorMessage) - i = encodeVarintEvacuation(dAtA, i, uint64(len(m.ErrorMessage))) - i-- - dAtA[i] = 0x1a - } - if m.ActualLrpInstanceKey != nil { - { - size, err := m.ActualLrpInstanceKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func (x *ProtoEvacuateCrashedActualLRPRequest) GetActualLrpKey() *ProtoActualLRPKey { + if x != nil { + return x.ActualLrpKey } - if m.ActualLrpKey != nil { - { - size, err := m.ActualLrpKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return nil } -func (m *RemoveEvacuatingActualLRPRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoEvacuateCrashedActualLRPRequest) GetActualLrpInstanceKey() *ProtoActualLRPInstanceKey { + if x != nil { + return x.ActualLrpInstanceKey } - return dAtA[:n], nil -} - -func (m *RemoveEvacuatingActualLRPRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return nil } -func (m *RemoveEvacuatingActualLRPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ActualLrpInstanceKey != nil { - { - size, err := m.ActualLrpInstanceKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func (x *ProtoEvacuateCrashedActualLRPRequest) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage } - if m.ActualLrpKey != nil { - { - size, err := m.ActualLrpKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return "" } -func (m *RemoveEvacuatingActualLRPResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +type ProtoRemoveEvacuatingActualLRPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpKey *ProtoActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,proto3" json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ProtoActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,proto3" json:"actual_lrp_instance_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *RemoveEvacuatingActualLRPResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *ProtoRemoveEvacuatingActualLRPRequest) Reset() { + *x = ProtoRemoveEvacuatingActualLRPRequest{} + mi := &file_evacuation_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *RemoveEvacuatingActualLRPResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvacuation(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func (x *ProtoRemoveEvacuatingActualLRPRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func encodeVarintEvacuation(dAtA []byte, offset int, v uint64) int { - offset -= sovEvacuation(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EvacuationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovEvacuation(uint64(l)) - } - if m.KeepContainer { - n += 2 - } - return n -} - -func (m *EvacuateClaimedActualLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActualLrpKey != nil { - l = m.ActualLrpKey.Size() - n += 1 + l + sovEvacuation(uint64(l)) - } - if m.ActualLrpInstanceKey != nil { - l = m.ActualLrpInstanceKey.Size() - n += 1 + l + sovEvacuation(uint64(l)) - } - return n -} +func (*ProtoRemoveEvacuatingActualLRPRequest) ProtoMessage() {} -func (m *EvacuateRunningActualLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActualLrpKey != nil { - l = m.ActualLrpKey.Size() - n += 1 + l + sovEvacuation(uint64(l)) - } - if m.ActualLrpInstanceKey != nil { - l = m.ActualLrpInstanceKey.Size() - n += 1 + l + sovEvacuation(uint64(l)) - } - if m.ActualLrpNetInfo != nil { - l = m.ActualLrpNetInfo.Size() - n += 1 + l + sovEvacuation(uint64(l)) - } - if len(m.ActualLrpInternalRoutes) > 0 { - for _, e := range m.ActualLrpInternalRoutes { - l = e.Size() - n += 1 + l + sovEvacuation(uint64(l)) +func (x *ProtoRemoveEvacuatingActualLRPRequest) ProtoReflect() protoreflect.Message { + mi := &file_evacuation_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if len(m.MetricTags) > 0 { - for k, v := range m.MetricTags { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovEvacuation(uint64(len(k))) + 1 + len(v) + sovEvacuation(uint64(len(v))) - n += mapEntrySize + 1 + sovEvacuation(uint64(mapEntrySize)) - } - } - if m.OptionalRoutable != nil { - n += m.OptionalRoutable.Size() - } - l = len(m.AvailabilityZone) - if l > 0 { - n += 1 + l + sovEvacuation(uint64(l)) - } - return n + return mi.MessageOf(x) } -func (m *EvacuateRunningActualLRPRequest_Routable) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 2 - return n -} -func (m *EvacuateStoppedActualLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActualLrpKey != nil { - l = m.ActualLrpKey.Size() - n += 1 + l + sovEvacuation(uint64(l)) - } - if m.ActualLrpInstanceKey != nil { - l = m.ActualLrpInstanceKey.Size() - n += 1 + l + sovEvacuation(uint64(l)) - } - return n +// Deprecated: Use ProtoRemoveEvacuatingActualLRPRequest.ProtoReflect.Descriptor instead. +func (*ProtoRemoveEvacuatingActualLRPRequest) Descriptor() ([]byte, []int) { + return file_evacuation_proto_rawDescGZIP(), []int{5} } -func (m *EvacuateCrashedActualLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActualLrpKey != nil { - l = m.ActualLrpKey.Size() - n += 1 + l + sovEvacuation(uint64(l)) +func (x *ProtoRemoveEvacuatingActualLRPRequest) GetActualLrpKey() *ProtoActualLRPKey { + if x != nil { + return x.ActualLrpKey } - if m.ActualLrpInstanceKey != nil { - l = m.ActualLrpInstanceKey.Size() - n += 1 + l + sovEvacuation(uint64(l)) - } - l = len(m.ErrorMessage) - if l > 0 { - n += 1 + l + sovEvacuation(uint64(l)) - } - return n + return nil } -func (m *RemoveEvacuatingActualLRPRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActualLrpKey != nil { - l = m.ActualLrpKey.Size() - n += 1 + l + sovEvacuation(uint64(l)) +func (x *ProtoRemoveEvacuatingActualLRPRequest) GetActualLrpInstanceKey() *ProtoActualLRPInstanceKey { + if x != nil { + return x.ActualLrpInstanceKey } - if m.ActualLrpInstanceKey != nil { - l = m.ActualLrpInstanceKey.Size() - n += 1 + l + sovEvacuation(uint64(l)) - } - return n + return nil } -func (m *RemoveEvacuatingActualLRPResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovEvacuation(uint64(l)) - } - return n +type ProtoRemoveEvacuatingActualLRPResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func sovEvacuation(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvacuation(x uint64) (n int) { - return sovEvacuation(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *EvacuationResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&EvacuationResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `KeepContainer:` + fmt.Sprintf("%v", this.KeepContainer) + `,`, - `}`, - }, "") - return s -} -func (this *EvacuateClaimedActualLRPRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&EvacuateClaimedActualLRPRequest{`, - `ActualLrpKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpKey), "ActualLRPKey", "ActualLRPKey", 1) + `,`, - `ActualLrpInstanceKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpInstanceKey), "ActualLRPInstanceKey", "ActualLRPInstanceKey", 1) + `,`, - `}`, - }, "") - return s +func (x *ProtoRemoveEvacuatingActualLRPResponse) Reset() { + *x = ProtoRemoveEvacuatingActualLRPResponse{} + mi := &file_evacuation_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (this *EvacuateRunningActualLRPRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForActualLrpInternalRoutes := "[]*ActualLRPInternalRoute{" - for _, f := range this.ActualLrpInternalRoutes { - repeatedStringForActualLrpInternalRoutes += strings.Replace(fmt.Sprintf("%v", f), "ActualLRPInternalRoute", "ActualLRPInternalRoute", 1) + "," - } - repeatedStringForActualLrpInternalRoutes += "}" - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]string{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%v: %v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - s := strings.Join([]string{`&EvacuateRunningActualLRPRequest{`, - `ActualLrpKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpKey), "ActualLRPKey", "ActualLRPKey", 1) + `,`, - `ActualLrpInstanceKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpInstanceKey), "ActualLRPInstanceKey", "ActualLRPInstanceKey", 1) + `,`, - `ActualLrpNetInfo:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpNetInfo), "ActualLRPNetInfo", "ActualLRPNetInfo", 1) + `,`, - `ActualLrpInternalRoutes:` + repeatedStringForActualLrpInternalRoutes + `,`, - `MetricTags:` + mapStringForMetricTags + `,`, - `OptionalRoutable:` + fmt.Sprintf("%v", this.OptionalRoutable) + `,`, - `AvailabilityZone:` + fmt.Sprintf("%v", this.AvailabilityZone) + `,`, - `}`, - }, "") - return s -} -func (this *EvacuateRunningActualLRPRequest_Routable) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&EvacuateRunningActualLRPRequest_Routable{`, - `Routable:` + fmt.Sprintf("%v", this.Routable) + `,`, - `}`, - }, "") - return s -} -func (this *EvacuateStoppedActualLRPRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&EvacuateStoppedActualLRPRequest{`, - `ActualLrpKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpKey), "ActualLRPKey", "ActualLRPKey", 1) + `,`, - `ActualLrpInstanceKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpInstanceKey), "ActualLRPInstanceKey", "ActualLRPInstanceKey", 1) + `,`, - `}`, - }, "") - return s -} -func (this *EvacuateCrashedActualLRPRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&EvacuateCrashedActualLRPRequest{`, - `ActualLrpKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpKey), "ActualLRPKey", "ActualLRPKey", 1) + `,`, - `ActualLrpInstanceKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpInstanceKey), "ActualLRPInstanceKey", "ActualLRPInstanceKey", 1) + `,`, - `ErrorMessage:` + fmt.Sprintf("%v", this.ErrorMessage) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveEvacuatingActualLRPRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveEvacuatingActualLRPRequest{`, - `ActualLrpKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpKey), "ActualLRPKey", "ActualLRPKey", 1) + `,`, - `ActualLrpInstanceKey:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpInstanceKey), "ActualLRPInstanceKey", "ActualLRPInstanceKey", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveEvacuatingActualLRPResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveEvacuatingActualLRPResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringEvacuation(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *EvacuationResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EvacuationResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EvacuationResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field KeepContainer", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.KeepContainer = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipEvacuation(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvacuation - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func (x *ProtoRemoveEvacuatingActualLRPResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *EvacuateClaimedActualLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EvacuateClaimedActualLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EvacuateClaimedActualLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpKey == nil { - m.ActualLrpKey = &ActualLRPKey{} - } - if err := m.ActualLrpKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpInstanceKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpInstanceKey == nil { - m.ActualLrpInstanceKey = &ActualLRPInstanceKey{} - } - if err := m.ActualLrpInstanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvacuation(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvacuation - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EvacuateRunningActualLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EvacuateRunningActualLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EvacuateRunningActualLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpKey == nil { - m.ActualLrpKey = &ActualLRPKey{} - } - if err := m.ActualLrpKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpInstanceKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpInstanceKey == nil { - m.ActualLrpInstanceKey = &ActualLRPInstanceKey{} - } - if err := m.ActualLrpInstanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpNetInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpNetInfo == nil { - m.ActualLrpNetInfo = &ActualLRPNetInfo{} - } - if err := m.ActualLrpNetInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpInternalRoutes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ActualLrpInternalRoutes = append(m.ActualLrpInternalRoutes, &ActualLRPInternalRoute{}) - if err := m.ActualLrpInternalRoutes[len(m.ActualLrpInternalRoutes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricTags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MetricTags == nil { - m.MetricTags = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthEvacuation - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthEvacuation - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthEvacuation - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthEvacuation - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipEvacuation(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvacuation - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.MetricTags[mapkey] = mapvalue - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Routable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.OptionalRoutable = &EvacuateRunningActualLRPRequest_Routable{b} - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AvailabilityZone", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AvailabilityZone = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvacuation(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvacuation - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +func (*ProtoRemoveEvacuatingActualLRPResponse) ProtoMessage() {} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EvacuateStoppedActualLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EvacuateStoppedActualLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EvacuateStoppedActualLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) +func (x *ProtoRemoveEvacuatingActualLRPResponse) ProtoReflect() protoreflect.Message { + mi := &file_evacuation_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpKey == nil { - m.ActualLrpKey = &ActualLRPKey{} - } - if err := m.ActualLrpKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpInstanceKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpInstanceKey == nil { - m.ActualLrpInstanceKey = &ActualLRPInstanceKey{} - } - if err := m.ActualLrpInstanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvacuation(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvacuation - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF + return ms } - return nil + return mi.MessageOf(x) } -func (m *EvacuateCrashedActualLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EvacuateCrashedActualLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EvacuateCrashedActualLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpKey == nil { - m.ActualLrpKey = &ActualLRPKey{} - } - if err := m.ActualLrpKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpInstanceKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpInstanceKey == nil { - m.ActualLrpInstanceKey = &ActualLRPInstanceKey{} - } - if err := m.ActualLrpInstanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ErrorMessage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ErrorMessage = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvacuation(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvacuation - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use ProtoRemoveEvacuatingActualLRPResponse.ProtoReflect.Descriptor instead. +func (*ProtoRemoveEvacuatingActualLRPResponse) Descriptor() ([]byte, []int) { + return file_evacuation_proto_rawDescGZIP(), []int{6} } -func (m *RemoveEvacuatingActualLRPRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RemoveEvacuatingActualLRPRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveEvacuatingActualLRPRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpKey == nil { - m.ActualLrpKey = &ActualLRPKey{} - } - if err := m.ActualLrpKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpInstanceKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpInstanceKey == nil { - m.ActualLrpInstanceKey = &ActualLRPInstanceKey{} - } - if err := m.ActualLrpInstanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvacuation(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvacuation - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoRemoveEvacuatingActualLRPResponse) GetError() *ProtoError { + if x != nil { + return x.Error } return nil } -func (m *RemoveEvacuatingActualLRPResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RemoveEvacuatingActualLRPResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveEvacuatingActualLRPResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvacuation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvacuation - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvacuation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvacuation(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvacuation - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvacuation(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvacuation - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvacuation - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvacuation - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthEvacuation - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvacuation - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvacuation - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +var File_evacuation_proto protoreflect.FileDescriptor + +const file_evacuation_proto_rawDesc = "" + + "\n" + + "\x10evacuation.proto\x12\x06models\x1a\tbbs.proto\x1a\x10actual_lrp.proto\x1a\verror.proto\"p\n" + + "\x17ProtoEvacuationResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\x12+\n" + + "\x0ekeep_container\x18\x02 \x01(\bB\x03\xc0>\x01R\x0ekeep_container\"\xc6\x01\n" + + "$ProtoEvacuateClaimedActualLRPRequest\x12A\n" + + "\x0eactual_lrp_key\x18\x01 \x01(\v2\x19.models.ProtoActualLRPKeyR\x0eactual_lrp_key\x12[\n" + + "\x17actual_lrp_instance_key\x18\x02 \x01(\v2!.models.ProtoActualLRPInstanceKeyR\x17actual_lrp_instance_key\"\x82\x05\n" + + "$ProtoEvacuateRunningActualLRPRequest\x12A\n" + + "\x0eactual_lrp_key\x18\x01 \x01(\v2\x19.models.ProtoActualLRPKeyR\x0eactual_lrp_key\x12[\n" + + "\x17actual_lrp_instance_key\x18\x02 \x01(\v2!.models.ProtoActualLRPInstanceKeyR\x17actual_lrp_instance_key\x12O\n" + + "\x13actual_lrp_net_info\x18\x03 \x01(\v2\x1d.models.ProtoActualLRPNetInfoR\x13actual_lrp_net_info\x12c\n" + + "\x1aactual_lrp_internal_routes\x18\x05 \x03(\v2#.models.ProtoActualLRPInternalRouteR\x1aactual_lrp_internal_routes\x12^\n" + + "\vmetric_tags\x18\x06 \x03(\v2<.models.ProtoEvacuateRunningActualLRPRequest.MetricTagsEntryR\vmetric_tags\x12\x1f\n" + + "\bRoutable\x18\a \x01(\bH\x00R\bRoutable\x88\x01\x01\x121\n" + + "\x11availability_zone\x18\b \x01(\tB\x03\xc0>\x01R\x11availability_zone\x1a=\n" + + "\x0fMetricTagsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\v\n" + + "\t_RoutableJ\x04\b\x04\x10\x05\"\xc6\x01\n" + + "$ProtoEvacuateStoppedActualLRPRequest\x12A\n" + + "\x0eactual_lrp_key\x18\x01 \x01(\v2\x19.models.ProtoActualLRPKeyR\x0eactual_lrp_key\x12[\n" + + "\x17actual_lrp_instance_key\x18\x02 \x01(\v2!.models.ProtoActualLRPInstanceKeyR\x17actual_lrp_instance_key\"\xf1\x01\n" + + "$ProtoEvacuateCrashedActualLRPRequest\x12A\n" + + "\x0eactual_lrp_key\x18\x01 \x01(\v2\x19.models.ProtoActualLRPKeyR\x0eactual_lrp_key\x12[\n" + + "\x17actual_lrp_instance_key\x18\x02 \x01(\v2!.models.ProtoActualLRPInstanceKeyR\x17actual_lrp_instance_key\x12)\n" + + "\rerror_message\x18\x03 \x01(\tB\x03\xc0>\x01R\rerror_message\"\xc7\x01\n" + + "%ProtoRemoveEvacuatingActualLRPRequest\x12A\n" + + "\x0eactual_lrp_key\x18\x01 \x01(\v2\x19.models.ProtoActualLRPKeyR\x0eactual_lrp_key\x12[\n" + + "\x17actual_lrp_instance_key\x18\x02 \x01(\v2!.models.ProtoActualLRPInstanceKeyR\x17actual_lrp_instance_key\"R\n" + + "&ProtoRemoveEvacuatingActualLRPResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05errorB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthEvacuation = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvacuation = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvacuation = fmt.Errorf("proto: unexpected end of group") + file_evacuation_proto_rawDescOnce sync.Once + file_evacuation_proto_rawDescData []byte ) + +func file_evacuation_proto_rawDescGZIP() []byte { + file_evacuation_proto_rawDescOnce.Do(func() { + file_evacuation_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_evacuation_proto_rawDesc), len(file_evacuation_proto_rawDesc))) + }) + return file_evacuation_proto_rawDescData +} + +var file_evacuation_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_evacuation_proto_goTypes = []any{ + (*ProtoEvacuationResponse)(nil), // 0: models.ProtoEvacuationResponse + (*ProtoEvacuateClaimedActualLRPRequest)(nil), // 1: models.ProtoEvacuateClaimedActualLRPRequest + (*ProtoEvacuateRunningActualLRPRequest)(nil), // 2: models.ProtoEvacuateRunningActualLRPRequest + (*ProtoEvacuateStoppedActualLRPRequest)(nil), // 3: models.ProtoEvacuateStoppedActualLRPRequest + (*ProtoEvacuateCrashedActualLRPRequest)(nil), // 4: models.ProtoEvacuateCrashedActualLRPRequest + (*ProtoRemoveEvacuatingActualLRPRequest)(nil), // 5: models.ProtoRemoveEvacuatingActualLRPRequest + (*ProtoRemoveEvacuatingActualLRPResponse)(nil), // 6: models.ProtoRemoveEvacuatingActualLRPResponse + nil, // 7: models.ProtoEvacuateRunningActualLRPRequest.MetricTagsEntry + (*ProtoError)(nil), // 8: models.ProtoError + (*ProtoActualLRPKey)(nil), // 9: models.ProtoActualLRPKey + (*ProtoActualLRPInstanceKey)(nil), // 10: models.ProtoActualLRPInstanceKey + (*ProtoActualLRPNetInfo)(nil), // 11: models.ProtoActualLRPNetInfo + (*ProtoActualLRPInternalRoute)(nil), // 12: models.ProtoActualLRPInternalRoute +} +var file_evacuation_proto_depIdxs = []int32{ + 8, // 0: models.ProtoEvacuationResponse.error:type_name -> models.ProtoError + 9, // 1: models.ProtoEvacuateClaimedActualLRPRequest.actual_lrp_key:type_name -> models.ProtoActualLRPKey + 10, // 2: models.ProtoEvacuateClaimedActualLRPRequest.actual_lrp_instance_key:type_name -> models.ProtoActualLRPInstanceKey + 9, // 3: models.ProtoEvacuateRunningActualLRPRequest.actual_lrp_key:type_name -> models.ProtoActualLRPKey + 10, // 4: models.ProtoEvacuateRunningActualLRPRequest.actual_lrp_instance_key:type_name -> models.ProtoActualLRPInstanceKey + 11, // 5: models.ProtoEvacuateRunningActualLRPRequest.actual_lrp_net_info:type_name -> models.ProtoActualLRPNetInfo + 12, // 6: models.ProtoEvacuateRunningActualLRPRequest.actual_lrp_internal_routes:type_name -> models.ProtoActualLRPInternalRoute + 7, // 7: models.ProtoEvacuateRunningActualLRPRequest.metric_tags:type_name -> models.ProtoEvacuateRunningActualLRPRequest.MetricTagsEntry + 9, // 8: models.ProtoEvacuateStoppedActualLRPRequest.actual_lrp_key:type_name -> models.ProtoActualLRPKey + 10, // 9: models.ProtoEvacuateStoppedActualLRPRequest.actual_lrp_instance_key:type_name -> models.ProtoActualLRPInstanceKey + 9, // 10: models.ProtoEvacuateCrashedActualLRPRequest.actual_lrp_key:type_name -> models.ProtoActualLRPKey + 10, // 11: models.ProtoEvacuateCrashedActualLRPRequest.actual_lrp_instance_key:type_name -> models.ProtoActualLRPInstanceKey + 9, // 12: models.ProtoRemoveEvacuatingActualLRPRequest.actual_lrp_key:type_name -> models.ProtoActualLRPKey + 10, // 13: models.ProtoRemoveEvacuatingActualLRPRequest.actual_lrp_instance_key:type_name -> models.ProtoActualLRPInstanceKey + 8, // 14: models.ProtoRemoveEvacuatingActualLRPResponse.error:type_name -> models.ProtoError + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_evacuation_proto_init() } +func file_evacuation_proto_init() { + if File_evacuation_proto != nil { + return + } + file_bbs_proto_init() + file_actual_lrp_proto_init() + file_error_proto_init() + file_evacuation_proto_msgTypes[2].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_evacuation_proto_rawDesc), len(file_evacuation_proto_rawDesc)), + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_evacuation_proto_goTypes, + DependencyIndexes: file_evacuation_proto_depIdxs, + MessageInfos: file_evacuation_proto_msgTypes, + }.Build() + File_evacuation_proto = out.File + file_evacuation_proto_goTypes = nil + file_evacuation_proto_depIdxs = nil +} diff --git a/models/evacuation.proto b/models/evacuation.proto index 85f4883d..631975e3 100644 --- a/models/evacuation.proto +++ b/models/evacuation.proto @@ -1,53 +1,50 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; import "actual_lrp.proto"; import "error.proto"; -option (gogoproto.equal_all) = false; - -message EvacuationResponse { - Error error = 1; - bool keep_container = 2 [(gogoproto.jsontag) = "keep_container"]; +message ProtoEvacuationResponse { + ProtoError error = 1; + bool keep_container = 2 [json_name = "keep_container", (bbs.bbs_json_always_emit) = true]; } -message EvacuateClaimedActualLRPRequest { - ActualLRPKey actual_lrp_key = 1; - ActualLRPInstanceKey actual_lrp_instance_key = 2; +message ProtoEvacuateClaimedActualLRPRequest { + ProtoActualLRPKey actual_lrp_key = 1 [json_name = "actual_lrp_key"]; + ProtoActualLRPInstanceKey actual_lrp_instance_key = 2 [json_name = "actual_lrp_instance_key"]; } -message EvacuateRunningActualLRPRequest { +message ProtoEvacuateRunningActualLRPRequest { reserved 4; // previously removed ttl value - ActualLRPKey actual_lrp_key = 1; - ActualLRPInstanceKey actual_lrp_instance_key = 2; - ActualLRPNetInfo actual_lrp_net_info = 3; - repeated ActualLRPInternalRoute actual_lrp_internal_routes = 5; - map metric_tags = 6; - oneof optional_routable { - bool Routable = 7; - } - string availability_zone = 8 [(gogoproto.jsontag) = "availability_zone"]; + ProtoActualLRPKey actual_lrp_key = 1 [json_name = "actual_lrp_key"]; + ProtoActualLRPInstanceKey actual_lrp_instance_key = 2 [json_name = "actual_lrp_instance_key"]; + ProtoActualLRPNetInfo actual_lrp_net_info = 3 [json_name = "actual_lrp_net_info"]; + repeated ProtoActualLRPInternalRoute actual_lrp_internal_routes = 5 [json_name = "actual_lrp_internal_routes"]; + map metric_tags = 6 [json_name = "metric_tags"]; + optional bool Routable = 7; + string availability_zone = 8 [json_name = "availability_zone", (bbs.bbs_json_always_emit) = true]; } -message EvacuateStoppedActualLRPRequest { - ActualLRPKey actual_lrp_key = 1; - ActualLRPInstanceKey actual_lrp_instance_key = 2; +message ProtoEvacuateStoppedActualLRPRequest { + ProtoActualLRPKey actual_lrp_key = 1 [json_name = "actual_lrp_key"]; + ProtoActualLRPInstanceKey actual_lrp_instance_key = 2 [json_name = "actual_lrp_instance_key"]; } -message EvacuateCrashedActualLRPRequest { - ActualLRPKey actual_lrp_key = 1; - ActualLRPInstanceKey actual_lrp_instance_key = 2; - string error_message = 3 [(gogoproto.jsontag) = "error_message"]; +message ProtoEvacuateCrashedActualLRPRequest { + ProtoActualLRPKey actual_lrp_key = 1 [json_name = "actual_lrp_key"]; + ProtoActualLRPInstanceKey actual_lrp_instance_key = 2 [json_name = "actual_lrp_instance_key"]; + string error_message = 3 [json_name = "error_message", (bbs.bbs_json_always_emit) = true]; } -message RemoveEvacuatingActualLRPRequest { - ActualLRPKey actual_lrp_key = 1; - ActualLRPInstanceKey actual_lrp_instance_key = 2; +message ProtoRemoveEvacuatingActualLRPRequest { + ProtoActualLRPKey actual_lrp_key = 1 [json_name = "actual_lrp_key"]; + ProtoActualLRPInstanceKey actual_lrp_instance_key = 2 [json_name = "actual_lrp_instance_key"]; } -message RemoveEvacuatingActualLRPResponse { - Error error = 1; +message ProtoRemoveEvacuatingActualLRPResponse { + ProtoError error = 1; } diff --git a/models/evacuation_bbs.pb.go b/models/evacuation_bbs.pb.go new file mode 100644 index 00000000..92cf5ada --- /dev/null +++ b/models/evacuation_bbs.pb.go @@ -0,0 +1,905 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: evacuation.proto + +package models + +// Prevent copylock errors when using ProtoEvacuationResponse directly +type EvacuationResponse struct { + Error *Error `json:"error,omitempty"` + KeepContainer bool `json:"keep_container"` +} + +func (this *EvacuationResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*EvacuationResponse) + if !ok { + that2, ok := that.(EvacuationResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + if this.KeepContainer != that1.KeepContainer { + return false + } + return true +} +func (m *EvacuationResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *EvacuationResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (m *EvacuationResponse) GetKeepContainer() bool { + if m != nil { + return m.KeepContainer + } + var defaultValue bool + defaultValue = false + return defaultValue +} +func (m *EvacuationResponse) SetKeepContainer(value bool) { + if m != nil { + m.KeepContainer = value + } +} +func (x *EvacuationResponse) ToProto() *ProtoEvacuationResponse { + if x == nil { + return nil + } + + proto := &ProtoEvacuationResponse{ + Error: x.Error.ToProto(), + KeepContainer: x.KeepContainer, + } + return proto +} + +func (x *ProtoEvacuationResponse) FromProto() *EvacuationResponse { + if x == nil { + return nil + } + + copysafe := &EvacuationResponse{ + Error: x.Error.FromProto(), + KeepContainer: x.KeepContainer, + } + return copysafe +} + +func EvacuationResponseToProtoSlice(values []*EvacuationResponse) []*ProtoEvacuationResponse { + if values == nil { + return nil + } + result := make([]*ProtoEvacuationResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func EvacuationResponseFromProtoSlice(values []*ProtoEvacuationResponse) []*EvacuationResponse { + if values == nil { + return nil + } + result := make([]*EvacuationResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoEvacuateClaimedActualLRPRequest directly +type EvacuateClaimedActualLRPRequest struct { + ActualLrpKey *ActualLRPKey `json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ActualLRPInstanceKey `json:"actual_lrp_instance_key,omitempty"` +} + +func (this *EvacuateClaimedActualLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*EvacuateClaimedActualLRPRequest) + if !ok { + that2, ok := that.(EvacuateClaimedActualLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ActualLrpKey == nil { + if that1.ActualLrpKey != nil { + return false + } + } else if !this.ActualLrpKey.Equal(*that1.ActualLrpKey) { + return false + } + if this.ActualLrpInstanceKey == nil { + if that1.ActualLrpInstanceKey != nil { + return false + } + } else if !this.ActualLrpInstanceKey.Equal(*that1.ActualLrpInstanceKey) { + return false + } + return true +} +func (m *EvacuateClaimedActualLRPRequest) GetActualLrpKey() *ActualLRPKey { + if m != nil { + return m.ActualLrpKey + } + return nil +} +func (m *EvacuateClaimedActualLRPRequest) SetActualLrpKey(value *ActualLRPKey) { + if m != nil { + m.ActualLrpKey = value + } +} +func (m *EvacuateClaimedActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { + if m != nil { + return m.ActualLrpInstanceKey + } + return nil +} +func (m *EvacuateClaimedActualLRPRequest) SetActualLrpInstanceKey(value *ActualLRPInstanceKey) { + if m != nil { + m.ActualLrpInstanceKey = value + } +} +func (x *EvacuateClaimedActualLRPRequest) ToProto() *ProtoEvacuateClaimedActualLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoEvacuateClaimedActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.ToProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.ToProto(), + } + return proto +} + +func (x *ProtoEvacuateClaimedActualLRPRequest) FromProto() *EvacuateClaimedActualLRPRequest { + if x == nil { + return nil + } + + copysafe := &EvacuateClaimedActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.FromProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.FromProto(), + } + return copysafe +} + +func EvacuateClaimedActualLRPRequestToProtoSlice(values []*EvacuateClaimedActualLRPRequest) []*ProtoEvacuateClaimedActualLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoEvacuateClaimedActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func EvacuateClaimedActualLRPRequestFromProtoSlice(values []*ProtoEvacuateClaimedActualLRPRequest) []*EvacuateClaimedActualLRPRequest { + if values == nil { + return nil + } + result := make([]*EvacuateClaimedActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoEvacuateRunningActualLRPRequest directly +type EvacuateRunningActualLRPRequest struct { + ActualLrpKey *ActualLRPKey `json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ActualLRPInstanceKey `json:"actual_lrp_instance_key,omitempty"` + ActualLrpNetInfo *ActualLRPNetInfo `json:"actual_lrp_net_info,omitempty"` + ActualLrpInternalRoutes []*ActualLRPInternalRoute `json:"actual_lrp_internal_routes,omitempty"` + MetricTags map[string]string `json:"metric_tags,omitempty"` + Routable *bool `json:"Routable,omitempty"` + AvailabilityZone string `json:"availability_zone"` +} + +func (this *EvacuateRunningActualLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*EvacuateRunningActualLRPRequest) + if !ok { + that2, ok := that.(EvacuateRunningActualLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ActualLrpKey == nil { + if that1.ActualLrpKey != nil { + return false + } + } else if !this.ActualLrpKey.Equal(*that1.ActualLrpKey) { + return false + } + if this.ActualLrpInstanceKey == nil { + if that1.ActualLrpInstanceKey != nil { + return false + } + } else if !this.ActualLrpInstanceKey.Equal(*that1.ActualLrpInstanceKey) { + return false + } + if this.ActualLrpNetInfo == nil { + if that1.ActualLrpNetInfo != nil { + return false + } + } else if !this.ActualLrpNetInfo.Equal(*that1.ActualLrpNetInfo) { + return false + } + if this.ActualLrpInternalRoutes == nil { + if that1.ActualLrpInternalRoutes != nil { + return false + } + } else if len(this.ActualLrpInternalRoutes) != len(that1.ActualLrpInternalRoutes) { + return false + } + for i := range this.ActualLrpInternalRoutes { + if !this.ActualLrpInternalRoutes[i].Equal(that1.ActualLrpInternalRoutes[i]) { + return false + } + } + if this.MetricTags == nil { + if that1.MetricTags != nil { + return false + } + } else if len(this.MetricTags) != len(that1.MetricTags) { + return false + } + for i := range this.MetricTags { + if this.MetricTags[i] != that1.MetricTags[i] { + return false + } + } + if this.Routable == nil { + if that1.Routable != nil { + return false + } + } else if *this.Routable != *that1.Routable { + return false + } + if this.AvailabilityZone != that1.AvailabilityZone { + return false + } + return true +} +func (m *EvacuateRunningActualLRPRequest) GetActualLrpKey() *ActualLRPKey { + if m != nil { + return m.ActualLrpKey + } + return nil +} +func (m *EvacuateRunningActualLRPRequest) SetActualLrpKey(value *ActualLRPKey) { + if m != nil { + m.ActualLrpKey = value + } +} +func (m *EvacuateRunningActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { + if m != nil { + return m.ActualLrpInstanceKey + } + return nil +} +func (m *EvacuateRunningActualLRPRequest) SetActualLrpInstanceKey(value *ActualLRPInstanceKey) { + if m != nil { + m.ActualLrpInstanceKey = value + } +} +func (m *EvacuateRunningActualLRPRequest) GetActualLrpNetInfo() *ActualLRPNetInfo { + if m != nil { + return m.ActualLrpNetInfo + } + return nil +} +func (m *EvacuateRunningActualLRPRequest) SetActualLrpNetInfo(value *ActualLRPNetInfo) { + if m != nil { + m.ActualLrpNetInfo = value + } +} +func (m *EvacuateRunningActualLRPRequest) GetActualLrpInternalRoutes() []*ActualLRPInternalRoute { + if m != nil { + return m.ActualLrpInternalRoutes + } + return nil +} +func (m *EvacuateRunningActualLRPRequest) SetActualLrpInternalRoutes(value []*ActualLRPInternalRoute) { + if m != nil { + m.ActualLrpInternalRoutes = value + } +} +func (m *EvacuateRunningActualLRPRequest) GetMetricTags() map[string]string { + if m != nil { + return m.MetricTags + } + return nil +} +func (m *EvacuateRunningActualLRPRequest) SetMetricTags(value map[string]string) { + if m != nil { + m.MetricTags = value + } +} +func (m *EvacuateRunningActualLRPRequest) RoutableExists() bool { + return m != nil && m.Routable != nil +} +func (m *EvacuateRunningActualLRPRequest) GetRoutable() *bool { + if m != nil && m.Routable != nil { + return m.Routable + } + var defaultValue bool + defaultValue = false + return &defaultValue +} +func (m *EvacuateRunningActualLRPRequest) SetRoutable(value *bool) { + if m != nil { + m.Routable = value + } +} +func (m *EvacuateRunningActualLRPRequest) GetAvailabilityZone() string { + if m != nil { + return m.AvailabilityZone + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *EvacuateRunningActualLRPRequest) SetAvailabilityZone(value string) { + if m != nil { + m.AvailabilityZone = value + } +} +func (x *EvacuateRunningActualLRPRequest) ToProto() *ProtoEvacuateRunningActualLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoEvacuateRunningActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.ToProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.ToProto(), + ActualLrpNetInfo: x.ActualLrpNetInfo.ToProto(), + ActualLrpInternalRoutes: ActualLRPInternalRouteToProtoSlice(x.ActualLrpInternalRoutes), + MetricTags: x.MetricTags, + Routable: x.Routable, + AvailabilityZone: x.AvailabilityZone, + } + return proto +} + +func (x *ProtoEvacuateRunningActualLRPRequest) FromProto() *EvacuateRunningActualLRPRequest { + if x == nil { + return nil + } + + copysafe := &EvacuateRunningActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.FromProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.FromProto(), + ActualLrpNetInfo: x.ActualLrpNetInfo.FromProto(), + ActualLrpInternalRoutes: ActualLRPInternalRouteFromProtoSlice(x.ActualLrpInternalRoutes), + MetricTags: x.MetricTags, + Routable: x.Routable, + AvailabilityZone: x.AvailabilityZone, + } + return copysafe +} + +func EvacuateRunningActualLRPRequestToProtoSlice(values []*EvacuateRunningActualLRPRequest) []*ProtoEvacuateRunningActualLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoEvacuateRunningActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func EvacuateRunningActualLRPRequestFromProtoSlice(values []*ProtoEvacuateRunningActualLRPRequest) []*EvacuateRunningActualLRPRequest { + if values == nil { + return nil + } + result := make([]*EvacuateRunningActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoEvacuateStoppedActualLRPRequest directly +type EvacuateStoppedActualLRPRequest struct { + ActualLrpKey *ActualLRPKey `json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ActualLRPInstanceKey `json:"actual_lrp_instance_key,omitempty"` +} + +func (this *EvacuateStoppedActualLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*EvacuateStoppedActualLRPRequest) + if !ok { + that2, ok := that.(EvacuateStoppedActualLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ActualLrpKey == nil { + if that1.ActualLrpKey != nil { + return false + } + } else if !this.ActualLrpKey.Equal(*that1.ActualLrpKey) { + return false + } + if this.ActualLrpInstanceKey == nil { + if that1.ActualLrpInstanceKey != nil { + return false + } + } else if !this.ActualLrpInstanceKey.Equal(*that1.ActualLrpInstanceKey) { + return false + } + return true +} +func (m *EvacuateStoppedActualLRPRequest) GetActualLrpKey() *ActualLRPKey { + if m != nil { + return m.ActualLrpKey + } + return nil +} +func (m *EvacuateStoppedActualLRPRequest) SetActualLrpKey(value *ActualLRPKey) { + if m != nil { + m.ActualLrpKey = value + } +} +func (m *EvacuateStoppedActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { + if m != nil { + return m.ActualLrpInstanceKey + } + return nil +} +func (m *EvacuateStoppedActualLRPRequest) SetActualLrpInstanceKey(value *ActualLRPInstanceKey) { + if m != nil { + m.ActualLrpInstanceKey = value + } +} +func (x *EvacuateStoppedActualLRPRequest) ToProto() *ProtoEvacuateStoppedActualLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoEvacuateStoppedActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.ToProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.ToProto(), + } + return proto +} + +func (x *ProtoEvacuateStoppedActualLRPRequest) FromProto() *EvacuateStoppedActualLRPRequest { + if x == nil { + return nil + } + + copysafe := &EvacuateStoppedActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.FromProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.FromProto(), + } + return copysafe +} + +func EvacuateStoppedActualLRPRequestToProtoSlice(values []*EvacuateStoppedActualLRPRequest) []*ProtoEvacuateStoppedActualLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoEvacuateStoppedActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func EvacuateStoppedActualLRPRequestFromProtoSlice(values []*ProtoEvacuateStoppedActualLRPRequest) []*EvacuateStoppedActualLRPRequest { + if values == nil { + return nil + } + result := make([]*EvacuateStoppedActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoEvacuateCrashedActualLRPRequest directly +type EvacuateCrashedActualLRPRequest struct { + ActualLrpKey *ActualLRPKey `json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ActualLRPInstanceKey `json:"actual_lrp_instance_key,omitempty"` + ErrorMessage string `json:"error_message"` +} + +func (this *EvacuateCrashedActualLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*EvacuateCrashedActualLRPRequest) + if !ok { + that2, ok := that.(EvacuateCrashedActualLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ActualLrpKey == nil { + if that1.ActualLrpKey != nil { + return false + } + } else if !this.ActualLrpKey.Equal(*that1.ActualLrpKey) { + return false + } + if this.ActualLrpInstanceKey == nil { + if that1.ActualLrpInstanceKey != nil { + return false + } + } else if !this.ActualLrpInstanceKey.Equal(*that1.ActualLrpInstanceKey) { + return false + } + if this.ErrorMessage != that1.ErrorMessage { + return false + } + return true +} +func (m *EvacuateCrashedActualLRPRequest) GetActualLrpKey() *ActualLRPKey { + if m != nil { + return m.ActualLrpKey + } + return nil +} +func (m *EvacuateCrashedActualLRPRequest) SetActualLrpKey(value *ActualLRPKey) { + if m != nil { + m.ActualLrpKey = value + } +} +func (m *EvacuateCrashedActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { + if m != nil { + return m.ActualLrpInstanceKey + } + return nil +} +func (m *EvacuateCrashedActualLRPRequest) SetActualLrpInstanceKey(value *ActualLRPInstanceKey) { + if m != nil { + m.ActualLrpInstanceKey = value + } +} +func (m *EvacuateCrashedActualLRPRequest) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *EvacuateCrashedActualLRPRequest) SetErrorMessage(value string) { + if m != nil { + m.ErrorMessage = value + } +} +func (x *EvacuateCrashedActualLRPRequest) ToProto() *ProtoEvacuateCrashedActualLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoEvacuateCrashedActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.ToProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.ToProto(), + ErrorMessage: x.ErrorMessage, + } + return proto +} + +func (x *ProtoEvacuateCrashedActualLRPRequest) FromProto() *EvacuateCrashedActualLRPRequest { + if x == nil { + return nil + } + + copysafe := &EvacuateCrashedActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.FromProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.FromProto(), + ErrorMessage: x.ErrorMessage, + } + return copysafe +} + +func EvacuateCrashedActualLRPRequestToProtoSlice(values []*EvacuateCrashedActualLRPRequest) []*ProtoEvacuateCrashedActualLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoEvacuateCrashedActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func EvacuateCrashedActualLRPRequestFromProtoSlice(values []*ProtoEvacuateCrashedActualLRPRequest) []*EvacuateCrashedActualLRPRequest { + if values == nil { + return nil + } + result := make([]*EvacuateCrashedActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoRemoveEvacuatingActualLRPRequest directly +type RemoveEvacuatingActualLRPRequest struct { + ActualLrpKey *ActualLRPKey `json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ActualLRPInstanceKey `json:"actual_lrp_instance_key,omitempty"` +} + +func (this *RemoveEvacuatingActualLRPRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*RemoveEvacuatingActualLRPRequest) + if !ok { + that2, ok := that.(RemoveEvacuatingActualLRPRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ActualLrpKey == nil { + if that1.ActualLrpKey != nil { + return false + } + } else if !this.ActualLrpKey.Equal(*that1.ActualLrpKey) { + return false + } + if this.ActualLrpInstanceKey == nil { + if that1.ActualLrpInstanceKey != nil { + return false + } + } else if !this.ActualLrpInstanceKey.Equal(*that1.ActualLrpInstanceKey) { + return false + } + return true +} +func (m *RemoveEvacuatingActualLRPRequest) GetActualLrpKey() *ActualLRPKey { + if m != nil { + return m.ActualLrpKey + } + return nil +} +func (m *RemoveEvacuatingActualLRPRequest) SetActualLrpKey(value *ActualLRPKey) { + if m != nil { + m.ActualLrpKey = value + } +} +func (m *RemoveEvacuatingActualLRPRequest) GetActualLrpInstanceKey() *ActualLRPInstanceKey { + if m != nil { + return m.ActualLrpInstanceKey + } + return nil +} +func (m *RemoveEvacuatingActualLRPRequest) SetActualLrpInstanceKey(value *ActualLRPInstanceKey) { + if m != nil { + m.ActualLrpInstanceKey = value + } +} +func (x *RemoveEvacuatingActualLRPRequest) ToProto() *ProtoRemoveEvacuatingActualLRPRequest { + if x == nil { + return nil + } + + proto := &ProtoRemoveEvacuatingActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.ToProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.ToProto(), + } + return proto +} + +func (x *ProtoRemoveEvacuatingActualLRPRequest) FromProto() *RemoveEvacuatingActualLRPRequest { + if x == nil { + return nil + } + + copysafe := &RemoveEvacuatingActualLRPRequest{ + ActualLrpKey: x.ActualLrpKey.FromProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.FromProto(), + } + return copysafe +} + +func RemoveEvacuatingActualLRPRequestToProtoSlice(values []*RemoveEvacuatingActualLRPRequest) []*ProtoRemoveEvacuatingActualLRPRequest { + if values == nil { + return nil + } + result := make([]*ProtoRemoveEvacuatingActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func RemoveEvacuatingActualLRPRequestFromProtoSlice(values []*ProtoRemoveEvacuatingActualLRPRequest) []*RemoveEvacuatingActualLRPRequest { + if values == nil { + return nil + } + result := make([]*RemoveEvacuatingActualLRPRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoRemoveEvacuatingActualLRPResponse directly +type RemoveEvacuatingActualLRPResponse struct { + Error *Error `json:"error,omitempty"` +} + +func (this *RemoveEvacuatingActualLRPResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*RemoveEvacuatingActualLRPResponse) + if !ok { + that2, ok := that.(RemoveEvacuatingActualLRPResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + return true +} +func (m *RemoveEvacuatingActualLRPResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *RemoveEvacuatingActualLRPResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (x *RemoveEvacuatingActualLRPResponse) ToProto() *ProtoRemoveEvacuatingActualLRPResponse { + if x == nil { + return nil + } + + proto := &ProtoRemoveEvacuatingActualLRPResponse{ + Error: x.Error.ToProto(), + } + return proto +} + +func (x *ProtoRemoveEvacuatingActualLRPResponse) FromProto() *RemoveEvacuatingActualLRPResponse { + if x == nil { + return nil + } + + copysafe := &RemoveEvacuatingActualLRPResponse{ + Error: x.Error.FromProto(), + } + return copysafe +} + +func RemoveEvacuatingActualLRPResponseToProtoSlice(values []*RemoveEvacuatingActualLRPResponse) []*ProtoRemoveEvacuatingActualLRPResponse { + if values == nil { + return nil + } + result := make([]*ProtoRemoveEvacuatingActualLRPResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func RemoveEvacuatingActualLRPResponseFromProtoSlice(values []*ProtoRemoveEvacuatingActualLRPResponse) []*RemoveEvacuatingActualLRPResponse { + if values == nil { + return nil + } + result := make([]*RemoveEvacuatingActualLRPResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/events.go b/models/events.go index d09fa1f0..e904b200 100644 --- a/models/events.go +++ b/models/events.go @@ -2,13 +2,13 @@ package models import ( "code.cloudfoundry.org/bbs/format" - "github.com/gogo/protobuf/proto" + "google.golang.org/protobuf/proto" ) type Event interface { EventType() string Key() string - proto.Message + ToEventProto() proto.Message } const ( @@ -33,6 +33,8 @@ const ( EventTypeTaskCreated = "task_created" EventTypeTaskChanged = "task_changed" EventTypeTaskRemoved = "task_removed" + + EventTypeFake = "fake" ) // Downgrade the DesiredLRPEvent payload (i.e. DesiredLRP(s)) to the given @@ -83,6 +85,10 @@ func (event *DesiredLRPCreatedEvent) Key() string { return event.DesiredLrp.GetProcessGuid() } +func (event *DesiredLRPCreatedEvent) ToEventProto() proto.Message { + return event.ToProto() +} + func NewDesiredLRPChangedEvent(before, after *DesiredLRP, traceId string) *DesiredLRPChangedEvent { return &DesiredLRPChangedEvent{ Before: before, @@ -99,6 +105,10 @@ func (event *DesiredLRPChangedEvent) Key() string { return event.Before.GetProcessGuid() } +func (event *DesiredLRPChangedEvent) ToEventProto() proto.Message { + return event.ToProto() +} + func NewDesiredLRPRemovedEvent(desiredLRP *DesiredLRP, traceId string) *DesiredLRPRemovedEvent { return &DesiredLRPRemovedEvent{ DesiredLrp: desiredLRP, @@ -114,6 +124,10 @@ func (event DesiredLRPRemovedEvent) Key() string { return event.DesiredLrp.GetProcessGuid() } +func (event *DesiredLRPRemovedEvent) ToEventProto() proto.Message { + return event.ToProto() +} + // FIXME: change the signature func NewActualLRPInstanceChangedEvent(before, after *ActualLRP, traceId string) *ActualLRPInstanceChangedEvent { var ( @@ -121,23 +135,23 @@ func NewActualLRPInstanceChangedEvent(before, after *ActualLRP, traceId string) actualLRPInstanceKey ActualLRPInstanceKey ) - if (before != nil && before.ActualLRPKey != ActualLRPKey{}) { - actualLRPKey = before.ActualLRPKey + if (before != nil && before.ActualLrpKey != ActualLRPKey{}) { + actualLRPKey = before.ActualLrpKey } - if (after != nil && after.ActualLRPKey != ActualLRPKey{}) { - actualLRPKey = after.ActualLRPKey + if (after != nil && after.ActualLrpKey != ActualLRPKey{}) { + actualLRPKey = after.ActualLrpKey } - if (before != nil && before.ActualLRPInstanceKey != ActualLRPInstanceKey{}) { - actualLRPInstanceKey = before.ActualLRPInstanceKey + if (before != nil && before.ActualLrpInstanceKey != ActualLRPInstanceKey{}) { + actualLRPInstanceKey = before.ActualLrpInstanceKey } - if (after != nil && after.ActualLRPInstanceKey != ActualLRPInstanceKey{}) { - actualLRPInstanceKey = after.ActualLRPInstanceKey + if (after != nil && after.ActualLrpInstanceKey != ActualLRPInstanceKey{}) { + actualLRPInstanceKey = after.ActualLrpInstanceKey } return &ActualLRPInstanceChangedEvent{ - ActualLRPKey: actualLRPKey, - ActualLRPInstanceKey: actualLRPInstanceKey, + ActualLrpKey: actualLRPKey, + ActualLrpInstanceKey: actualLRPInstanceKey, Before: before.ToActualLRPInfo(), After: after.ToActualLRPInfo(), TraceId: traceId, @@ -149,7 +163,11 @@ func (event *ActualLRPInstanceChangedEvent) EventType() string { } func (event *ActualLRPInstanceChangedEvent) Key() string { - return event.GetInstanceGuid() + return event.ActualLrpInstanceKey.GetInstanceGuid() +} + +func (event *ActualLRPInstanceChangedEvent) ToEventProto() proto.Message { + return event.ToProto() } // Deprecated: use the ActualLRPInstance versions of this instead @@ -171,13 +189,18 @@ func (event *ActualLRPChangedEvent) Key() string { if resolveError != nil { return "" } - return actualLRP.GetInstanceGuid() + return actualLRP.ActualLrpInstanceKey.GetInstanceGuid() +} + +// Deprecated: use the ActualLRPInstance versions of this instead +func (event *ActualLRPChangedEvent) ToEventProto() proto.Message { + return event.ToProto() } func NewActualLRPCrashedEvent(before, after *ActualLRP) *ActualLRPCrashedEvent { return &ActualLRPCrashedEvent{ - ActualLRPKey: after.ActualLRPKey, - ActualLRPInstanceKey: before.ActualLRPInstanceKey, + ActualLrpKey: after.ActualLrpKey, + ActualLrpInstanceKey: before.ActualLrpInstanceKey, CrashCount: after.CrashCount, CrashReason: after.CrashReason, Since: after.Since, @@ -189,7 +212,11 @@ func (event *ActualLRPCrashedEvent) EventType() string { } func (event *ActualLRPCrashedEvent) Key() string { - return event.ActualLRPInstanceKey.InstanceGuid + return event.ActualLrpInstanceKey.InstanceGuid +} + +func (event *ActualLRPCrashedEvent) ToEventProto() proto.Message { + return event.ToProto() } // Deprecated: use the ActualLRPInstance versions of this instead @@ -210,7 +237,12 @@ func (event *ActualLRPRemovedEvent) Key() string { if resolveError != nil { return "" } - return actualLRP.GetInstanceGuid() + return actualLRP.ActualLrpInstanceKey.GetInstanceGuid() +} + +// Deprecated: use the ActualLRPInstance versions of this instead +func (event *ActualLRPRemovedEvent) ToEventProto() proto.Message { + return event.ToProto() } func NewActualLRPInstanceRemovedEvent(actualLrp *ActualLRP, traceId string) *ActualLRPInstanceRemovedEvent { @@ -228,7 +260,11 @@ func (event *ActualLRPInstanceRemovedEvent) Key() string { if event.ActualLrp == nil { return "" } - return event.ActualLrp.GetInstanceGuid() + return event.ActualLrp.ActualLrpInstanceKey.GetInstanceGuid() +} + +func (event *ActualLRPInstanceRemovedEvent) ToEventProto() proto.Message { + return event.ToProto() } // Deprecated: use the ActualLRPInstance versions of this instead @@ -249,7 +285,11 @@ func (event *ActualLRPCreatedEvent) Key() string { if resolveError != nil { return "" } - return actualLRP.GetInstanceGuid() + return actualLRP.ActualLrpInstanceKey.GetInstanceGuid() +} + +func (event *ActualLRPCreatedEvent) ToEventProto() proto.Message { + return event.ToProto() } func NewActualLRPInstanceCreatedEvent(actualLrp *ActualLRP, traceId string) *ActualLRPInstanceCreatedEvent { @@ -267,7 +307,15 @@ func (event *ActualLRPInstanceCreatedEvent) Key() string { if event.ActualLrp == nil { return "" } - return event.ActualLrp.GetInstanceGuid() + return event.ActualLrp.ActualLrpInstanceKey.GetInstanceGuid() +} + +func (event *ActualLRPInstanceCreatedEvent) ToEventProto() proto.Message { + return event.ToProto() +} + +func (request *ProtoEventsByCellId) Validate() error { + return request.FromProto().Validate() } func (request *EventsByCellId) Validate() error { @@ -288,6 +336,10 @@ func (event *TaskCreatedEvent) Key() string { return event.Task.GetTaskGuid() } +func (event *TaskCreatedEvent) ToEventProto() proto.Message { + return event.ToProto() +} + func NewTaskChangedEvent(before, after *Task) *TaskChangedEvent { return &TaskChangedEvent{ Before: before, @@ -303,6 +355,10 @@ func (event *TaskChangedEvent) Key() string { return event.Before.GetTaskGuid() } +func (event *TaskChangedEvent) ToEventProto() proto.Message { + return event.ToProto() +} + func NewTaskRemovedEvent(task *Task) *TaskRemovedEvent { return &TaskRemovedEvent{ Task: task, @@ -317,13 +373,18 @@ func (event TaskRemovedEvent) Key() string { return event.Task.GetTaskGuid() } -func (info *ActualLRPInfo) SetRoutable(routable bool) { - info.OptionalRoutable = &ActualLRPInfo_Routable{ - Routable: routable, - } +func (event *TaskRemovedEvent) ToEventProto() proto.Message { + return event.ToProto() +} + +func (event *FakeEvent) EventType() string { + return EventTypeFake +} + +func (event FakeEvent) Key() string { + return event.Token } -func (info *ActualLRPInfo) RoutableExists() bool { - _, ok := info.GetOptionalRoutable().(*ActualLRPInfo_Routable) - return ok +func (event *FakeEvent) ToEventProto() proto.Message { + return event.ToProto() } diff --git a/models/events.pb.go b/models/events.pb.go index 1716470b..1b50f484 100644 --- a/models/events.pb.go +++ b/models/events.pb.go @@ -1,4977 +1,1100 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: events.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// Deprecated: Do not use. -type ActualLRPCreatedEvent struct { - ActualLrpGroup *ActualLRPGroup `protobuf:"bytes,1,opt,name=actual_lrp_group,json=actualLrpGroup,proto3" json:"actual_lrp_group,omitempty"` +// Deprecated: Marked as deprecated in events.proto. +type ProtoActualLRPCreatedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpGroup *ProtoActualLRPGroup `protobuf:"bytes,1,opt,name=actual_lrp_group,proto3" json:"actual_lrp_group,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPCreatedEvent) Reset() { *m = ActualLRPCreatedEvent{} } -func (*ActualLRPCreatedEvent) ProtoMessage() {} -func (*ActualLRPCreatedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{0} +func (x *ProtoActualLRPCreatedEvent) Reset() { + *x = ProtoActualLRPCreatedEvent{} + mi := &file_events_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPCreatedEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoActualLRPCreatedEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPCreatedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPCreatedEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoActualLRPCreatedEvent) ProtoMessage() {} + +func (x *ProtoActualLRPCreatedEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ActualLRPCreatedEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPCreatedEvent.Merge(m, src) -} -func (m *ActualLRPCreatedEvent) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPCreatedEvent) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPCreatedEvent.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ActualLRPCreatedEvent proto.InternalMessageInfo +// Deprecated: Use ProtoActualLRPCreatedEvent.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPCreatedEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{0} +} -func (m *ActualLRPCreatedEvent) GetActualLrpGroup() *ActualLRPGroup { - if m != nil { - return m.ActualLrpGroup +func (x *ProtoActualLRPCreatedEvent) GetActualLrpGroup() *ProtoActualLRPGroup { + if x != nil { + return x.ActualLrpGroup } return nil } -// Deprecated: Do not use. -type ActualLRPChangedEvent struct { - Before *ActualLRPGroup `protobuf:"bytes,1,opt,name=before,proto3" json:"before,omitempty"` - After *ActualLRPGroup `protobuf:"bytes,2,opt,name=after,proto3" json:"after,omitempty"` +// Deprecated: Marked as deprecated in events.proto. +type ProtoActualLRPChangedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + Before *ProtoActualLRPGroup `protobuf:"bytes,1,opt,name=before,proto3" json:"before,omitempty"` + After *ProtoActualLRPGroup `protobuf:"bytes,2,opt,name=after,proto3" json:"after,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPChangedEvent) Reset() { *m = ActualLRPChangedEvent{} } -func (*ActualLRPChangedEvent) ProtoMessage() {} -func (*ActualLRPChangedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{1} +func (x *ProtoActualLRPChangedEvent) Reset() { + *x = ProtoActualLRPChangedEvent{} + mi := &file_events_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPChangedEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoActualLRPChangedEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPChangedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPChangedEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoActualLRPChangedEvent) ProtoMessage() {} + +func (x *ProtoActualLRPChangedEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ActualLRPChangedEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPChangedEvent.Merge(m, src) -} -func (m *ActualLRPChangedEvent) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPChangedEvent) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPChangedEvent.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ActualLRPChangedEvent proto.InternalMessageInfo +// Deprecated: Use ProtoActualLRPChangedEvent.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPChangedEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{1} +} -func (m *ActualLRPChangedEvent) GetBefore() *ActualLRPGroup { - if m != nil { - return m.Before +func (x *ProtoActualLRPChangedEvent) GetBefore() *ProtoActualLRPGroup { + if x != nil { + return x.Before } return nil } -func (m *ActualLRPChangedEvent) GetAfter() *ActualLRPGroup { - if m != nil { - return m.After +func (x *ProtoActualLRPChangedEvent) GetAfter() *ProtoActualLRPGroup { + if x != nil { + return x.After } return nil } -// Deprecated: Do not use. -type ActualLRPRemovedEvent struct { - ActualLrpGroup *ActualLRPGroup `protobuf:"bytes,1,opt,name=actual_lrp_group,json=actualLrpGroup,proto3" json:"actual_lrp_group,omitempty"` +// Deprecated: Marked as deprecated in events.proto. +type ProtoActualLRPRemovedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpGroup *ProtoActualLRPGroup `protobuf:"bytes,1,opt,name=actual_lrp_group,proto3" json:"actual_lrp_group,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPRemovedEvent) Reset() { *m = ActualLRPRemovedEvent{} } -func (*ActualLRPRemovedEvent) ProtoMessage() {} -func (*ActualLRPRemovedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{2} +func (x *ProtoActualLRPRemovedEvent) Reset() { + *x = ProtoActualLRPRemovedEvent{} + mi := &file_events_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPRemovedEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoActualLRPRemovedEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPRemovedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPRemovedEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoActualLRPRemovedEvent) ProtoMessage() {} + +func (x *ProtoActualLRPRemovedEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ActualLRPRemovedEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPRemovedEvent.Merge(m, src) -} -func (m *ActualLRPRemovedEvent) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPRemovedEvent) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPRemovedEvent.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ActualLRPRemovedEvent proto.InternalMessageInfo +// Deprecated: Use ProtoActualLRPRemovedEvent.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPRemovedEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{2} +} -func (m *ActualLRPRemovedEvent) GetActualLrpGroup() *ActualLRPGroup { - if m != nil { - return m.ActualLrpGroup +func (x *ProtoActualLRPRemovedEvent) GetActualLrpGroup() *ProtoActualLRPGroup { + if x != nil { + return x.ActualLrpGroup } return nil } -type ActualLRPInstanceCreatedEvent struct { - ActualLrp *ActualLRP `protobuf:"bytes,1,opt,name=actual_lrp,json=actualLrp,proto3" json:"actual_lrp,omitempty"` - TraceId string `protobuf:"bytes,2,opt,name=trace_id,json=traceId,proto3" json:"trace_id"` +type ProtoActualLRPInstanceCreatedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrp *ProtoActualLRP `protobuf:"bytes,1,opt,name=actual_lrp,proto3" json:"actual_lrp,omitempty"` + TraceId string `protobuf:"bytes,2,opt,name=trace_id,proto3" json:"trace_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPInstanceCreatedEvent) Reset() { *m = ActualLRPInstanceCreatedEvent{} } -func (*ActualLRPInstanceCreatedEvent) ProtoMessage() {} -func (*ActualLRPInstanceCreatedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{3} +func (x *ProtoActualLRPInstanceCreatedEvent) Reset() { + *x = ProtoActualLRPInstanceCreatedEvent{} + mi := &file_events_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPInstanceCreatedEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoActualLRPInstanceCreatedEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPInstanceCreatedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPInstanceCreatedEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoActualLRPInstanceCreatedEvent) ProtoMessage() {} + +func (x *ProtoActualLRPInstanceCreatedEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ActualLRPInstanceCreatedEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPInstanceCreatedEvent.Merge(m, src) -} -func (m *ActualLRPInstanceCreatedEvent) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPInstanceCreatedEvent) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPInstanceCreatedEvent.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ActualLRPInstanceCreatedEvent proto.InternalMessageInfo +// Deprecated: Use ProtoActualLRPInstanceCreatedEvent.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPInstanceCreatedEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{3} +} -func (m *ActualLRPInstanceCreatedEvent) GetActualLrp() *ActualLRP { - if m != nil { - return m.ActualLrp +func (x *ProtoActualLRPInstanceCreatedEvent) GetActualLrp() *ProtoActualLRP { + if x != nil { + return x.ActualLrp } return nil } -func (m *ActualLRPInstanceCreatedEvent) GetTraceId() string { - if m != nil { - return m.TraceId +func (x *ProtoActualLRPInstanceCreatedEvent) GetTraceId() string { + if x != nil { + return x.TraceId } return "" } -type ActualLRPInfo struct { - ActualLRPNetInfo `protobuf:"bytes,3,opt,name=actual_lrp_net_info,json=actualLrpNetInfo,proto3,embedded=actual_lrp_net_info" json:""` - CrashCount int32 `protobuf:"varint,4,opt,name=crash_count,json=crashCount,proto3" json:"crash_count"` - CrashReason string `protobuf:"bytes,5,opt,name=crash_reason,json=crashReason,proto3" json:"crash_reason,omitempty"` - State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state"` - PlacementError string `protobuf:"bytes,7,opt,name=placement_error,json=placementError,proto3" json:"placement_error,omitempty"` - Since int64 `protobuf:"varint,8,opt,name=since,proto3" json:"since"` - ModificationTag ModificationTag `protobuf:"bytes,9,opt,name=modification_tag,json=modificationTag,proto3" json:"modification_tag"` - Presence ActualLRP_Presence `protobuf:"varint,10,opt,name=presence,proto3,enum=models.ActualLRP_Presence" json:"presence"` - // Types that are valid to be assigned to OptionalRoutable: - // *ActualLRPInfo_Routable - OptionalRoutable isActualLRPInfo_OptionalRoutable `protobuf_oneof:"optional_routable"` - AvailabilityZone string `protobuf:"bytes,12,opt,name=availability_zone,json=availabilityZone,proto3" json:"availability_zone"` +type ProtoActualLRPInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpNetInfo *ProtoActualLRPNetInfo `protobuf:"bytes,3,opt,name=actual_lrp_net_info,proto3" json:"actual_lrp_net_info,omitempty"` + CrashCount int32 `protobuf:"varint,4,opt,name=crash_count,proto3" json:"crash_count,omitempty"` + CrashReason string `protobuf:"bytes,5,opt,name=crash_reason,proto3" json:"crash_reason,omitempty"` + State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state,omitempty"` + PlacementError string `protobuf:"bytes,7,opt,name=placement_error,proto3" json:"placement_error,omitempty"` + Since int64 `protobuf:"varint,8,opt,name=since,proto3" json:"since,omitempty"` + ModificationTag *ProtoModificationTag `protobuf:"bytes,9,opt,name=modification_tag,proto3" json:"modification_tag,omitempty"` + Presence ProtoActualLRP_Presence `protobuf:"varint,10,opt,name=presence,proto3,enum=models.ProtoActualLRP_Presence" json:"presence,omitempty"` + Routable *bool `protobuf:"varint,11,opt,name=Routable,proto3,oneof" json:"Routable,omitempty"` + AvailabilityZone string `protobuf:"bytes,12,opt,name=availability_zone,proto3" json:"availability_zone,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPInfo) Reset() { *m = ActualLRPInfo{} } -func (*ActualLRPInfo) ProtoMessage() {} -func (*ActualLRPInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{4} -} -func (m *ActualLRPInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActualLRPInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ActualLRPInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPInfo.Merge(m, src) -} -func (m *ActualLRPInfo) XXX_Size() int { - return m.Size() +func (x *ProtoActualLRPInfo) Reset() { + *x = ProtoActualLRPInfo{} + mi := &file_events_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPInfo.DiscardUnknown(m) + +func (x *ProtoActualLRPInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_ActualLRPInfo proto.InternalMessageInfo +func (*ProtoActualLRPInfo) ProtoMessage() {} -type isActualLRPInfo_OptionalRoutable interface { - isActualLRPInfo_OptionalRoutable() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int +func (x *ProtoActualLRPInfo) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type ActualLRPInfo_Routable struct { - Routable bool `protobuf:"varint,11,opt,name=Routable,proto3,oneof" json:"Routable,omitempty"` +// Deprecated: Use ProtoActualLRPInfo.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPInfo) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{4} } -func (*ActualLRPInfo_Routable) isActualLRPInfo_OptionalRoutable() {} - -func (m *ActualLRPInfo) GetOptionalRoutable() isActualLRPInfo_OptionalRoutable { - if m != nil { - return m.OptionalRoutable +func (x *ProtoActualLRPInfo) GetActualLrpNetInfo() *ProtoActualLRPNetInfo { + if x != nil { + return x.ActualLrpNetInfo } return nil } -func (m *ActualLRPInfo) GetCrashCount() int32 { - if m != nil { - return m.CrashCount +func (x *ProtoActualLRPInfo) GetCrashCount() int32 { + if x != nil { + return x.CrashCount } return 0 } -func (m *ActualLRPInfo) GetCrashReason() string { - if m != nil { - return m.CrashReason +func (x *ProtoActualLRPInfo) GetCrashReason() string { + if x != nil { + return x.CrashReason } return "" } -func (m *ActualLRPInfo) GetState() string { - if m != nil { - return m.State +func (x *ProtoActualLRPInfo) GetState() string { + if x != nil { + return x.State } return "" } -func (m *ActualLRPInfo) GetPlacementError() string { - if m != nil { - return m.PlacementError +func (x *ProtoActualLRPInfo) GetPlacementError() string { + if x != nil { + return x.PlacementError } return "" } -func (m *ActualLRPInfo) GetSince() int64 { - if m != nil { - return m.Since +func (x *ProtoActualLRPInfo) GetSince() int64 { + if x != nil { + return x.Since } return 0 } -func (m *ActualLRPInfo) GetModificationTag() ModificationTag { - if m != nil { - return m.ModificationTag +func (x *ProtoActualLRPInfo) GetModificationTag() *ProtoModificationTag { + if x != nil { + return x.ModificationTag } - return ModificationTag{} + return nil } -func (m *ActualLRPInfo) GetPresence() ActualLRP_Presence { - if m != nil { - return m.Presence +func (x *ProtoActualLRPInfo) GetPresence() ProtoActualLRP_Presence { + if x != nil { + return x.Presence } - return ActualLRP_Ordinary + return ProtoActualLRP_ORDINARY } -func (m *ActualLRPInfo) GetRoutable() bool { - if x, ok := m.GetOptionalRoutable().(*ActualLRPInfo_Routable); ok { - return x.Routable +func (x *ProtoActualLRPInfo) GetRoutable() bool { + if x != nil && x.Routable != nil { + return *x.Routable } return false } -func (m *ActualLRPInfo) GetAvailabilityZone() string { - if m != nil { - return m.AvailabilityZone +func (x *ProtoActualLRPInfo) GetAvailabilityZone() string { + if x != nil { + return x.AvailabilityZone } return "" } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ActualLRPInfo) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ActualLRPInfo_Routable)(nil), - } +type ProtoActualLRPInstanceChangedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpKey *ProtoActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,proto3" json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ProtoActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,proto3" json:"actual_lrp_instance_key,omitempty"` + Before *ProtoActualLRPInfo `protobuf:"bytes,3,opt,name=before,proto3" json:"before,omitempty"` + After *ProtoActualLRPInfo `protobuf:"bytes,4,opt,name=after,proto3" json:"after,omitempty"` + TraceId string `protobuf:"bytes,5,opt,name=trace_id,proto3" json:"trace_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -type ActualLRPInstanceChangedEvent struct { - ActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,json=actualLrpKey,proto3,embedded=actual_lrp_key" json:""` - ActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,json=actualLrpInstanceKey,proto3,embedded=actual_lrp_instance_key" json:""` - Before *ActualLRPInfo `protobuf:"bytes,3,opt,name=before,proto3" json:"before,omitempty"` - After *ActualLRPInfo `protobuf:"bytes,4,opt,name=after,proto3" json:"after,omitempty"` - TraceId string `protobuf:"bytes,5,opt,name=trace_id,json=traceId,proto3" json:"trace_id"` +func (x *ProtoActualLRPInstanceChangedEvent) Reset() { + *x = ProtoActualLRPInstanceChangedEvent{} + mi := &file_events_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPInstanceChangedEvent) Reset() { *m = ActualLRPInstanceChangedEvent{} } -func (*ActualLRPInstanceChangedEvent) ProtoMessage() {} -func (*ActualLRPInstanceChangedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{5} +func (x *ProtoActualLRPInstanceChangedEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPInstanceChangedEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActualLRPInstanceChangedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPInstanceChangedEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoActualLRPInstanceChangedEvent) ProtoMessage() {} + +func (x *ProtoActualLRPInstanceChangedEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *ActualLRPInstanceChangedEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPInstanceChangedEvent.Merge(m, src) -} -func (m *ActualLRPInstanceChangedEvent) XXX_Size() int { - return m.Size() + +// Deprecated: Use ProtoActualLRPInstanceChangedEvent.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPInstanceChangedEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{5} } -func (m *ActualLRPInstanceChangedEvent) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPInstanceChangedEvent.DiscardUnknown(m) + +func (x *ProtoActualLRPInstanceChangedEvent) GetActualLrpKey() *ProtoActualLRPKey { + if x != nil { + return x.ActualLrpKey + } + return nil } -var xxx_messageInfo_ActualLRPInstanceChangedEvent proto.InternalMessageInfo +func (x *ProtoActualLRPInstanceChangedEvent) GetActualLrpInstanceKey() *ProtoActualLRPInstanceKey { + if x != nil { + return x.ActualLrpInstanceKey + } + return nil +} -func (m *ActualLRPInstanceChangedEvent) GetBefore() *ActualLRPInfo { - if m != nil { - return m.Before +func (x *ProtoActualLRPInstanceChangedEvent) GetBefore() *ProtoActualLRPInfo { + if x != nil { + return x.Before } return nil } -func (m *ActualLRPInstanceChangedEvent) GetAfter() *ActualLRPInfo { - if m != nil { - return m.After +func (x *ProtoActualLRPInstanceChangedEvent) GetAfter() *ProtoActualLRPInfo { + if x != nil { + return x.After } return nil } -func (m *ActualLRPInstanceChangedEvent) GetTraceId() string { - if m != nil { - return m.TraceId +func (x *ProtoActualLRPInstanceChangedEvent) GetTraceId() string { + if x != nil { + return x.TraceId } return "" } -type ActualLRPInstanceRemovedEvent struct { - ActualLrp *ActualLRP `protobuf:"bytes,1,opt,name=actual_lrp,json=actualLrp,proto3" json:"actual_lrp,omitempty"` - TraceId string `protobuf:"bytes,2,opt,name=trace_id,json=traceId,proto3" json:"trace_id"` +type ProtoActualLRPInstanceRemovedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrp *ProtoActualLRP `protobuf:"bytes,1,opt,name=actual_lrp,proto3" json:"actual_lrp,omitempty"` + TraceId string `protobuf:"bytes,2,opt,name=trace_id,proto3" json:"trace_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPInstanceRemovedEvent) Reset() { *m = ActualLRPInstanceRemovedEvent{} } -func (*ActualLRPInstanceRemovedEvent) ProtoMessage() {} -func (*ActualLRPInstanceRemovedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{6} +func (x *ProtoActualLRPInstanceRemovedEvent) Reset() { + *x = ProtoActualLRPInstanceRemovedEvent{} + mi := &file_events_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPInstanceRemovedEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoActualLRPInstanceRemovedEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPInstanceRemovedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPInstanceRemovedEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoActualLRPInstanceRemovedEvent) ProtoMessage() {} + +func (x *ProtoActualLRPInstanceRemovedEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ActualLRPInstanceRemovedEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPInstanceRemovedEvent.Merge(m, src) -} -func (m *ActualLRPInstanceRemovedEvent) XXX_Size() int { - return m.Size() -} -func (m *ActualLRPInstanceRemovedEvent) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPInstanceRemovedEvent.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ActualLRPInstanceRemovedEvent proto.InternalMessageInfo +// Deprecated: Use ProtoActualLRPInstanceRemovedEvent.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPInstanceRemovedEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{6} +} -func (m *ActualLRPInstanceRemovedEvent) GetActualLrp() *ActualLRP { - if m != nil { - return m.ActualLrp +func (x *ProtoActualLRPInstanceRemovedEvent) GetActualLrp() *ProtoActualLRP { + if x != nil { + return x.ActualLrp } return nil } -func (m *ActualLRPInstanceRemovedEvent) GetTraceId() string { - if m != nil { - return m.TraceId +func (x *ProtoActualLRPInstanceRemovedEvent) GetTraceId() string { + if x != nil { + return x.TraceId } return "" } -type DesiredLRPCreatedEvent struct { - DesiredLrp *DesiredLRP `protobuf:"bytes,1,opt,name=desired_lrp,json=desiredLrp,proto3" json:"desired_lrp,omitempty"` - TraceId string `protobuf:"bytes,2,opt,name=trace_id,json=traceId,proto3" json:"trace_id"` +type ProtoDesiredLRPCreatedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + DesiredLrp *ProtoDesiredLRP `protobuf:"bytes,1,opt,name=desired_lrp,proto3" json:"desired_lrp,omitempty"` + TraceId string `protobuf:"bytes,2,opt,name=trace_id,proto3" json:"trace_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DesiredLRPCreatedEvent) Reset() { *m = DesiredLRPCreatedEvent{} } -func (*DesiredLRPCreatedEvent) ProtoMessage() {} -func (*DesiredLRPCreatedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{7} +func (x *ProtoDesiredLRPCreatedEvent) Reset() { + *x = ProtoDesiredLRPCreatedEvent{} + mi := &file_events_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DesiredLRPCreatedEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoDesiredLRPCreatedEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DesiredLRPCreatedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPCreatedEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoDesiredLRPCreatedEvent) ProtoMessage() {} + +func (x *ProtoDesiredLRPCreatedEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *DesiredLRPCreatedEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPCreatedEvent.Merge(m, src) -} -func (m *DesiredLRPCreatedEvent) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRPCreatedEvent) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPCreatedEvent.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_DesiredLRPCreatedEvent proto.InternalMessageInfo +// Deprecated: Use ProtoDesiredLRPCreatedEvent.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPCreatedEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{7} +} -func (m *DesiredLRPCreatedEvent) GetDesiredLrp() *DesiredLRP { - if m != nil { - return m.DesiredLrp +func (x *ProtoDesiredLRPCreatedEvent) GetDesiredLrp() *ProtoDesiredLRP { + if x != nil { + return x.DesiredLrp } return nil } -func (m *DesiredLRPCreatedEvent) GetTraceId() string { - if m != nil { - return m.TraceId +func (x *ProtoDesiredLRPCreatedEvent) GetTraceId() string { + if x != nil { + return x.TraceId } return "" } -type DesiredLRPChangedEvent struct { - Before *DesiredLRP `protobuf:"bytes,1,opt,name=before,proto3" json:"before,omitempty"` - After *DesiredLRP `protobuf:"bytes,2,opt,name=after,proto3" json:"after,omitempty"` - TraceId string `protobuf:"bytes,3,opt,name=trace_id,json=traceId,proto3" json:"trace_id"` +type ProtoDesiredLRPChangedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + Before *ProtoDesiredLRP `protobuf:"bytes,1,opt,name=before,proto3" json:"before,omitempty"` + After *ProtoDesiredLRP `protobuf:"bytes,2,opt,name=after,proto3" json:"after,omitempty"` + TraceId string `protobuf:"bytes,3,opt,name=trace_id,proto3" json:"trace_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DesiredLRPChangedEvent) Reset() { *m = DesiredLRPChangedEvent{} } -func (*DesiredLRPChangedEvent) ProtoMessage() {} -func (*DesiredLRPChangedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{8} +func (x *ProtoDesiredLRPChangedEvent) Reset() { + *x = ProtoDesiredLRPChangedEvent{} + mi := &file_events_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DesiredLRPChangedEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoDesiredLRPChangedEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DesiredLRPChangedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPChangedEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoDesiredLRPChangedEvent) ProtoMessage() {} + +func (x *ProtoDesiredLRPChangedEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *DesiredLRPChangedEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPChangedEvent.Merge(m, src) -} -func (m *DesiredLRPChangedEvent) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRPChangedEvent) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPChangedEvent.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_DesiredLRPChangedEvent proto.InternalMessageInfo +// Deprecated: Use ProtoDesiredLRPChangedEvent.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPChangedEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{8} +} -func (m *DesiredLRPChangedEvent) GetBefore() *DesiredLRP { - if m != nil { - return m.Before +func (x *ProtoDesiredLRPChangedEvent) GetBefore() *ProtoDesiredLRP { + if x != nil { + return x.Before } return nil } -func (m *DesiredLRPChangedEvent) GetAfter() *DesiredLRP { - if m != nil { - return m.After +func (x *ProtoDesiredLRPChangedEvent) GetAfter() *ProtoDesiredLRP { + if x != nil { + return x.After } return nil } -func (m *DesiredLRPChangedEvent) GetTraceId() string { - if m != nil { - return m.TraceId +func (x *ProtoDesiredLRPChangedEvent) GetTraceId() string { + if x != nil { + return x.TraceId } return "" } -type DesiredLRPRemovedEvent struct { - DesiredLrp *DesiredLRP `protobuf:"bytes,1,opt,name=desired_lrp,json=desiredLrp,proto3" json:"desired_lrp,omitempty"` - TraceId string `protobuf:"bytes,2,opt,name=trace_id,json=traceId,proto3" json:"trace_id"` +type ProtoDesiredLRPRemovedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + DesiredLrp *ProtoDesiredLRP `protobuf:"bytes,1,opt,name=desired_lrp,proto3" json:"desired_lrp,omitempty"` + TraceId string `protobuf:"bytes,2,opt,name=trace_id,proto3" json:"trace_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DesiredLRPRemovedEvent) Reset() { *m = DesiredLRPRemovedEvent{} } -func (*DesiredLRPRemovedEvent) ProtoMessage() {} -func (*DesiredLRPRemovedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{9} +func (x *ProtoDesiredLRPRemovedEvent) Reset() { + *x = ProtoDesiredLRPRemovedEvent{} + mi := &file_events_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DesiredLRPRemovedEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoDesiredLRPRemovedEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DesiredLRPRemovedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesiredLRPRemovedEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoDesiredLRPRemovedEvent) ProtoMessage() {} + +func (x *ProtoDesiredLRPRemovedEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *DesiredLRPRemovedEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesiredLRPRemovedEvent.Merge(m, src) -} -func (m *DesiredLRPRemovedEvent) XXX_Size() int { - return m.Size() -} -func (m *DesiredLRPRemovedEvent) XXX_DiscardUnknown() { - xxx_messageInfo_DesiredLRPRemovedEvent.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_DesiredLRPRemovedEvent proto.InternalMessageInfo +// Deprecated: Use ProtoDesiredLRPRemovedEvent.ProtoReflect.Descriptor instead. +func (*ProtoDesiredLRPRemovedEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{9} +} -func (m *DesiredLRPRemovedEvent) GetDesiredLrp() *DesiredLRP { - if m != nil { - return m.DesiredLrp +func (x *ProtoDesiredLRPRemovedEvent) GetDesiredLrp() *ProtoDesiredLRP { + if x != nil { + return x.DesiredLrp } return nil } -func (m *DesiredLRPRemovedEvent) GetTraceId() string { - if m != nil { - return m.TraceId +func (x *ProtoDesiredLRPRemovedEvent) GetTraceId() string { + if x != nil { + return x.TraceId } return "" } -type ActualLRPCrashedEvent struct { - ActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,json=actualLrpKey,proto3,embedded=actual_lrp_key" json:""` - ActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,json=actualLrpInstanceKey,proto3,embedded=actual_lrp_instance_key" json:""` - CrashCount int32 `protobuf:"varint,3,opt,name=crash_count,json=crashCount,proto3" json:"crash_count"` - CrashReason string `protobuf:"bytes,4,opt,name=crash_reason,json=crashReason,proto3" json:"crash_reason,omitempty"` - Since int64 `protobuf:"varint,5,opt,name=since,proto3" json:"since"` +type ProtoActualLRPCrashedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActualLrpKey *ProtoActualLRPKey `protobuf:"bytes,1,opt,name=actual_lrp_key,proto3" json:"actual_lrp_key,omitempty"` + ActualLrpInstanceKey *ProtoActualLRPInstanceKey `protobuf:"bytes,2,opt,name=actual_lrp_instance_key,proto3" json:"actual_lrp_instance_key,omitempty"` + CrashCount int32 `protobuf:"varint,3,opt,name=crash_count,proto3" json:"crash_count,omitempty"` + CrashReason string `protobuf:"bytes,4,opt,name=crash_reason,proto3" json:"crash_reason,omitempty"` + Since int64 `protobuf:"varint,5,opt,name=since,proto3" json:"since,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ActualLRPCrashedEvent) Reset() { *m = ActualLRPCrashedEvent{} } -func (*ActualLRPCrashedEvent) ProtoMessage() {} -func (*ActualLRPCrashedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{10} +func (x *ProtoActualLRPCrashedEvent) Reset() { + *x = ProtoActualLRPCrashedEvent{} + mi := &file_events_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ActualLRPCrashedEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoActualLRPCrashedEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ActualLRPCrashedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActualLRPCrashedEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoActualLRPCrashedEvent) ProtoMessage() {} + +func (x *ProtoActualLRPCrashedEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *ActualLRPCrashedEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActualLRPCrashedEvent.Merge(m, src) -} -func (m *ActualLRPCrashedEvent) XXX_Size() int { - return m.Size() + +// Deprecated: Use ProtoActualLRPCrashedEvent.ProtoReflect.Descriptor instead. +func (*ProtoActualLRPCrashedEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{10} } -func (m *ActualLRPCrashedEvent) XXX_DiscardUnknown() { - xxx_messageInfo_ActualLRPCrashedEvent.DiscardUnknown(m) + +func (x *ProtoActualLRPCrashedEvent) GetActualLrpKey() *ProtoActualLRPKey { + if x != nil { + return x.ActualLrpKey + } + return nil } -var xxx_messageInfo_ActualLRPCrashedEvent proto.InternalMessageInfo +func (x *ProtoActualLRPCrashedEvent) GetActualLrpInstanceKey() *ProtoActualLRPInstanceKey { + if x != nil { + return x.ActualLrpInstanceKey + } + return nil +} -func (m *ActualLRPCrashedEvent) GetCrashCount() int32 { - if m != nil { - return m.CrashCount +func (x *ProtoActualLRPCrashedEvent) GetCrashCount() int32 { + if x != nil { + return x.CrashCount } return 0 } -func (m *ActualLRPCrashedEvent) GetCrashReason() string { - if m != nil { - return m.CrashReason +func (x *ProtoActualLRPCrashedEvent) GetCrashReason() string { + if x != nil { + return x.CrashReason } return "" } -func (m *ActualLRPCrashedEvent) GetSince() int64 { - if m != nil { - return m.Since +func (x *ProtoActualLRPCrashedEvent) GetSince() int64 { + if x != nil { + return x.Since } return 0 } -type EventsByCellId struct { - CellId string `protobuf:"bytes,1,opt,name=cell_id,json=cellId,proto3" json:"cell_id"` +type ProtoEventsByCellId struct { + state protoimpl.MessageState `protogen:"open.v1"` + CellId string `protobuf:"bytes,1,opt,name=cell_id,proto3" json:"cell_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *EventsByCellId) Reset() { *m = EventsByCellId{} } -func (*EventsByCellId) ProtoMessage() {} -func (*EventsByCellId) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{11} +func (x *ProtoEventsByCellId) Reset() { + *x = ProtoEventsByCellId{} + mi := &file_events_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *EventsByCellId) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoEventsByCellId) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *EventsByCellId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventsByCellId.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoEventsByCellId) ProtoMessage() {} + +func (x *ProtoEventsByCellId) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *EventsByCellId) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventsByCellId.Merge(m, src) -} -func (m *EventsByCellId) XXX_Size() int { - return m.Size() -} -func (m *EventsByCellId) XXX_DiscardUnknown() { - xxx_messageInfo_EventsByCellId.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_EventsByCellId proto.InternalMessageInfo +// Deprecated: Use ProtoEventsByCellId.ProtoReflect.Descriptor instead. +func (*ProtoEventsByCellId) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{11} +} -func (m *EventsByCellId) GetCellId() string { - if m != nil { - return m.CellId +func (x *ProtoEventsByCellId) GetCellId() string { + if x != nil { + return x.CellId } return "" } -type TaskCreatedEvent struct { - Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` +type ProtoTaskCreatedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + Task *ProtoTask `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *TaskCreatedEvent) Reset() { *m = TaskCreatedEvent{} } -func (*TaskCreatedEvent) ProtoMessage() {} -func (*TaskCreatedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{12} -} -func (m *TaskCreatedEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TaskCreatedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskCreatedEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TaskCreatedEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskCreatedEvent.Merge(m, src) -} -func (m *TaskCreatedEvent) XXX_Size() int { - return m.Size() -} -func (m *TaskCreatedEvent) XXX_DiscardUnknown() { - xxx_messageInfo_TaskCreatedEvent.DiscardUnknown(m) +func (x *ProtoTaskCreatedEvent) Reset() { + *x = ProtoTaskCreatedEvent{} + mi := &file_events_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -var xxx_messageInfo_TaskCreatedEvent proto.InternalMessageInfo - -func (m *TaskCreatedEvent) GetTask() *Task { - if m != nil { - return m.Task - } - return nil +func (x *ProtoTaskCreatedEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -type TaskChangedEvent struct { - Before *Task `protobuf:"bytes,1,opt,name=before,proto3" json:"before,omitempty"` - After *Task `protobuf:"bytes,2,opt,name=after,proto3" json:"after,omitempty"` -} +func (*ProtoTaskCreatedEvent) ProtoMessage() {} -func (m *TaskChangedEvent) Reset() { *m = TaskChangedEvent{} } -func (*TaskChangedEvent) ProtoMessage() {} -func (*TaskChangedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{13} -} -func (m *TaskChangedEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TaskChangedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskChangedEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoTaskCreatedEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *TaskChangedEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskChangedEvent.Merge(m, src) -} -func (m *TaskChangedEvent) XXX_Size() int { - return m.Size() -} -func (m *TaskChangedEvent) XXX_DiscardUnknown() { - xxx_messageInfo_TaskChangedEvent.DiscardUnknown(m) -} - -var xxx_messageInfo_TaskChangedEvent proto.InternalMessageInfo -func (m *TaskChangedEvent) GetBefore() *Task { - if m != nil { - return m.Before - } - return nil +// Deprecated: Use ProtoTaskCreatedEvent.ProtoReflect.Descriptor instead. +func (*ProtoTaskCreatedEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{12} } -func (m *TaskChangedEvent) GetAfter() *Task { - if m != nil { - return m.After +func (x *ProtoTaskCreatedEvent) GetTask() *ProtoTask { + if x != nil { + return x.Task } return nil } -type TaskRemovedEvent struct { - Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` +type ProtoTaskChangedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + Before *ProtoTask `protobuf:"bytes,1,opt,name=before,proto3" json:"before,omitempty"` + After *ProtoTask `protobuf:"bytes,2,opt,name=after,proto3" json:"after,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *TaskRemovedEvent) Reset() { *m = TaskRemovedEvent{} } -func (*TaskRemovedEvent) ProtoMessage() {} -func (*TaskRemovedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_8f22242cb04491f9, []int{14} +func (x *ProtoTaskChangedEvent) Reset() { + *x = ProtoTaskChangedEvent{} + mi := &file_events_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TaskRemovedEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoTaskChangedEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TaskRemovedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskRemovedEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoTaskChangedEvent) ProtoMessage() {} + +func (x *ProtoTaskChangedEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *TaskRemovedEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskRemovedEvent.Merge(m, src) -} -func (m *TaskRemovedEvent) XXX_Size() int { - return m.Size() -} -func (m *TaskRemovedEvent) XXX_DiscardUnknown() { - xxx_messageInfo_TaskRemovedEvent.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_TaskRemovedEvent proto.InternalMessageInfo +// Deprecated: Use ProtoTaskChangedEvent.ProtoReflect.Descriptor instead. +func (*ProtoTaskChangedEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{13} +} -func (m *TaskRemovedEvent) GetTask() *Task { - if m != nil { - return m.Task +func (x *ProtoTaskChangedEvent) GetBefore() *ProtoTask { + if x != nil { + return x.Before } return nil } -func init() { - proto.RegisterType((*ActualLRPCreatedEvent)(nil), "models.ActualLRPCreatedEvent") - proto.RegisterType((*ActualLRPChangedEvent)(nil), "models.ActualLRPChangedEvent") - proto.RegisterType((*ActualLRPRemovedEvent)(nil), "models.ActualLRPRemovedEvent") - proto.RegisterType((*ActualLRPInstanceCreatedEvent)(nil), "models.ActualLRPInstanceCreatedEvent") - proto.RegisterType((*ActualLRPInfo)(nil), "models.ActualLRPInfo") - proto.RegisterType((*ActualLRPInstanceChangedEvent)(nil), "models.ActualLRPInstanceChangedEvent") - proto.RegisterType((*ActualLRPInstanceRemovedEvent)(nil), "models.ActualLRPInstanceRemovedEvent") - proto.RegisterType((*DesiredLRPCreatedEvent)(nil), "models.DesiredLRPCreatedEvent") - proto.RegisterType((*DesiredLRPChangedEvent)(nil), "models.DesiredLRPChangedEvent") - proto.RegisterType((*DesiredLRPRemovedEvent)(nil), "models.DesiredLRPRemovedEvent") - proto.RegisterType((*ActualLRPCrashedEvent)(nil), "models.ActualLRPCrashedEvent") - proto.RegisterType((*EventsByCellId)(nil), "models.EventsByCellId") - proto.RegisterType((*TaskCreatedEvent)(nil), "models.TaskCreatedEvent") - proto.RegisterType((*TaskChangedEvent)(nil), "models.TaskChangedEvent") - proto.RegisterType((*TaskRemovedEvent)(nil), "models.TaskRemovedEvent") +func (x *ProtoTaskChangedEvent) GetAfter() *ProtoTask { + if x != nil { + return x.After + } + return nil } -func init() { proto.RegisterFile("events.proto", fileDescriptor_8f22242cb04491f9) } - -var fileDescriptor_8f22242cb04491f9 = []byte{ - // 913 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x4f, 0x6f, 0xdb, 0x36, - 0x14, 0x17, 0x13, 0xdb, 0x71, 0x9e, 0x3d, 0xc7, 0x61, 0x9b, 0x54, 0x08, 0x3a, 0xc9, 0x33, 0x0a, - 0xd4, 0xd8, 0x56, 0xb7, 0x68, 0x8b, 0x1d, 0x76, 0xda, 0x9c, 0x16, 0x6b, 0xd0, 0x6e, 0x28, 0x88, - 0xee, 0x32, 0x74, 0x10, 0x68, 0x99, 0x76, 0x84, 0xc8, 0xa2, 0x21, 0xd1, 0x01, 0xdc, 0xd3, 0x3e, - 0xc2, 0x6e, 0xfb, 0x0a, 0xfb, 0x0c, 0xbb, 0xed, 0xd6, 0x63, 0x76, 0xeb, 0x49, 0x58, 0x9c, 0xcb, - 0xe0, 0x53, 0x3f, 0xc2, 0x20, 0x52, 0x52, 0x29, 0xdb, 0x48, 0x57, 0x60, 0x39, 0xf4, 0x64, 0xf2, - 0xbd, 0x1f, 0x7f, 0xef, 0x0f, 0x1f, 0x7f, 0x32, 0xd4, 0xd9, 0x29, 0x0b, 0x44, 0xd4, 0x9d, 0x84, - 0x5c, 0x70, 0x5c, 0x19, 0xf3, 0x01, 0xf3, 0xa3, 0x83, 0x3b, 0x23, 0x4f, 0x1c, 0x4f, 0xfb, 0x5d, - 0x97, 0x8f, 0xef, 0x8e, 0xf8, 0x88, 0xdf, 0x95, 0xee, 0xfe, 0x74, 0x28, 0x77, 0x72, 0x23, 0x57, - 0xea, 0xd8, 0x41, 0x93, 0xba, 0x62, 0x4a, 0x7d, 0xc7, 0x0f, 0x27, 0xa9, 0x65, 0x77, 0xc0, 0x22, - 0x2f, 0x64, 0x03, 0xcd, 0x04, 0x82, 0x46, 0x27, 0xe9, 0x7a, 0x7f, 0xcc, 0x07, 0xde, 0xd0, 0x73, - 0xa9, 0xf0, 0x78, 0xe0, 0x08, 0x3a, 0x52, 0xf6, 0xf6, 0xcf, 0xb0, 0xf7, 0xad, 0xa4, 0x7a, 0x46, - 0x9e, 0x1f, 0x86, 0x8c, 0x0a, 0x36, 0x78, 0x9c, 0xe4, 0x87, 0xbf, 0x01, 0x2d, 0x86, 0x33, 0x0a, - 0xf9, 0x74, 0x62, 0xa2, 0x16, 0xea, 0xd4, 0xee, 0xef, 0x77, 0x55, 0xce, 0xdd, 0xfc, 0xe0, 0x77, - 0x89, 0x97, 0x34, 0x14, 0xfe, 0x59, 0x38, 0x91, 0xfb, 0xaf, 0x37, 0x4c, 0xd4, 0x9e, 0xe9, 0xf4, - 0xc7, 0x34, 0x18, 0x65, 0xf4, 0x5d, 0xa8, 0xf4, 0xd9, 0x90, 0x87, 0xec, 0x3d, 0xa4, 0x29, 0x0a, - 0x7f, 0x09, 0x65, 0x3a, 0x14, 0x2c, 0x34, 0x37, 0x2e, 0x85, 0x2b, 0x90, 0x0c, 0xad, 0x57, 0x46, - 0xd8, 0x98, 0x9f, 0xfe, 0xbf, 0x95, 0xbd, 0x82, 0x4f, 0x73, 0xd4, 0x51, 0x10, 0x09, 0x1a, 0xb8, - 0xac, 0xd0, 0xc0, 0x7b, 0x00, 0xef, 0xc2, 0xa4, 0x01, 0x76, 0x57, 0x02, 0x90, 0xed, 0x9c, 0x1b, - 0xdf, 0x86, 0xaa, 0x08, 0xa9, 0xcb, 0x1c, 0x6f, 0x20, 0xcb, 0xdc, 0xee, 0xd5, 0x17, 0xb1, 0x9d, - 0xdb, 0xc8, 0x96, 0x5c, 0x1d, 0x0d, 0xda, 0x7f, 0x96, 0xe0, 0x13, 0x2d, 0xf8, 0x90, 0xe3, 0x1f, - 0xe1, 0x9a, 0x56, 0x53, 0xc0, 0x84, 0xe3, 0x05, 0x43, 0x6e, 0x6e, 0xca, 0xa8, 0xe6, 0x4a, 0xd4, - 0x1f, 0x98, 0x48, 0x8e, 0xf5, 0xea, 0xaf, 0x63, 0xdb, 0x38, 0x8b, 0x6d, 0xb4, 0x88, 0x6d, 0x83, - 0x34, 0xf3, 0x54, 0x52, 0x3f, 0xbe, 0x07, 0x35, 0x37, 0xa4, 0xd1, 0xb1, 0xe3, 0xf2, 0x69, 0x20, - 0xcc, 0x52, 0x0b, 0x75, 0xca, 0xbd, 0x9d, 0x45, 0x6c, 0xeb, 0x66, 0x02, 0x72, 0x73, 0x98, 0xac, - 0xf1, 0x67, 0x50, 0x57, 0xae, 0x90, 0xd1, 0x88, 0x07, 0x66, 0x39, 0xa9, 0x83, 0x28, 0x38, 0x91, - 0x26, 0x6c, 0x43, 0x39, 0x12, 0x54, 0x30, 0xb3, 0x22, 0x6b, 0xdc, 0x5e, 0xc4, 0xb6, 0x32, 0x10, - 0xf5, 0x83, 0x6f, 0xc3, 0xce, 0xc4, 0xa7, 0x2e, 0x1b, 0xb3, 0x40, 0x38, 0x2c, 0x0c, 0x79, 0x68, - 0x6e, 0x49, 0x9a, 0x46, 0x6e, 0x7e, 0x9c, 0x58, 0x25, 0x93, 0x17, 0xb8, 0xcc, 0xac, 0xb6, 0x50, - 0x67, 0x33, 0x65, 0x4a, 0x0c, 0x44, 0xfd, 0xe0, 0x97, 0xd0, 0x5c, 0x9e, 0x7b, 0x73, 0x5b, 0xf6, - 0xe4, 0x46, 0xd6, 0x93, 0xef, 0x35, 0xff, 0x0b, 0x3a, 0xea, 0x99, 0x49, 0x4b, 0x16, 0xb1, 0xbd, - 0x72, 0x90, 0xec, 0x8c, 0x8b, 0x50, 0xfc, 0x08, 0xaa, 0x93, 0x90, 0x45, 0x2c, 0xc9, 0x00, 0x5a, - 0xa8, 0xd3, 0xb8, 0x7f, 0xb0, 0xd2, 0xe9, 0xee, 0xf3, 0x14, 0xa1, 0xee, 0x32, 0xc3, 0x93, 0x7c, - 0x85, 0x6f, 0x42, 0x95, 0xf0, 0xa9, 0xa0, 0x7d, 0x9f, 0x99, 0xb5, 0x16, 0xea, 0x54, 0x9f, 0x18, - 0x24, 0xb7, 0xe0, 0x1e, 0xec, 0xd2, 0x53, 0xea, 0xf9, 0xb4, 0xef, 0xf9, 0x9e, 0x98, 0x39, 0xaf, - 0x78, 0xc0, 0xcc, 0xba, 0x6c, 0xdc, 0xde, 0x22, 0xb6, 0x57, 0x9d, 0xa4, 0xa9, 0x9b, 0x7e, 0xe2, - 0x01, 0xeb, 0x5d, 0x83, 0x5d, 0x3e, 0x49, 0x92, 0xa6, 0xbe, 0x13, 0xa6, 0xc4, 0xed, 0xbf, 0x36, - 0xd6, 0x0d, 0xb0, 0xfe, 0x44, 0x9f, 0x40, 0x43, 0x9b, 0xa9, 0x13, 0x36, 0x4b, 0x87, 0xf8, 0xfa, - 0x4a, 0x91, 0x4f, 0xd9, 0x6c, 0x69, 0x94, 0xea, 0xf9, 0x28, 0x3d, 0x65, 0x33, 0x4c, 0xe1, 0x86, - 0xc6, 0xe4, 0xa5, 0xc1, 0x24, 0xa5, 0x7a, 0xce, 0x37, 0x57, 0x28, 0xb3, 0x8c, 0x56, 0xa9, 0xaf, - 0xe7, 0xd4, 0x1a, 0x06, 0xdf, 0xc9, 0xf5, 0x44, 0xcd, 0xfc, 0xde, 0x1a, 0xc6, 0x21, 0xcf, 0xe5, - 0xe4, 0x8b, 0x4c, 0x4e, 0x4a, 0x97, 0xa1, 0x15, 0xa6, 0xf0, 0x2e, 0xcb, 0x97, 0xbd, 0xcb, 0x75, - 0x9a, 0x50, 0x90, 0x9e, 0x2b, 0xd4, 0x84, 0x53, 0xd8, 0x7f, 0xa4, 0xbe, 0x00, 0xcb, 0x4a, 0xfe, - 0x00, 0x6a, 0xda, 0xb7, 0x21, 0x8d, 0x8a, 0xb3, 0xa8, 0xef, 0x0e, 0x11, 0x48, 0x61, 0x1f, 0x14, - 0xf7, 0x37, 0x54, 0x08, 0xac, 0x0f, 0xd0, 0xe7, 0x4b, 0x1a, 0xbf, 0x2e, 0x66, 0x76, 0x21, 0x9d, - 0xa2, 0xbe, 0xaf, 0x83, 0xae, 0xb9, 0x8d, 0xcd, 0xff, 0xdc, 0x91, 0xc2, 0x35, 0x5c, 0x6d, 0x47, - 0xfe, 0xd8, 0x28, 0x7c, 0x53, 0x69, 0x74, 0xfc, 0x51, 0xbe, 0xa8, 0x25, 0xed, 0xdf, 0xfc, 0x70, - 0xed, 0x2f, 0xad, 0xd7, 0x7e, 0xa9, 0xd8, 0xe5, 0xf5, 0x8a, 0xdd, 0xfe, 0x0a, 0x1a, 0xb2, 0x57, - 0x51, 0x6f, 0x76, 0xc8, 0x7c, 0xff, 0x68, 0x80, 0x6f, 0xc1, 0x96, 0xcb, 0x7c, 0x3f, 0x69, 0x3b, - 0x92, 0x6d, 0xaf, 0x2d, 0x62, 0x3b, 0x33, 0x91, 0x8a, 0x2b, 0x51, 0xed, 0x87, 0xd0, 0x7c, 0x41, - 0xa3, 0x93, 0xc2, 0xe0, 0xb7, 0xa0, 0x94, 0xfc, 0x03, 0x4a, 0x9b, 0x5c, 0xcf, 0x3a, 0x92, 0xe0, - 0x88, 0xf4, 0xb4, 0x5f, 0xa6, 0xa7, 0xf4, 0xa9, 0xbd, 0xb5, 0x34, 0xb5, 0xc5, 0x73, 0xd9, 0xbc, - 0xb6, 0x8b, 0xf3, 0x5a, 0x04, 0x29, 0x57, 0x96, 0x53, 0x61, 0xf4, 0xde, 0x9b, 0x53, 0xef, 0xe1, - 0xd9, 0xb9, 0x65, 0xbc, 0x39, 0xb7, 0x8c, 0xb7, 0xe7, 0x16, 0xfa, 0x65, 0x6e, 0xa1, 0xdf, 0xe7, - 0x16, 0x7a, 0x3d, 0xb7, 0xd0, 0xd9, 0xdc, 0x42, 0x7f, 0xcf, 0x2d, 0xf4, 0xcf, 0xdc, 0x32, 0xde, - 0xce, 0x2d, 0xf4, 0xeb, 0x85, 0x65, 0x9c, 0x5d, 0x58, 0xc6, 0x9b, 0x0b, 0xcb, 0xe8, 0x57, 0xe4, - 0xdf, 0xb9, 0x07, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x15, 0xfc, 0xcc, 0x44, 0x5e, 0x0a, 0x00, - 0x00, +type ProtoTaskRemovedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + Task *ProtoTask `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (this *ActualLRPCreatedEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ActualLRPCreatedEvent) - if !ok { - that2, ok := that.(ActualLRPCreatedEvent) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.ActualLrpGroup.Equal(that1.ActualLrpGroup) { - return false - } - return true +func (x *ProtoTaskRemovedEvent) Reset() { + *x = ProtoTaskRemovedEvent{} + mi := &file_events_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (this *ActualLRPChangedEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPChangedEvent) - if !ok { - that2, ok := that.(ActualLRPChangedEvent) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Before.Equal(that1.Before) { - return false - } - if !this.After.Equal(that1.After) { - return false - } - return true +func (x *ProtoTaskRemovedEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *ActualLRPRemovedEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPRemovedEvent) - if !ok { - that2, ok := that.(ActualLRPRemovedEvent) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.ActualLrpGroup.Equal(that1.ActualLrpGroup) { - return false - } - return true -} -func (this *ActualLRPInstanceCreatedEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoTaskRemovedEvent) ProtoMessage() {} - that1, ok := that.(*ActualLRPInstanceCreatedEvent) - if !ok { - that2, ok := that.(ActualLRPInstanceCreatedEvent) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoTaskRemovedEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.ActualLrp.Equal(that1.ActualLrp) { - return false - } - if this.TraceId != that1.TraceId { - return false - } - return true + return mi.MessageOf(x) } -func (this *ActualLRPInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPInfo) - if !ok { - that2, ok := that.(ActualLRPInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.ActualLRPNetInfo.Equal(&that1.ActualLRPNetInfo) { - return false - } - if this.CrashCount != that1.CrashCount { - return false - } - if this.CrashReason != that1.CrashReason { - return false - } - if this.State != that1.State { - return false - } - if this.PlacementError != that1.PlacementError { - return false - } - if this.Since != that1.Since { - return false - } - if !this.ModificationTag.Equal(&that1.ModificationTag) { - return false - } - if this.Presence != that1.Presence { - return false - } - if that1.OptionalRoutable == nil { - if this.OptionalRoutable != nil { - return false - } - } else if this.OptionalRoutable == nil { - return false - } else if !this.OptionalRoutable.Equal(that1.OptionalRoutable) { - return false - } - if this.AvailabilityZone != that1.AvailabilityZone { - return false - } - return true +// Deprecated: Use ProtoTaskRemovedEvent.ProtoReflect.Descriptor instead. +func (*ProtoTaskRemovedEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{14} } -func (this *ActualLRPInfo_Routable) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPInfo_Routable) - if !ok { - that2, ok := that.(ActualLRPInfo_Routable) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Routable != that1.Routable { - return false +func (x *ProtoTaskRemovedEvent) GetTask() *ProtoTask { + if x != nil { + return x.Task } - return true + return nil } -func (this *ActualLRPInstanceChangedEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPInstanceChangedEvent) - if !ok { - that2, ok := that.(ActualLRPInstanceChangedEvent) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.ActualLRPKey.Equal(&that1.ActualLRPKey) { - return false - } - if !this.ActualLRPInstanceKey.Equal(&that1.ActualLRPInstanceKey) { - return false - } - if !this.Before.Equal(that1.Before) { - return false - } - if !this.After.Equal(that1.After) { - return false - } - if this.TraceId != that1.TraceId { - return false - } - return true +type ProtoFakeEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (this *ActualLRPInstanceRemovedEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPInstanceRemovedEvent) - if !ok { - that2, ok := that.(ActualLRPInstanceRemovedEvent) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.ActualLrp.Equal(that1.ActualLrp) { - return false - } - if this.TraceId != that1.TraceId { - return false - } - return true +func (x *ProtoFakeEvent) Reset() { + *x = ProtoFakeEvent{} + mi := &file_events_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (this *DesiredLRPCreatedEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*DesiredLRPCreatedEvent) - if !ok { - that2, ok := that.(DesiredLRPCreatedEvent) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.DesiredLrp.Equal(that1.DesiredLrp) { - return false - } - if this.TraceId != that1.TraceId { - return false - } - return true +func (x *ProtoFakeEvent) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *DesiredLRPChangedEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*DesiredLRPChangedEvent) - if !ok { - that2, ok := that.(DesiredLRPChangedEvent) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Before.Equal(that1.Before) { - return false - } - if !this.After.Equal(that1.After) { - return false - } - if this.TraceId != that1.TraceId { - return false - } - return true -} -func (this *DesiredLRPRemovedEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoFakeEvent) ProtoMessage() {} - that1, ok := that.(*DesiredLRPRemovedEvent) - if !ok { - that2, ok := that.(DesiredLRPRemovedEvent) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoFakeEvent) ProtoReflect() protoreflect.Message { + mi := &file_events_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.DesiredLrp.Equal(that1.DesiredLrp) { - return false - } - if this.TraceId != that1.TraceId { - return false - } - return true + return mi.MessageOf(x) } -func (this *ActualLRPCrashedEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ActualLRPCrashedEvent) - if !ok { - that2, ok := that.(ActualLRPCrashedEvent) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.ActualLRPKey.Equal(&that1.ActualLRPKey) { - return false - } - if !this.ActualLRPInstanceKey.Equal(&that1.ActualLRPInstanceKey) { - return false - } - if this.CrashCount != that1.CrashCount { - return false - } - if this.CrashReason != that1.CrashReason { - return false - } - if this.Since != that1.Since { - return false - } - return true +// Deprecated: Use ProtoFakeEvent.ProtoReflect.Descriptor instead. +func (*ProtoFakeEvent) Descriptor() ([]byte, []int) { + return file_events_proto_rawDescGZIP(), []int{15} } -func (this *EventsByCellId) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*EventsByCellId) - if !ok { - that2, ok := that.(EventsByCellId) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false +func (x *ProtoFakeEvent) GetToken() string { + if x != nil { + return x.Token } - if this.CellId != that1.CellId { - return false - } - return true + return "" } -func (this *TaskCreatedEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*TaskCreatedEvent) - if !ok { - that2, ok := that.(TaskCreatedEvent) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Task.Equal(that1.Task) { - return false - } - return true -} -func (this *TaskChangedEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +var File_events_proto protoreflect.FileDescriptor + +const file_events_proto_rawDesc = "" + + "\n" + + "\fevents.proto\x12\x06models\x1a\x10actual_lrp.proto\x1a\tbbs.proto\x1a\x11desired_lrp.proto\x1a\n" + + "task.proto\x1a\x16modification_tag.proto\"i\n" + + "\x1aProtoActualLRPCreatedEvent\x12G\n" + + "\x10actual_lrp_group\x18\x01 \x01(\v2\x1b.models.ProtoActualLRPGroupR\x10actual_lrp_group:\x02\x18\x01\"\x88\x01\n" + + "\x1aProtoActualLRPChangedEvent\x123\n" + + "\x06before\x18\x01 \x01(\v2\x1b.models.ProtoActualLRPGroupR\x06before\x121\n" + + "\x05after\x18\x02 \x01(\v2\x1b.models.ProtoActualLRPGroupR\x05after:\x02\x18\x01\"i\n" + + "\x1aProtoActualLRPRemovedEvent\x12G\n" + + "\x10actual_lrp_group\x18\x01 \x01(\v2\x1b.models.ProtoActualLRPGroupR\x10actual_lrp_group:\x02\x18\x01\"}\n" + + "\"ProtoActualLRPInstanceCreatedEvent\x126\n" + + "\n" + + "actual_lrp\x18\x01 \x01(\v2\x16.models.ProtoActualLRPR\n" + + "actual_lrp\x12\x1f\n" + + "\btrace_id\x18\x02 \x01(\tB\x03\xc0>\x01R\btrace_id\"\x90\x04\n" + + "\x12ProtoActualLRPInfo\x12W\n" + + "\x13actual_lrp_net_info\x18\x03 \x01(\v2\x1d.models.ProtoActualLRPNetInfoB\x06\xc0>\x01\x90?\x01R\x13actual_lrp_net_info\x12%\n" + + "\vcrash_count\x18\x04 \x01(\x05B\x03\xc0>\x01R\vcrash_count\x12\"\n" + + "\fcrash_reason\x18\x05 \x01(\tR\fcrash_reason\x12\x19\n" + + "\x05state\x18\x06 \x01(\tB\x03\xc0>\x01R\x05state\x12(\n" + + "\x0fplacement_error\x18\a \x01(\tR\x0fplacement_error\x12\x19\n" + + "\x05since\x18\b \x01(\x03B\x03\xc0>\x01R\x05since\x12P\n" + + "\x10modification_tag\x18\t \x01(\v2\x1c.models.ProtoModificationTagB\x06\xc0>\x01\x90?\x01R\x10modification_tag\x12C\n" + + "\bpresence\x18\n" + + " \x01(\x0e2\x1f.models.ProtoActualLRP.PresenceB\x06\xc0>\x01\x90?\x01R\bpresence\x12\x1f\n" + + "\bRoutable\x18\v \x01(\bH\x00R\bRoutable\x88\x01\x01\x121\n" + + "\x11availability_zone\x18\f \x01(\tB\x03\xc0>\x01R\x11availability_zoneB\v\n" + + "\t_Routable\"\xdb\x02\n" + + "\"ProtoActualLRPInstanceChangedEvent\x12I\n" + + "\x0eactual_lrp_key\x18\x01 \x01(\v2\x19.models.ProtoActualLRPKeyB\x06\xc0>\x01\x90?\x01R\x0eactual_lrp_key\x12c\n" + + "\x17actual_lrp_instance_key\x18\x02 \x01(\v2!.models.ProtoActualLRPInstanceKeyB\x06\xc0>\x01\x90?\x01R\x17actual_lrp_instance_key\x122\n" + + "\x06before\x18\x03 \x01(\v2\x1a.models.ProtoActualLRPInfoR\x06before\x120\n" + + "\x05after\x18\x04 \x01(\v2\x1a.models.ProtoActualLRPInfoR\x05after\x12\x1f\n" + + "\btrace_id\x18\x05 \x01(\tB\x03\xc0>\x01R\btrace_id\"}\n" + + "\"ProtoActualLRPInstanceRemovedEvent\x126\n" + + "\n" + + "actual_lrp\x18\x01 \x01(\v2\x16.models.ProtoActualLRPR\n" + + "actual_lrp\x12\x1f\n" + + "\btrace_id\x18\x02 \x01(\tB\x03\xc0>\x01R\btrace_id\"y\n" + + "\x1bProtoDesiredLRPCreatedEvent\x129\n" + + "\vdesired_lrp\x18\x01 \x01(\v2\x17.models.ProtoDesiredLRPR\vdesired_lrp\x12\x1f\n" + + "\btrace_id\x18\x02 \x01(\tB\x03\xc0>\x01R\btrace_id\"\x9e\x01\n" + + "\x1bProtoDesiredLRPChangedEvent\x12/\n" + + "\x06before\x18\x01 \x01(\v2\x17.models.ProtoDesiredLRPR\x06before\x12-\n" + + "\x05after\x18\x02 \x01(\v2\x17.models.ProtoDesiredLRPR\x05after\x12\x1f\n" + + "\btrace_id\x18\x03 \x01(\tB\x03\xc0>\x01R\btrace_id\"y\n" + + "\x1bProtoDesiredLRPRemovedEvent\x129\n" + + "\vdesired_lrp\x18\x01 \x01(\v2\x17.models.ProtoDesiredLRPR\vdesired_lrp\x12\x1f\n" + + "\btrace_id\x18\x02 \x01(\tB\x03\xc0>\x01R\btrace_id\"\xb2\x02\n" + + "\x1aProtoActualLRPCrashedEvent\x12I\n" + + "\x0eactual_lrp_key\x18\x01 \x01(\v2\x19.models.ProtoActualLRPKeyB\x06\xc0>\x01\x90?\x01R\x0eactual_lrp_key\x12c\n" + + "\x17actual_lrp_instance_key\x18\x02 \x01(\v2!.models.ProtoActualLRPInstanceKeyB\x06\xc0>\x01\x90?\x01R\x17actual_lrp_instance_key\x12%\n" + + "\vcrash_count\x18\x03 \x01(\x05B\x03\xc0>\x01R\vcrash_count\x12\"\n" + + "\fcrash_reason\x18\x04 \x01(\tR\fcrash_reason\x12\x19\n" + + "\x05since\x18\x05 \x01(\x03B\x03\xc0>\x01R\x05since\"4\n" + + "\x13ProtoEventsByCellId\x12\x1d\n" + + "\acell_id\x18\x01 \x01(\tB\x03\xc0>\x01R\acell_id\">\n" + + "\x15ProtoTaskCreatedEvent\x12%\n" + + "\x04task\x18\x01 \x01(\v2\x11.models.ProtoTaskR\x04task\"k\n" + + "\x15ProtoTaskChangedEvent\x12)\n" + + "\x06before\x18\x01 \x01(\v2\x11.models.ProtoTaskR\x06before\x12'\n" + + "\x05after\x18\x02 \x01(\v2\x11.models.ProtoTaskR\x05after\">\n" + + "\x15ProtoTaskRemovedEvent\x12%\n" + + "\x04task\x18\x01 \x01(\v2\x11.models.ProtoTaskR\x04task\"&\n" + + "\x0eProtoFakeEvent\x12\x14\n" + + "\x05token\x18\x01 \x01(\tR\x05tokenB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" - that1, ok := that.(*TaskChangedEvent) - if !ok { - that2, ok := that.(TaskChangedEvent) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Before.Equal(that1.Before) { - return false - } - if !this.After.Equal(that1.After) { - return false - } - return true -} -func (this *TaskRemovedEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +var ( + file_events_proto_rawDescOnce sync.Once + file_events_proto_rawDescData []byte +) - that1, ok := that.(*TaskRemovedEvent) - if !ok { - that2, ok := that.(TaskRemovedEvent) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Task.Equal(that1.Task) { - return false - } - return true -} -func (this *ActualLRPCreatedEvent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.ActualLRPCreatedEvent{") - if this.ActualLrpGroup != nil { - s = append(s, "ActualLrpGroup: "+fmt.Sprintf("%#v", this.ActualLrpGroup)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPChangedEvent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ActualLRPChangedEvent{") - if this.Before != nil { - s = append(s, "Before: "+fmt.Sprintf("%#v", this.Before)+",\n") - } - if this.After != nil { - s = append(s, "After: "+fmt.Sprintf("%#v", this.After)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPRemovedEvent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.ActualLRPRemovedEvent{") - if this.ActualLrpGroup != nil { - s = append(s, "ActualLrpGroup: "+fmt.Sprintf("%#v", this.ActualLrpGroup)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPInstanceCreatedEvent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ActualLRPInstanceCreatedEvent{") - if this.ActualLrp != nil { - s = append(s, "ActualLrp: "+fmt.Sprintf("%#v", this.ActualLrp)+",\n") - } - s = append(s, "TraceId: "+fmt.Sprintf("%#v", this.TraceId)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 14) - s = append(s, "&models.ActualLRPInfo{") - s = append(s, "ActualLRPNetInfo: "+strings.Replace(this.ActualLRPNetInfo.GoString(), `&`, ``, 1)+",\n") - s = append(s, "CrashCount: "+fmt.Sprintf("%#v", this.CrashCount)+",\n") - s = append(s, "CrashReason: "+fmt.Sprintf("%#v", this.CrashReason)+",\n") - s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") - s = append(s, "PlacementError: "+fmt.Sprintf("%#v", this.PlacementError)+",\n") - s = append(s, "Since: "+fmt.Sprintf("%#v", this.Since)+",\n") - s = append(s, "ModificationTag: "+strings.Replace(this.ModificationTag.GoString(), `&`, ``, 1)+",\n") - s = append(s, "Presence: "+fmt.Sprintf("%#v", this.Presence)+",\n") - if this.OptionalRoutable != nil { - s = append(s, "OptionalRoutable: "+fmt.Sprintf("%#v", this.OptionalRoutable)+",\n") - } - s = append(s, "AvailabilityZone: "+fmt.Sprintf("%#v", this.AvailabilityZone)+",\n") - s = append(s, "}") - return strings.Join(s, "") +func file_events_proto_rawDescGZIP() []byte { + file_events_proto_rawDescOnce.Do(func() { + file_events_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_events_proto_rawDesc), len(file_events_proto_rawDesc))) + }) + return file_events_proto_rawDescData +} + +var file_events_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_events_proto_goTypes = []any{ + (*ProtoActualLRPCreatedEvent)(nil), // 0: models.ProtoActualLRPCreatedEvent + (*ProtoActualLRPChangedEvent)(nil), // 1: models.ProtoActualLRPChangedEvent + (*ProtoActualLRPRemovedEvent)(nil), // 2: models.ProtoActualLRPRemovedEvent + (*ProtoActualLRPInstanceCreatedEvent)(nil), // 3: models.ProtoActualLRPInstanceCreatedEvent + (*ProtoActualLRPInfo)(nil), // 4: models.ProtoActualLRPInfo + (*ProtoActualLRPInstanceChangedEvent)(nil), // 5: models.ProtoActualLRPInstanceChangedEvent + (*ProtoActualLRPInstanceRemovedEvent)(nil), // 6: models.ProtoActualLRPInstanceRemovedEvent + (*ProtoDesiredLRPCreatedEvent)(nil), // 7: models.ProtoDesiredLRPCreatedEvent + (*ProtoDesiredLRPChangedEvent)(nil), // 8: models.ProtoDesiredLRPChangedEvent + (*ProtoDesiredLRPRemovedEvent)(nil), // 9: models.ProtoDesiredLRPRemovedEvent + (*ProtoActualLRPCrashedEvent)(nil), // 10: models.ProtoActualLRPCrashedEvent + (*ProtoEventsByCellId)(nil), // 11: models.ProtoEventsByCellId + (*ProtoTaskCreatedEvent)(nil), // 12: models.ProtoTaskCreatedEvent + (*ProtoTaskChangedEvent)(nil), // 13: models.ProtoTaskChangedEvent + (*ProtoTaskRemovedEvent)(nil), // 14: models.ProtoTaskRemovedEvent + (*ProtoFakeEvent)(nil), // 15: models.ProtoFakeEvent + (*ProtoActualLRPGroup)(nil), // 16: models.ProtoActualLRPGroup + (*ProtoActualLRP)(nil), // 17: models.ProtoActualLRP + (*ProtoActualLRPNetInfo)(nil), // 18: models.ProtoActualLRPNetInfo + (*ProtoModificationTag)(nil), // 19: models.ProtoModificationTag + (ProtoActualLRP_Presence)(0), // 20: models.ProtoActualLRP.Presence + (*ProtoActualLRPKey)(nil), // 21: models.ProtoActualLRPKey + (*ProtoActualLRPInstanceKey)(nil), // 22: models.ProtoActualLRPInstanceKey + (*ProtoDesiredLRP)(nil), // 23: models.ProtoDesiredLRP + (*ProtoTask)(nil), // 24: models.ProtoTask +} +var file_events_proto_depIdxs = []int32{ + 16, // 0: models.ProtoActualLRPCreatedEvent.actual_lrp_group:type_name -> models.ProtoActualLRPGroup + 16, // 1: models.ProtoActualLRPChangedEvent.before:type_name -> models.ProtoActualLRPGroup + 16, // 2: models.ProtoActualLRPChangedEvent.after:type_name -> models.ProtoActualLRPGroup + 16, // 3: models.ProtoActualLRPRemovedEvent.actual_lrp_group:type_name -> models.ProtoActualLRPGroup + 17, // 4: models.ProtoActualLRPInstanceCreatedEvent.actual_lrp:type_name -> models.ProtoActualLRP + 18, // 5: models.ProtoActualLRPInfo.actual_lrp_net_info:type_name -> models.ProtoActualLRPNetInfo + 19, // 6: models.ProtoActualLRPInfo.modification_tag:type_name -> models.ProtoModificationTag + 20, // 7: models.ProtoActualLRPInfo.presence:type_name -> models.ProtoActualLRP.Presence + 21, // 8: models.ProtoActualLRPInstanceChangedEvent.actual_lrp_key:type_name -> models.ProtoActualLRPKey + 22, // 9: models.ProtoActualLRPInstanceChangedEvent.actual_lrp_instance_key:type_name -> models.ProtoActualLRPInstanceKey + 4, // 10: models.ProtoActualLRPInstanceChangedEvent.before:type_name -> models.ProtoActualLRPInfo + 4, // 11: models.ProtoActualLRPInstanceChangedEvent.after:type_name -> models.ProtoActualLRPInfo + 17, // 12: models.ProtoActualLRPInstanceRemovedEvent.actual_lrp:type_name -> models.ProtoActualLRP + 23, // 13: models.ProtoDesiredLRPCreatedEvent.desired_lrp:type_name -> models.ProtoDesiredLRP + 23, // 14: models.ProtoDesiredLRPChangedEvent.before:type_name -> models.ProtoDesiredLRP + 23, // 15: models.ProtoDesiredLRPChangedEvent.after:type_name -> models.ProtoDesiredLRP + 23, // 16: models.ProtoDesiredLRPRemovedEvent.desired_lrp:type_name -> models.ProtoDesiredLRP + 21, // 17: models.ProtoActualLRPCrashedEvent.actual_lrp_key:type_name -> models.ProtoActualLRPKey + 22, // 18: models.ProtoActualLRPCrashedEvent.actual_lrp_instance_key:type_name -> models.ProtoActualLRPInstanceKey + 24, // 19: models.ProtoTaskCreatedEvent.task:type_name -> models.ProtoTask + 24, // 20: models.ProtoTaskChangedEvent.before:type_name -> models.ProtoTask + 24, // 21: models.ProtoTaskChangedEvent.after:type_name -> models.ProtoTask + 24, // 22: models.ProtoTaskRemovedEvent.task:type_name -> models.ProtoTask + 23, // [23:23] is the sub-list for method output_type + 23, // [23:23] is the sub-list for method input_type + 23, // [23:23] is the sub-list for extension type_name + 23, // [23:23] is the sub-list for extension extendee + 0, // [0:23] is the sub-list for field type_name +} + +func init() { file_events_proto_init() } +func file_events_proto_init() { + if File_events_proto != nil { + return + } + file_actual_lrp_proto_init() + file_bbs_proto_init() + file_desired_lrp_proto_init() + file_task_proto_init() + file_modification_tag_proto_init() + file_events_proto_msgTypes[4].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_events_proto_rawDesc), len(file_events_proto_rawDesc)), + NumEnums: 0, + NumMessages: 16, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_events_proto_goTypes, + DependencyIndexes: file_events_proto_depIdxs, + MessageInfos: file_events_proto_msgTypes, + }.Build() + File_events_proto = out.File + file_events_proto_goTypes = nil + file_events_proto_depIdxs = nil } -func (this *ActualLRPInfo_Routable) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&models.ActualLRPInfo_Routable{` + - `Routable:` + fmt.Sprintf("%#v", this.Routable) + `}`}, ", ") - return s -} -func (this *ActualLRPInstanceChangedEvent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&models.ActualLRPInstanceChangedEvent{") - s = append(s, "ActualLRPKey: "+strings.Replace(this.ActualLRPKey.GoString(), `&`, ``, 1)+",\n") - s = append(s, "ActualLRPInstanceKey: "+strings.Replace(this.ActualLRPInstanceKey.GoString(), `&`, ``, 1)+",\n") - if this.Before != nil { - s = append(s, "Before: "+fmt.Sprintf("%#v", this.Before)+",\n") - } - if this.After != nil { - s = append(s, "After: "+fmt.Sprintf("%#v", this.After)+",\n") - } - s = append(s, "TraceId: "+fmt.Sprintf("%#v", this.TraceId)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPInstanceRemovedEvent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ActualLRPInstanceRemovedEvent{") - if this.ActualLrp != nil { - s = append(s, "ActualLrp: "+fmt.Sprintf("%#v", this.ActualLrp)+",\n") - } - s = append(s, "TraceId: "+fmt.Sprintf("%#v", this.TraceId)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRPCreatedEvent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.DesiredLRPCreatedEvent{") - if this.DesiredLrp != nil { - s = append(s, "DesiredLrp: "+fmt.Sprintf("%#v", this.DesiredLrp)+",\n") - } - s = append(s, "TraceId: "+fmt.Sprintf("%#v", this.TraceId)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRPChangedEvent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&models.DesiredLRPChangedEvent{") - if this.Before != nil { - s = append(s, "Before: "+fmt.Sprintf("%#v", this.Before)+",\n") - } - if this.After != nil { - s = append(s, "After: "+fmt.Sprintf("%#v", this.After)+",\n") - } - s = append(s, "TraceId: "+fmt.Sprintf("%#v", this.TraceId)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesiredLRPRemovedEvent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.DesiredLRPRemovedEvent{") - if this.DesiredLrp != nil { - s = append(s, "DesiredLrp: "+fmt.Sprintf("%#v", this.DesiredLrp)+",\n") - } - s = append(s, "TraceId: "+fmt.Sprintf("%#v", this.TraceId)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ActualLRPCrashedEvent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&models.ActualLRPCrashedEvent{") - s = append(s, "ActualLRPKey: "+strings.Replace(this.ActualLRPKey.GoString(), `&`, ``, 1)+",\n") - s = append(s, "ActualLRPInstanceKey: "+strings.Replace(this.ActualLRPInstanceKey.GoString(), `&`, ``, 1)+",\n") - s = append(s, "CrashCount: "+fmt.Sprintf("%#v", this.CrashCount)+",\n") - s = append(s, "CrashReason: "+fmt.Sprintf("%#v", this.CrashReason)+",\n") - s = append(s, "Since: "+fmt.Sprintf("%#v", this.Since)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EventsByCellId) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.EventsByCellId{") - s = append(s, "CellId: "+fmt.Sprintf("%#v", this.CellId)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TaskCreatedEvent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.TaskCreatedEvent{") - if this.Task != nil { - s = append(s, "Task: "+fmt.Sprintf("%#v", this.Task)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TaskChangedEvent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.TaskChangedEvent{") - if this.Before != nil { - s = append(s, "Before: "+fmt.Sprintf("%#v", this.Before)+",\n") - } - if this.After != nil { - s = append(s, "After: "+fmt.Sprintf("%#v", this.After)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TaskRemovedEvent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.TaskRemovedEvent{") - if this.Task != nil { - s = append(s, "Task: "+fmt.Sprintf("%#v", this.Task)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringEvents(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *ActualLRPCreatedEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPCreatedEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPCreatedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ActualLrpGroup != nil { - { - size, err := m.ActualLrpGroup.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActualLRPChangedEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPChangedEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPChangedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.After != nil { - { - size, err := m.After.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Before != nil { - { - size, err := m.Before.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActualLRPRemovedEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPRemovedEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPRemovedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ActualLrpGroup != nil { - { - size, err := m.ActualLrpGroup.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActualLRPInstanceCreatedEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPInstanceCreatedEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPInstanceCreatedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TraceId) > 0 { - i -= len(m.TraceId) - copy(dAtA[i:], m.TraceId) - i = encodeVarintEvents(dAtA, i, uint64(len(m.TraceId))) - i-- - dAtA[i] = 0x12 - } - if m.ActualLrp != nil { - { - size, err := m.ActualLrp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActualLRPInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AvailabilityZone) > 0 { - i -= len(m.AvailabilityZone) - copy(dAtA[i:], m.AvailabilityZone) - i = encodeVarintEvents(dAtA, i, uint64(len(m.AvailabilityZone))) - i-- - dAtA[i] = 0x62 - } - if m.OptionalRoutable != nil { - { - size := m.OptionalRoutable.Size() - i -= size - if _, err := m.OptionalRoutable.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.Presence != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.Presence)) - i-- - dAtA[i] = 0x50 - } - { - size, err := m.ModificationTag.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - if m.Since != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.Since)) - i-- - dAtA[i] = 0x40 - } - if len(m.PlacementError) > 0 { - i -= len(m.PlacementError) - copy(dAtA[i:], m.PlacementError) - i = encodeVarintEvents(dAtA, i, uint64(len(m.PlacementError))) - i-- - dAtA[i] = 0x3a - } - if len(m.State) > 0 { - i -= len(m.State) - copy(dAtA[i:], m.State) - i = encodeVarintEvents(dAtA, i, uint64(len(m.State))) - i-- - dAtA[i] = 0x32 - } - if len(m.CrashReason) > 0 { - i -= len(m.CrashReason) - copy(dAtA[i:], m.CrashReason) - i = encodeVarintEvents(dAtA, i, uint64(len(m.CrashReason))) - i-- - dAtA[i] = 0x2a - } - if m.CrashCount != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.CrashCount)) - i-- - dAtA[i] = 0x20 - } - { - size, err := m.ActualLRPNetInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - return len(dAtA) - i, nil -} - -func (m *ActualLRPInfo_Routable) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPInfo_Routable) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i-- - if m.Routable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x58 - return len(dAtA) - i, nil -} -func (m *ActualLRPInstanceChangedEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPInstanceChangedEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPInstanceChangedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TraceId) > 0 { - i -= len(m.TraceId) - copy(dAtA[i:], m.TraceId) - i = encodeVarintEvents(dAtA, i, uint64(len(m.TraceId))) - i-- - dAtA[i] = 0x2a - } - if m.After != nil { - { - size, err := m.After.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Before != nil { - { - size, err := m.Before.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - { - size, err := m.ActualLRPInstanceKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.ActualLRPKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ActualLRPInstanceRemovedEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPInstanceRemovedEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPInstanceRemovedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TraceId) > 0 { - i -= len(m.TraceId) - copy(dAtA[i:], m.TraceId) - i = encodeVarintEvents(dAtA, i, uint64(len(m.TraceId))) - i-- - dAtA[i] = 0x12 - } - if m.ActualLrp != nil { - { - size, err := m.ActualLrp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DesiredLRPCreatedEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRPCreatedEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPCreatedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TraceId) > 0 { - i -= len(m.TraceId) - copy(dAtA[i:], m.TraceId) - i = encodeVarintEvents(dAtA, i, uint64(len(m.TraceId))) - i-- - dAtA[i] = 0x12 - } - if m.DesiredLrp != nil { - { - size, err := m.DesiredLrp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DesiredLRPChangedEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRPChangedEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPChangedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TraceId) > 0 { - i -= len(m.TraceId) - copy(dAtA[i:], m.TraceId) - i = encodeVarintEvents(dAtA, i, uint64(len(m.TraceId))) - i-- - dAtA[i] = 0x1a - } - if m.After != nil { - { - size, err := m.After.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Before != nil { - { - size, err := m.Before.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DesiredLRPRemovedEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DesiredLRPRemovedEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DesiredLRPRemovedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TraceId) > 0 { - i -= len(m.TraceId) - copy(dAtA[i:], m.TraceId) - i = encodeVarintEvents(dAtA, i, uint64(len(m.TraceId))) - i-- - dAtA[i] = 0x12 - } - if m.DesiredLrp != nil { - { - size, err := m.DesiredLrp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActualLRPCrashedEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActualLRPCrashedEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActualLRPCrashedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Since != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.Since)) - i-- - dAtA[i] = 0x28 - } - if len(m.CrashReason) > 0 { - i -= len(m.CrashReason) - copy(dAtA[i:], m.CrashReason) - i = encodeVarintEvents(dAtA, i, uint64(len(m.CrashReason))) - i-- - dAtA[i] = 0x22 - } - if m.CrashCount != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.CrashCount)) - i-- - dAtA[i] = 0x18 - } - { - size, err := m.ActualLRPInstanceKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.ActualLRPKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *EventsByCellId) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EventsByCellId) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventsByCellId) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CellId) > 0 { - i -= len(m.CellId) - copy(dAtA[i:], m.CellId) - i = encodeVarintEvents(dAtA, i, uint64(len(m.CellId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TaskCreatedEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TaskCreatedEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskCreatedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Task != nil { - { - size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TaskChangedEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TaskChangedEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskChangedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.After != nil { - { - size, err := m.After.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Before != nil { - { - size, err := m.Before.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TaskRemovedEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TaskRemovedEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskRemovedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Task != nil { - { - size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { - offset -= sovEvents(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ActualLRPCreatedEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActualLrpGroup != nil { - l = m.ActualLrpGroup.Size() - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *ActualLRPChangedEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Before != nil { - l = m.Before.Size() - n += 1 + l + sovEvents(uint64(l)) - } - if m.After != nil { - l = m.After.Size() - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *ActualLRPRemovedEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActualLrpGroup != nil { - l = m.ActualLrpGroup.Size() - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *ActualLRPInstanceCreatedEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActualLrp != nil { - l = m.ActualLrp.Size() - n += 1 + l + sovEvents(uint64(l)) - } - l = len(m.TraceId) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *ActualLRPInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ActualLRPNetInfo.Size() - n += 1 + l + sovEvents(uint64(l)) - if m.CrashCount != 0 { - n += 1 + sovEvents(uint64(m.CrashCount)) - } - l = len(m.CrashReason) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - l = len(m.State) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - l = len(m.PlacementError) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - if m.Since != 0 { - n += 1 + sovEvents(uint64(m.Since)) - } - l = m.ModificationTag.Size() - n += 1 + l + sovEvents(uint64(l)) - if m.Presence != 0 { - n += 1 + sovEvents(uint64(m.Presence)) - } - if m.OptionalRoutable != nil { - n += m.OptionalRoutable.Size() - } - l = len(m.AvailabilityZone) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *ActualLRPInfo_Routable) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 2 - return n -} -func (m *ActualLRPInstanceChangedEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ActualLRPKey.Size() - n += 1 + l + sovEvents(uint64(l)) - l = m.ActualLRPInstanceKey.Size() - n += 1 + l + sovEvents(uint64(l)) - if m.Before != nil { - l = m.Before.Size() - n += 1 + l + sovEvents(uint64(l)) - } - if m.After != nil { - l = m.After.Size() - n += 1 + l + sovEvents(uint64(l)) - } - l = len(m.TraceId) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *ActualLRPInstanceRemovedEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActualLrp != nil { - l = m.ActualLrp.Size() - n += 1 + l + sovEvents(uint64(l)) - } - l = len(m.TraceId) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *DesiredLRPCreatedEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DesiredLrp != nil { - l = m.DesiredLrp.Size() - n += 1 + l + sovEvents(uint64(l)) - } - l = len(m.TraceId) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *DesiredLRPChangedEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Before != nil { - l = m.Before.Size() - n += 1 + l + sovEvents(uint64(l)) - } - if m.After != nil { - l = m.After.Size() - n += 1 + l + sovEvents(uint64(l)) - } - l = len(m.TraceId) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *DesiredLRPRemovedEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DesiredLrp != nil { - l = m.DesiredLrp.Size() - n += 1 + l + sovEvents(uint64(l)) - } - l = len(m.TraceId) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *ActualLRPCrashedEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ActualLRPKey.Size() - n += 1 + l + sovEvents(uint64(l)) - l = m.ActualLRPInstanceKey.Size() - n += 1 + l + sovEvents(uint64(l)) - if m.CrashCount != 0 { - n += 1 + sovEvents(uint64(m.CrashCount)) - } - l = len(m.CrashReason) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - if m.Since != 0 { - n += 1 + sovEvents(uint64(m.Since)) - } - return n -} - -func (m *EventsByCellId) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.CellId) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *TaskCreatedEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Task != nil { - l = m.Task.Size() - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *TaskChangedEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Before != nil { - l = m.Before.Size() - n += 1 + l + sovEvents(uint64(l)) - } - if m.After != nil { - l = m.After.Size() - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *TaskRemovedEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Task != nil { - l = m.Task.Size() - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func sovEvents(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvents(x uint64) (n int) { - return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *ActualLRPCreatedEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPCreatedEvent{`, - `ActualLrpGroup:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpGroup), "ActualLRPGroup", "ActualLRPGroup", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPChangedEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPChangedEvent{`, - `Before:` + strings.Replace(fmt.Sprintf("%v", this.Before), "ActualLRPGroup", "ActualLRPGroup", 1) + `,`, - `After:` + strings.Replace(fmt.Sprintf("%v", this.After), "ActualLRPGroup", "ActualLRPGroup", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPRemovedEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPRemovedEvent{`, - `ActualLrpGroup:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrpGroup), "ActualLRPGroup", "ActualLRPGroup", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPInstanceCreatedEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPInstanceCreatedEvent{`, - `ActualLrp:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrp), "ActualLRP", "ActualLRP", 1) + `,`, - `TraceId:` + fmt.Sprintf("%v", this.TraceId) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPInfo{`, - `ActualLRPNetInfo:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ActualLRPNetInfo), "ActualLRPNetInfo", "ActualLRPNetInfo", 1), `&`, ``, 1) + `,`, - `CrashCount:` + fmt.Sprintf("%v", this.CrashCount) + `,`, - `CrashReason:` + fmt.Sprintf("%v", this.CrashReason) + `,`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `PlacementError:` + fmt.Sprintf("%v", this.PlacementError) + `,`, - `Since:` + fmt.Sprintf("%v", this.Since) + `,`, - `ModificationTag:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ModificationTag), "ModificationTag", "ModificationTag", 1), `&`, ``, 1) + `,`, - `Presence:` + fmt.Sprintf("%v", this.Presence) + `,`, - `OptionalRoutable:` + fmt.Sprintf("%v", this.OptionalRoutable) + `,`, - `AvailabilityZone:` + fmt.Sprintf("%v", this.AvailabilityZone) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPInfo_Routable) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPInfo_Routable{`, - `Routable:` + fmt.Sprintf("%v", this.Routable) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPInstanceChangedEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPInstanceChangedEvent{`, - `ActualLRPKey:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ActualLRPKey), "ActualLRPKey", "ActualLRPKey", 1), `&`, ``, 1) + `,`, - `ActualLRPInstanceKey:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ActualLRPInstanceKey), "ActualLRPInstanceKey", "ActualLRPInstanceKey", 1), `&`, ``, 1) + `,`, - `Before:` + strings.Replace(this.Before.String(), "ActualLRPInfo", "ActualLRPInfo", 1) + `,`, - `After:` + strings.Replace(this.After.String(), "ActualLRPInfo", "ActualLRPInfo", 1) + `,`, - `TraceId:` + fmt.Sprintf("%v", this.TraceId) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPInstanceRemovedEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPInstanceRemovedEvent{`, - `ActualLrp:` + strings.Replace(fmt.Sprintf("%v", this.ActualLrp), "ActualLRP", "ActualLRP", 1) + `,`, - `TraceId:` + fmt.Sprintf("%v", this.TraceId) + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPCreatedEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesiredLRPCreatedEvent{`, - `DesiredLrp:` + strings.Replace(fmt.Sprintf("%v", this.DesiredLrp), "DesiredLRP", "DesiredLRP", 1) + `,`, - `TraceId:` + fmt.Sprintf("%v", this.TraceId) + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPChangedEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesiredLRPChangedEvent{`, - `Before:` + strings.Replace(fmt.Sprintf("%v", this.Before), "DesiredLRP", "DesiredLRP", 1) + `,`, - `After:` + strings.Replace(fmt.Sprintf("%v", this.After), "DesiredLRP", "DesiredLRP", 1) + `,`, - `TraceId:` + fmt.Sprintf("%v", this.TraceId) + `,`, - `}`, - }, "") - return s -} -func (this *DesiredLRPRemovedEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesiredLRPRemovedEvent{`, - `DesiredLrp:` + strings.Replace(fmt.Sprintf("%v", this.DesiredLrp), "DesiredLRP", "DesiredLRP", 1) + `,`, - `TraceId:` + fmt.Sprintf("%v", this.TraceId) + `,`, - `}`, - }, "") - return s -} -func (this *ActualLRPCrashedEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActualLRPCrashedEvent{`, - `ActualLRPKey:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ActualLRPKey), "ActualLRPKey", "ActualLRPKey", 1), `&`, ``, 1) + `,`, - `ActualLRPInstanceKey:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ActualLRPInstanceKey), "ActualLRPInstanceKey", "ActualLRPInstanceKey", 1), `&`, ``, 1) + `,`, - `CrashCount:` + fmt.Sprintf("%v", this.CrashCount) + `,`, - `CrashReason:` + fmt.Sprintf("%v", this.CrashReason) + `,`, - `Since:` + fmt.Sprintf("%v", this.Since) + `,`, - `}`, - }, "") - return s -} -func (this *EventsByCellId) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&EventsByCellId{`, - `CellId:` + fmt.Sprintf("%v", this.CellId) + `,`, - `}`, - }, "") - return s -} -func (this *TaskCreatedEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskCreatedEvent{`, - `Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "Task", 1) + `,`, - `}`, - }, "") - return s -} -func (this *TaskChangedEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskChangedEvent{`, - `Before:` + strings.Replace(fmt.Sprintf("%v", this.Before), "Task", "Task", 1) + `,`, - `After:` + strings.Replace(fmt.Sprintf("%v", this.After), "Task", "Task", 1) + `,`, - `}`, - }, "") - return s -} -func (this *TaskRemovedEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskRemovedEvent{`, - `Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "Task", 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringEvents(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *ActualLRPCreatedEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPCreatedEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPCreatedEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpGroup", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpGroup == nil { - m.ActualLrpGroup = &ActualLRPGroup{} - } - if err := m.ActualLrpGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPChangedEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPChangedEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPChangedEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Before", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Before == nil { - m.Before = &ActualLRPGroup{} - } - if err := m.Before.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field After", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.After == nil { - m.After = &ActualLRPGroup{} - } - if err := m.After.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPRemovedEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPRemovedEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPRemovedEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrpGroup", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrpGroup == nil { - m.ActualLrpGroup = &ActualLRPGroup{} - } - if err := m.ActualLrpGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPInstanceCreatedEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPInstanceCreatedEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPInstanceCreatedEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrp == nil { - m.ActualLrp = &ActualLRP{} - } - if err := m.ActualLrp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TraceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLRPNetInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ActualLRPNetInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CrashCount", wireType) - } - m.CrashCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CrashCount |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CrashReason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CrashReason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.State = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlacementError", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PlacementError = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Since", wireType) - } - m.Since = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Since |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ModificationTag", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ModificationTag.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Presence", wireType) - } - m.Presence = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Presence |= ActualLRP_Presence(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Routable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.OptionalRoutable = &ActualLRPInfo_Routable{b} - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AvailabilityZone", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AvailabilityZone = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPInstanceChangedEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPInstanceChangedEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPInstanceChangedEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLRPKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ActualLRPKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLRPInstanceKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ActualLRPInstanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Before", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Before == nil { - m.Before = &ActualLRPInfo{} - } - if err := m.Before.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field After", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.After == nil { - m.After = &ActualLRPInfo{} - } - if err := m.After.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TraceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPInstanceRemovedEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPInstanceRemovedEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPInstanceRemovedEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLrp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActualLrp == nil { - m.ActualLrp = &ActualLRP{} - } - if err := m.ActualLrp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TraceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DesiredLRPCreatedEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPCreatedEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPCreatedEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredLrp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DesiredLrp == nil { - m.DesiredLrp = &DesiredLRP{} - } - if err := m.DesiredLrp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TraceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DesiredLRPChangedEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPChangedEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPChangedEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Before", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Before == nil { - m.Before = &DesiredLRP{} - } - if err := m.Before.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field After", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.After == nil { - m.After = &DesiredLRP{} - } - if err := m.After.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TraceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DesiredLRPRemovedEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesiredLRPRemovedEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesiredLRPRemovedEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredLrp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DesiredLrp == nil { - m.DesiredLrp = &DesiredLRP{} - } - if err := m.DesiredLrp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TraceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActualLRPCrashedEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActualLRPCrashedEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActualLRPCrashedEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLRPKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ActualLRPKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualLRPInstanceKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ActualLRPInstanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CrashCount", wireType) - } - m.CrashCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CrashCount |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CrashReason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CrashReason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Since", wireType) - } - m.Since = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Since |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventsByCellId) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EventsByCellId: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventsByCellId: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CellId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CellId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TaskCreatedEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TaskCreatedEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskCreatedEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Task == nil { - m.Task = &Task{} - } - if err := m.Task.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TaskChangedEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TaskChangedEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskChangedEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Before", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Before == nil { - m.Before = &Task{} - } - if err := m.Before.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field After", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.After == nil { - m.After = &Task{} - } - if err := m.After.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TaskRemovedEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TaskRemovedEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskRemovedEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Task == nil { - m.Task = &Task{} - } - if err := m.Task.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvents(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthEvents - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvents - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvents - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") -) diff --git a/models/events.proto b/models/events.proto index c6bf8ecc..60982f25 100644 --- a/models/events.proto +++ b/models/events.proto @@ -1,99 +1,102 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "actual_lrp.proto"; +import "bbs.proto"; import "desired_lrp.proto"; import "task.proto"; import "modification_tag.proto"; -message ActualLRPCreatedEvent { +message ProtoActualLRPCreatedEvent { option deprecated = true; - ActualLRPGroup actual_lrp_group = 1; + ProtoActualLRPGroup actual_lrp_group = 1 [json_name = "actual_lrp_group"]; } -message ActualLRPChangedEvent { +message ProtoActualLRPChangedEvent { option deprecated = true; - ActualLRPGroup before = 1; - ActualLRPGroup after = 2; + ProtoActualLRPGroup before = 1; + ProtoActualLRPGroup after = 2; } -message ActualLRPRemovedEvent { +message ProtoActualLRPRemovedEvent { option deprecated = true; - ActualLRPGroup actual_lrp_group = 1; + ProtoActualLRPGroup actual_lrp_group = 1 [json_name = "actual_lrp_group"]; } -message ActualLRPInstanceCreatedEvent { - ActualLRP actual_lrp = 1; - string trace_id = 2 [(gogoproto.jsontag) = "trace_id"]; +message ProtoActualLRPInstanceCreatedEvent { + ProtoActualLRP actual_lrp = 1 [json_name = "actual_lrp"]; + string trace_id = 2 [json_name = "trace_id", (bbs.bbs_json_always_emit) = true]; } -message ActualLRPInfo { - ActualLRPNetInfo actual_lrp_net_info = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; - int32 crash_count = 4 [(gogoproto.jsontag) = "crash_count"]; - string crash_reason = 5; - string state = 6 [(gogoproto.jsontag) = "state"]; - string placement_error = 7; - int64 since = 8 [(gogoproto.jsontag) = "since"]; - ModificationTag modification_tag = 9 [(gogoproto.nullable) = false,(gogoproto.jsontag) = "modification_tag"]; - ActualLRP.Presence presence = 10 [(gogoproto.jsontag) = "presence"]; - oneof optional_routable { - bool Routable = 11; - } - string availability_zone = 12 [(gogoproto.jsontag) = "availability_zone"]; +message ProtoActualLRPInfo { + ProtoActualLRPNetInfo actual_lrp_net_info = 3 [(bbs.bbs_by_value) = true, json_name = "actual_lrp_net_info", (bbs.bbs_json_always_emit) = true]; + int32 crash_count = 4 [json_name = "crash_count", (bbs.bbs_json_always_emit) = true]; + string crash_reason = 5 [json_name = "crash_reason"]; + string state = 6 [json_name = "state", (bbs.bbs_json_always_emit) = true]; + string placement_error = 7 [json_name = "placement_error"]; + int64 since = 8 [json_name = "since", (bbs.bbs_json_always_emit) = true]; + ProtoModificationTag modification_tag = 9 [json_name = "modification_tag", (bbs.bbs_by_value) = true, (bbs.bbs_json_always_emit) = true]; + ProtoActualLRP.Presence presence = 10 [json_name = "presence", (bbs.bbs_by_value) = true, (bbs.bbs_json_always_emit) = true]; + optional bool Routable = 11; + string availability_zone = 12 [json_name = "availability_zone", (bbs.bbs_json_always_emit) = true]; } -message ActualLRPInstanceChangedEvent { - ActualLRPKey actual_lrp_key = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; - ActualLRPInstanceKey actual_lrp_instance_key = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; - ActualLRPInfo before = 3; - ActualLRPInfo after = 4; - string trace_id = 5 [(gogoproto.jsontag) = "trace_id"]; +message ProtoActualLRPInstanceChangedEvent { + ProtoActualLRPKey actual_lrp_key = 1 [(bbs.bbs_by_value) = true, json_name = "actual_lrp_key", (bbs.bbs_json_always_emit) = true]; + ProtoActualLRPInstanceKey actual_lrp_instance_key = 2 [(bbs.bbs_by_value) = true, json_name = "actual_lrp_instance_key", (bbs.bbs_json_always_emit) = true]; + ProtoActualLRPInfo before = 3; + ProtoActualLRPInfo after = 4; + string trace_id = 5 [json_name = "trace_id", (bbs.bbs_json_always_emit) = true]; } -message ActualLRPInstanceRemovedEvent { - ActualLRP actual_lrp = 1; - string trace_id = 2 [(gogoproto.jsontag) = "trace_id"]; +message ProtoActualLRPInstanceRemovedEvent { + ProtoActualLRP actual_lrp = 1 [json_name = "actual_lrp"]; + string trace_id = 2 [json_name = "trace_id", (bbs.bbs_json_always_emit) = true]; } -message DesiredLRPCreatedEvent { - DesiredLRP desired_lrp = 1; - string trace_id = 2 [(gogoproto.jsontag) = "trace_id"]; +message ProtoDesiredLRPCreatedEvent { + ProtoDesiredLRP desired_lrp = 1 [json_name = "desired_lrp"]; + string trace_id = 2 [json_name = "trace_id", (bbs.bbs_json_always_emit) = true]; } -message DesiredLRPChangedEvent { - DesiredLRP before = 1; - DesiredLRP after = 2; - string trace_id = 3 [(gogoproto.jsontag) = "trace_id"]; +message ProtoDesiredLRPChangedEvent { + ProtoDesiredLRP before = 1; + ProtoDesiredLRP after = 2; + string trace_id = 3 [json_name = "trace_id", (bbs.bbs_json_always_emit) = true]; } -message DesiredLRPRemovedEvent { - DesiredLRP desired_lrp = 1; - string trace_id = 2 [(gogoproto.jsontag) = "trace_id"]; +message ProtoDesiredLRPRemovedEvent { + ProtoDesiredLRP desired_lrp = 1 [json_name = "desired_lrp"]; + string trace_id = 2 [json_name = "trace_id", (bbs.bbs_json_always_emit) = true]; } -message ActualLRPCrashedEvent { - ActualLRPKey actual_lrp_key = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; - ActualLRPInstanceKey actual_lrp_instance_key = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; - int32 crash_count = 3 [(gogoproto.jsontag) = "crash_count"]; - string crash_reason = 4; - int64 since = 5 [(gogoproto.jsontag) = "since"]; +message ProtoActualLRPCrashedEvent { + ProtoActualLRPKey actual_lrp_key = 1 [(bbs.bbs_by_value) = true, json_name = "actual_lrp_key", (bbs.bbs_json_always_emit) = true]; + ProtoActualLRPInstanceKey actual_lrp_instance_key = 2 [(bbs.bbs_by_value) = true, json_name = "actual_lrp_instance_key", (bbs.bbs_json_always_emit) = true]; + int32 crash_count = 3 [json_name = "crash_count", (bbs.bbs_json_always_emit) = true]; + string crash_reason = 4 [json_name = "crash_reason"]; + int64 since = 5 [json_name = "since", (bbs.bbs_json_always_emit) = true]; } -message EventsByCellId { - string cell_id = 1 [(gogoproto.jsontag) = "cell_id"]; +message ProtoEventsByCellId { + string cell_id = 1 [json_name = "cell_id", (bbs.bbs_json_always_emit) = true]; } -message TaskCreatedEvent { - Task task = 1; +message ProtoTaskCreatedEvent { + ProtoTask task = 1; } -message TaskChangedEvent { - Task before = 1; - Task after = 2; +message ProtoTaskChangedEvent { + ProtoTask before = 1; + ProtoTask after = 2; } -message TaskRemovedEvent { - Task task = 1; +message ProtoTaskRemovedEvent { + ProtoTask task = 1; +} + +message ProtoFakeEvent { + string token = 1; } diff --git a/models/events_bbs.pb.go b/models/events_bbs.pb.go new file mode 100644 index 00000000..8c541dab --- /dev/null +++ b/models/events_bbs.pb.go @@ -0,0 +1,1892 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: events.proto + +package models + +// Deprecated: marked deprecated in events.proto +// Prevent copylock errors when using ProtoActualLRPCreatedEvent directly +type ActualLRPCreatedEvent struct { + ActualLrpGroup *ActualLRPGroup `json:"actual_lrp_group,omitempty"` +} + +func (this *ActualLRPCreatedEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPCreatedEvent) + if !ok { + that2, ok := that.(ActualLRPCreatedEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ActualLrpGroup == nil { + if that1.ActualLrpGroup != nil { + return false + } + } else if !this.ActualLrpGroup.Equal(*that1.ActualLrpGroup) { + return false + } + return true +} +func (m *ActualLRPCreatedEvent) GetActualLrpGroup() *ActualLRPGroup { + if m != nil { + return m.ActualLrpGroup + } + return nil +} +func (m *ActualLRPCreatedEvent) SetActualLrpGroup(value *ActualLRPGroup) { + if m != nil { + m.ActualLrpGroup = value + } +} +func (x *ActualLRPCreatedEvent) ToProto() *ProtoActualLRPCreatedEvent { + if x == nil { + return nil + } + + proto := &ProtoActualLRPCreatedEvent{ + ActualLrpGroup: x.ActualLrpGroup.ToProto(), + } + return proto +} + +func (x *ProtoActualLRPCreatedEvent) FromProto() *ActualLRPCreatedEvent { + if x == nil { + return nil + } + + copysafe := &ActualLRPCreatedEvent{ + ActualLrpGroup: x.ActualLrpGroup.FromProto(), + } + return copysafe +} + +func ActualLRPCreatedEventToProtoSlice(values []*ActualLRPCreatedEvent) []*ProtoActualLRPCreatedEvent { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPCreatedEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPCreatedEventFromProtoSlice(values []*ProtoActualLRPCreatedEvent) []*ActualLRPCreatedEvent { + if values == nil { + return nil + } + result := make([]*ActualLRPCreatedEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Deprecated: marked deprecated in events.proto +// Prevent copylock errors when using ProtoActualLRPChangedEvent directly +type ActualLRPChangedEvent struct { + Before *ActualLRPGroup `json:"before,omitempty"` + After *ActualLRPGroup `json:"after,omitempty"` +} + +func (this *ActualLRPChangedEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPChangedEvent) + if !ok { + that2, ok := that.(ActualLRPChangedEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Before == nil { + if that1.Before != nil { + return false + } + } else if !this.Before.Equal(*that1.Before) { + return false + } + if this.After == nil { + if that1.After != nil { + return false + } + } else if !this.After.Equal(*that1.After) { + return false + } + return true +} +func (m *ActualLRPChangedEvent) GetBefore() *ActualLRPGroup { + if m != nil { + return m.Before + } + return nil +} +func (m *ActualLRPChangedEvent) SetBefore(value *ActualLRPGroup) { + if m != nil { + m.Before = value + } +} +func (m *ActualLRPChangedEvent) GetAfter() *ActualLRPGroup { + if m != nil { + return m.After + } + return nil +} +func (m *ActualLRPChangedEvent) SetAfter(value *ActualLRPGroup) { + if m != nil { + m.After = value + } +} +func (x *ActualLRPChangedEvent) ToProto() *ProtoActualLRPChangedEvent { + if x == nil { + return nil + } + + proto := &ProtoActualLRPChangedEvent{ + Before: x.Before.ToProto(), + After: x.After.ToProto(), + } + return proto +} + +func (x *ProtoActualLRPChangedEvent) FromProto() *ActualLRPChangedEvent { + if x == nil { + return nil + } + + copysafe := &ActualLRPChangedEvent{ + Before: x.Before.FromProto(), + After: x.After.FromProto(), + } + return copysafe +} + +func ActualLRPChangedEventToProtoSlice(values []*ActualLRPChangedEvent) []*ProtoActualLRPChangedEvent { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPChangedEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPChangedEventFromProtoSlice(values []*ProtoActualLRPChangedEvent) []*ActualLRPChangedEvent { + if values == nil { + return nil + } + result := make([]*ActualLRPChangedEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Deprecated: marked deprecated in events.proto +// Prevent copylock errors when using ProtoActualLRPRemovedEvent directly +type ActualLRPRemovedEvent struct { + ActualLrpGroup *ActualLRPGroup `json:"actual_lrp_group,omitempty"` +} + +func (this *ActualLRPRemovedEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPRemovedEvent) + if !ok { + that2, ok := that.(ActualLRPRemovedEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ActualLrpGroup == nil { + if that1.ActualLrpGroup != nil { + return false + } + } else if !this.ActualLrpGroup.Equal(*that1.ActualLrpGroup) { + return false + } + return true +} +func (m *ActualLRPRemovedEvent) GetActualLrpGroup() *ActualLRPGroup { + if m != nil { + return m.ActualLrpGroup + } + return nil +} +func (m *ActualLRPRemovedEvent) SetActualLrpGroup(value *ActualLRPGroup) { + if m != nil { + m.ActualLrpGroup = value + } +} +func (x *ActualLRPRemovedEvent) ToProto() *ProtoActualLRPRemovedEvent { + if x == nil { + return nil + } + + proto := &ProtoActualLRPRemovedEvent{ + ActualLrpGroup: x.ActualLrpGroup.ToProto(), + } + return proto +} + +func (x *ProtoActualLRPRemovedEvent) FromProto() *ActualLRPRemovedEvent { + if x == nil { + return nil + } + + copysafe := &ActualLRPRemovedEvent{ + ActualLrpGroup: x.ActualLrpGroup.FromProto(), + } + return copysafe +} + +func ActualLRPRemovedEventToProtoSlice(values []*ActualLRPRemovedEvent) []*ProtoActualLRPRemovedEvent { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPRemovedEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPRemovedEventFromProtoSlice(values []*ProtoActualLRPRemovedEvent) []*ActualLRPRemovedEvent { + if values == nil { + return nil + } + result := make([]*ActualLRPRemovedEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoActualLRPInstanceCreatedEvent directly +type ActualLRPInstanceCreatedEvent struct { + ActualLrp *ActualLRP `json:"actual_lrp,omitempty"` + TraceId string `json:"trace_id"` +} + +func (this *ActualLRPInstanceCreatedEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPInstanceCreatedEvent) + if !ok { + that2, ok := that.(ActualLRPInstanceCreatedEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ActualLrp == nil { + if that1.ActualLrp != nil { + return false + } + } else if !this.ActualLrp.Equal(*that1.ActualLrp) { + return false + } + if this.TraceId != that1.TraceId { + return false + } + return true +} +func (m *ActualLRPInstanceCreatedEvent) GetActualLrp() *ActualLRP { + if m != nil { + return m.ActualLrp + } + return nil +} +func (m *ActualLRPInstanceCreatedEvent) SetActualLrp(value *ActualLRP) { + if m != nil { + m.ActualLrp = value + } +} +func (m *ActualLRPInstanceCreatedEvent) GetTraceId() string { + if m != nil { + return m.TraceId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPInstanceCreatedEvent) SetTraceId(value string) { + if m != nil { + m.TraceId = value + } +} +func (x *ActualLRPInstanceCreatedEvent) ToProto() *ProtoActualLRPInstanceCreatedEvent { + if x == nil { + return nil + } + + proto := &ProtoActualLRPInstanceCreatedEvent{ + ActualLrp: x.ActualLrp.ToProto(), + TraceId: x.TraceId, + } + return proto +} + +func (x *ProtoActualLRPInstanceCreatedEvent) FromProto() *ActualLRPInstanceCreatedEvent { + if x == nil { + return nil + } + + copysafe := &ActualLRPInstanceCreatedEvent{ + ActualLrp: x.ActualLrp.FromProto(), + TraceId: x.TraceId, + } + return copysafe +} + +func ActualLRPInstanceCreatedEventToProtoSlice(values []*ActualLRPInstanceCreatedEvent) []*ProtoActualLRPInstanceCreatedEvent { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPInstanceCreatedEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPInstanceCreatedEventFromProtoSlice(values []*ProtoActualLRPInstanceCreatedEvent) []*ActualLRPInstanceCreatedEvent { + if values == nil { + return nil + } + result := make([]*ActualLRPInstanceCreatedEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoActualLRPInfo directly +type ActualLRPInfo struct { + ActualLrpNetInfo ActualLRPNetInfo `json:"actual_lrp_net_info"` + CrashCount int32 `json:"crash_count"` + CrashReason string `json:"crash_reason,omitempty"` + State string `json:"state"` + PlacementError string `json:"placement_error,omitempty"` + Since int64 `json:"since"` + ModificationTag ModificationTag `json:"modification_tag"` + Presence ActualLRP_Presence `json:"presence"` + Routable *bool `json:"Routable,omitempty"` + AvailabilityZone string `json:"availability_zone"` +} + +func (this *ActualLRPInfo) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPInfo) + if !ok { + that2, ok := that.(ActualLRPInfo) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if !this.ActualLrpNetInfo.Equal(that1.ActualLrpNetInfo) { + return false + } + if this.CrashCount != that1.CrashCount { + return false + } + if this.CrashReason != that1.CrashReason { + return false + } + if this.State != that1.State { + return false + } + if this.PlacementError != that1.PlacementError { + return false + } + if this.Since != that1.Since { + return false + } + if !this.ModificationTag.Equal(that1.ModificationTag) { + return false + } + if this.Presence != that1.Presence { + return false + } + if this.Routable == nil { + if that1.Routable != nil { + return false + } + } else if *this.Routable != *that1.Routable { + return false + } + if this.AvailabilityZone != that1.AvailabilityZone { + return false + } + return true +} +func (m *ActualLRPInfo) SetActualLrpNetInfo(value ActualLRPNetInfo) { + if m != nil { + m.ActualLrpNetInfo = value + } +} +func (m *ActualLRPInfo) GetCrashCount() int32 { + if m != nil { + return m.CrashCount + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *ActualLRPInfo) SetCrashCount(value int32) { + if m != nil { + m.CrashCount = value + } +} +func (m *ActualLRPInfo) GetCrashReason() string { + if m != nil { + return m.CrashReason + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPInfo) SetCrashReason(value string) { + if m != nil { + m.CrashReason = value + } +} +func (m *ActualLRPInfo) GetState() string { + if m != nil { + return m.State + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPInfo) SetState(value string) { + if m != nil { + m.State = value + } +} +func (m *ActualLRPInfo) GetPlacementError() string { + if m != nil { + return m.PlacementError + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPInfo) SetPlacementError(value string) { + if m != nil { + m.PlacementError = value + } +} +func (m *ActualLRPInfo) GetSince() int64 { + if m != nil { + return m.Since + } + var defaultValue int64 + defaultValue = 0 + return defaultValue +} +func (m *ActualLRPInfo) SetSince(value int64) { + if m != nil { + m.Since = value + } +} +func (m *ActualLRPInfo) SetModificationTag(value ModificationTag) { + if m != nil { + m.ModificationTag = value + } +} +func (m *ActualLRPInfo) SetPresence(value ActualLRP_Presence) { + if m != nil { + m.Presence = value + } +} +func (m *ActualLRPInfo) RoutableExists() bool { + return m != nil && m.Routable != nil +} +func (m *ActualLRPInfo) GetRoutable() *bool { + if m != nil && m.Routable != nil { + return m.Routable + } + var defaultValue bool + defaultValue = false + return &defaultValue +} +func (m *ActualLRPInfo) SetRoutable(value *bool) { + if m != nil { + m.Routable = value + } +} +func (m *ActualLRPInfo) GetAvailabilityZone() string { + if m != nil { + return m.AvailabilityZone + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPInfo) SetAvailabilityZone(value string) { + if m != nil { + m.AvailabilityZone = value + } +} +func (x *ActualLRPInfo) ToProto() *ProtoActualLRPInfo { + if x == nil { + return nil + } + + proto := &ProtoActualLRPInfo{ + ActualLrpNetInfo: x.ActualLrpNetInfo.ToProto(), + CrashCount: x.CrashCount, + CrashReason: x.CrashReason, + State: x.State, + PlacementError: x.PlacementError, + Since: x.Since, + ModificationTag: x.ModificationTag.ToProto(), + Presence: ProtoActualLRP_Presence(x.Presence), + Routable: x.Routable, + AvailabilityZone: x.AvailabilityZone, + } + return proto +} + +func (x *ProtoActualLRPInfo) FromProto() *ActualLRPInfo { + if x == nil { + return nil + } + + copysafe := &ActualLRPInfo{ + ActualLrpNetInfo: *x.ActualLrpNetInfo.FromProto(), + CrashCount: x.CrashCount, + CrashReason: x.CrashReason, + State: x.State, + PlacementError: x.PlacementError, + Since: x.Since, + ModificationTag: *x.ModificationTag.FromProto(), + Presence: ActualLRP_Presence(x.Presence), + Routable: x.Routable, + AvailabilityZone: x.AvailabilityZone, + } + return copysafe +} + +func ActualLRPInfoToProtoSlice(values []*ActualLRPInfo) []*ProtoActualLRPInfo { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPInfo, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPInfoFromProtoSlice(values []*ProtoActualLRPInfo) []*ActualLRPInfo { + if values == nil { + return nil + } + result := make([]*ActualLRPInfo, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoActualLRPInstanceChangedEvent directly +type ActualLRPInstanceChangedEvent struct { + ActualLrpKey ActualLRPKey `json:"actual_lrp_key"` + ActualLrpInstanceKey ActualLRPInstanceKey `json:"actual_lrp_instance_key"` + Before *ActualLRPInfo `json:"before,omitempty"` + After *ActualLRPInfo `json:"after,omitempty"` + TraceId string `json:"trace_id"` +} + +func (this *ActualLRPInstanceChangedEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPInstanceChangedEvent) + if !ok { + that2, ok := that.(ActualLRPInstanceChangedEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if !this.ActualLrpKey.Equal(that1.ActualLrpKey) { + return false + } + if !this.ActualLrpInstanceKey.Equal(that1.ActualLrpInstanceKey) { + return false + } + if this.Before == nil { + if that1.Before != nil { + return false + } + } else if !this.Before.Equal(*that1.Before) { + return false + } + if this.After == nil { + if that1.After != nil { + return false + } + } else if !this.After.Equal(*that1.After) { + return false + } + if this.TraceId != that1.TraceId { + return false + } + return true +} +func (m *ActualLRPInstanceChangedEvent) SetActualLrpKey(value ActualLRPKey) { + if m != nil { + m.ActualLrpKey = value + } +} +func (m *ActualLRPInstanceChangedEvent) SetActualLrpInstanceKey(value ActualLRPInstanceKey) { + if m != nil { + m.ActualLrpInstanceKey = value + } +} +func (m *ActualLRPInstanceChangedEvent) GetBefore() *ActualLRPInfo { + if m != nil { + return m.Before + } + return nil +} +func (m *ActualLRPInstanceChangedEvent) SetBefore(value *ActualLRPInfo) { + if m != nil { + m.Before = value + } +} +func (m *ActualLRPInstanceChangedEvent) GetAfter() *ActualLRPInfo { + if m != nil { + return m.After + } + return nil +} +func (m *ActualLRPInstanceChangedEvent) SetAfter(value *ActualLRPInfo) { + if m != nil { + m.After = value + } +} +func (m *ActualLRPInstanceChangedEvent) GetTraceId() string { + if m != nil { + return m.TraceId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPInstanceChangedEvent) SetTraceId(value string) { + if m != nil { + m.TraceId = value + } +} +func (x *ActualLRPInstanceChangedEvent) ToProto() *ProtoActualLRPInstanceChangedEvent { + if x == nil { + return nil + } + + proto := &ProtoActualLRPInstanceChangedEvent{ + ActualLrpKey: x.ActualLrpKey.ToProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.ToProto(), + Before: x.Before.ToProto(), + After: x.After.ToProto(), + TraceId: x.TraceId, + } + return proto +} + +func (x *ProtoActualLRPInstanceChangedEvent) FromProto() *ActualLRPInstanceChangedEvent { + if x == nil { + return nil + } + + copysafe := &ActualLRPInstanceChangedEvent{ + ActualLrpKey: *x.ActualLrpKey.FromProto(), + ActualLrpInstanceKey: *x.ActualLrpInstanceKey.FromProto(), + Before: x.Before.FromProto(), + After: x.After.FromProto(), + TraceId: x.TraceId, + } + return copysafe +} + +func ActualLRPInstanceChangedEventToProtoSlice(values []*ActualLRPInstanceChangedEvent) []*ProtoActualLRPInstanceChangedEvent { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPInstanceChangedEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPInstanceChangedEventFromProtoSlice(values []*ProtoActualLRPInstanceChangedEvent) []*ActualLRPInstanceChangedEvent { + if values == nil { + return nil + } + result := make([]*ActualLRPInstanceChangedEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoActualLRPInstanceRemovedEvent directly +type ActualLRPInstanceRemovedEvent struct { + ActualLrp *ActualLRP `json:"actual_lrp,omitempty"` + TraceId string `json:"trace_id"` +} + +func (this *ActualLRPInstanceRemovedEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPInstanceRemovedEvent) + if !ok { + that2, ok := that.(ActualLRPInstanceRemovedEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.ActualLrp == nil { + if that1.ActualLrp != nil { + return false + } + } else if !this.ActualLrp.Equal(*that1.ActualLrp) { + return false + } + if this.TraceId != that1.TraceId { + return false + } + return true +} +func (m *ActualLRPInstanceRemovedEvent) GetActualLrp() *ActualLRP { + if m != nil { + return m.ActualLrp + } + return nil +} +func (m *ActualLRPInstanceRemovedEvent) SetActualLrp(value *ActualLRP) { + if m != nil { + m.ActualLrp = value + } +} +func (m *ActualLRPInstanceRemovedEvent) GetTraceId() string { + if m != nil { + return m.TraceId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPInstanceRemovedEvent) SetTraceId(value string) { + if m != nil { + m.TraceId = value + } +} +func (x *ActualLRPInstanceRemovedEvent) ToProto() *ProtoActualLRPInstanceRemovedEvent { + if x == nil { + return nil + } + + proto := &ProtoActualLRPInstanceRemovedEvent{ + ActualLrp: x.ActualLrp.ToProto(), + TraceId: x.TraceId, + } + return proto +} + +func (x *ProtoActualLRPInstanceRemovedEvent) FromProto() *ActualLRPInstanceRemovedEvent { + if x == nil { + return nil + } + + copysafe := &ActualLRPInstanceRemovedEvent{ + ActualLrp: x.ActualLrp.FromProto(), + TraceId: x.TraceId, + } + return copysafe +} + +func ActualLRPInstanceRemovedEventToProtoSlice(values []*ActualLRPInstanceRemovedEvent) []*ProtoActualLRPInstanceRemovedEvent { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPInstanceRemovedEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPInstanceRemovedEventFromProtoSlice(values []*ProtoActualLRPInstanceRemovedEvent) []*ActualLRPInstanceRemovedEvent { + if values == nil { + return nil + } + result := make([]*ActualLRPInstanceRemovedEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRPCreatedEvent directly +type DesiredLRPCreatedEvent struct { + DesiredLrp *DesiredLRP `json:"desired_lrp,omitempty"` + TraceId string `json:"trace_id"` +} + +func (this *DesiredLRPCreatedEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPCreatedEvent) + if !ok { + that2, ok := that.(DesiredLRPCreatedEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.DesiredLrp == nil { + if that1.DesiredLrp != nil { + return false + } + } else if !this.DesiredLrp.Equal(*that1.DesiredLrp) { + return false + } + if this.TraceId != that1.TraceId { + return false + } + return true +} +func (m *DesiredLRPCreatedEvent) GetDesiredLrp() *DesiredLRP { + if m != nil { + return m.DesiredLrp + } + return nil +} +func (m *DesiredLRPCreatedEvent) SetDesiredLrp(value *DesiredLRP) { + if m != nil { + m.DesiredLrp = value + } +} +func (m *DesiredLRPCreatedEvent) GetTraceId() string { + if m != nil { + return m.TraceId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPCreatedEvent) SetTraceId(value string) { + if m != nil { + m.TraceId = value + } +} +func (x *DesiredLRPCreatedEvent) ToProto() *ProtoDesiredLRPCreatedEvent { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPCreatedEvent{ + DesiredLrp: x.DesiredLrp.ToProto(), + TraceId: x.TraceId, + } + return proto +} + +func (x *ProtoDesiredLRPCreatedEvent) FromProto() *DesiredLRPCreatedEvent { + if x == nil { + return nil + } + + copysafe := &DesiredLRPCreatedEvent{ + DesiredLrp: x.DesiredLrp.FromProto(), + TraceId: x.TraceId, + } + return copysafe +} + +func DesiredLRPCreatedEventToProtoSlice(values []*DesiredLRPCreatedEvent) []*ProtoDesiredLRPCreatedEvent { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPCreatedEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPCreatedEventFromProtoSlice(values []*ProtoDesiredLRPCreatedEvent) []*DesiredLRPCreatedEvent { + if values == nil { + return nil + } + result := make([]*DesiredLRPCreatedEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRPChangedEvent directly +type DesiredLRPChangedEvent struct { + Before *DesiredLRP `json:"before,omitempty"` + After *DesiredLRP `json:"after,omitempty"` + TraceId string `json:"trace_id"` +} + +func (this *DesiredLRPChangedEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPChangedEvent) + if !ok { + that2, ok := that.(DesiredLRPChangedEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Before == nil { + if that1.Before != nil { + return false + } + } else if !this.Before.Equal(*that1.Before) { + return false + } + if this.After == nil { + if that1.After != nil { + return false + } + } else if !this.After.Equal(*that1.After) { + return false + } + if this.TraceId != that1.TraceId { + return false + } + return true +} +func (m *DesiredLRPChangedEvent) GetBefore() *DesiredLRP { + if m != nil { + return m.Before + } + return nil +} +func (m *DesiredLRPChangedEvent) SetBefore(value *DesiredLRP) { + if m != nil { + m.Before = value + } +} +func (m *DesiredLRPChangedEvent) GetAfter() *DesiredLRP { + if m != nil { + return m.After + } + return nil +} +func (m *DesiredLRPChangedEvent) SetAfter(value *DesiredLRP) { + if m != nil { + m.After = value + } +} +func (m *DesiredLRPChangedEvent) GetTraceId() string { + if m != nil { + return m.TraceId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPChangedEvent) SetTraceId(value string) { + if m != nil { + m.TraceId = value + } +} +func (x *DesiredLRPChangedEvent) ToProto() *ProtoDesiredLRPChangedEvent { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPChangedEvent{ + Before: x.Before.ToProto(), + After: x.After.ToProto(), + TraceId: x.TraceId, + } + return proto +} + +func (x *ProtoDesiredLRPChangedEvent) FromProto() *DesiredLRPChangedEvent { + if x == nil { + return nil + } + + copysafe := &DesiredLRPChangedEvent{ + Before: x.Before.FromProto(), + After: x.After.FromProto(), + TraceId: x.TraceId, + } + return copysafe +} + +func DesiredLRPChangedEventToProtoSlice(values []*DesiredLRPChangedEvent) []*ProtoDesiredLRPChangedEvent { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPChangedEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPChangedEventFromProtoSlice(values []*ProtoDesiredLRPChangedEvent) []*DesiredLRPChangedEvent { + if values == nil { + return nil + } + result := make([]*DesiredLRPChangedEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesiredLRPRemovedEvent directly +type DesiredLRPRemovedEvent struct { + DesiredLrp *DesiredLRP `json:"desired_lrp,omitempty"` + TraceId string `json:"trace_id"` +} + +func (this *DesiredLRPRemovedEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPRemovedEvent) + if !ok { + that2, ok := that.(DesiredLRPRemovedEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.DesiredLrp == nil { + if that1.DesiredLrp != nil { + return false + } + } else if !this.DesiredLrp.Equal(*that1.DesiredLrp) { + return false + } + if this.TraceId != that1.TraceId { + return false + } + return true +} +func (m *DesiredLRPRemovedEvent) GetDesiredLrp() *DesiredLRP { + if m != nil { + return m.DesiredLrp + } + return nil +} +func (m *DesiredLRPRemovedEvent) SetDesiredLrp(value *DesiredLRP) { + if m != nil { + m.DesiredLrp = value + } +} +func (m *DesiredLRPRemovedEvent) GetTraceId() string { + if m != nil { + return m.TraceId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesiredLRPRemovedEvent) SetTraceId(value string) { + if m != nil { + m.TraceId = value + } +} +func (x *DesiredLRPRemovedEvent) ToProto() *ProtoDesiredLRPRemovedEvent { + if x == nil { + return nil + } + + proto := &ProtoDesiredLRPRemovedEvent{ + DesiredLrp: x.DesiredLrp.ToProto(), + TraceId: x.TraceId, + } + return proto +} + +func (x *ProtoDesiredLRPRemovedEvent) FromProto() *DesiredLRPRemovedEvent { + if x == nil { + return nil + } + + copysafe := &DesiredLRPRemovedEvent{ + DesiredLrp: x.DesiredLrp.FromProto(), + TraceId: x.TraceId, + } + return copysafe +} + +func DesiredLRPRemovedEventToProtoSlice(values []*DesiredLRPRemovedEvent) []*ProtoDesiredLRPRemovedEvent { + if values == nil { + return nil + } + result := make([]*ProtoDesiredLRPRemovedEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesiredLRPRemovedEventFromProtoSlice(values []*ProtoDesiredLRPRemovedEvent) []*DesiredLRPRemovedEvent { + if values == nil { + return nil + } + result := make([]*DesiredLRPRemovedEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoActualLRPCrashedEvent directly +type ActualLRPCrashedEvent struct { + ActualLrpKey ActualLRPKey `json:"actual_lrp_key"` + ActualLrpInstanceKey ActualLRPInstanceKey `json:"actual_lrp_instance_key"` + CrashCount int32 `json:"crash_count"` + CrashReason string `json:"crash_reason,omitempty"` + Since int64 `json:"since"` +} + +func (this *ActualLRPCrashedEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ActualLRPCrashedEvent) + if !ok { + that2, ok := that.(ActualLRPCrashedEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if !this.ActualLrpKey.Equal(that1.ActualLrpKey) { + return false + } + if !this.ActualLrpInstanceKey.Equal(that1.ActualLrpInstanceKey) { + return false + } + if this.CrashCount != that1.CrashCount { + return false + } + if this.CrashReason != that1.CrashReason { + return false + } + if this.Since != that1.Since { + return false + } + return true +} +func (m *ActualLRPCrashedEvent) SetActualLrpKey(value ActualLRPKey) { + if m != nil { + m.ActualLrpKey = value + } +} +func (m *ActualLRPCrashedEvent) SetActualLrpInstanceKey(value ActualLRPInstanceKey) { + if m != nil { + m.ActualLrpInstanceKey = value + } +} +func (m *ActualLRPCrashedEvent) GetCrashCount() int32 { + if m != nil { + return m.CrashCount + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *ActualLRPCrashedEvent) SetCrashCount(value int32) { + if m != nil { + m.CrashCount = value + } +} +func (m *ActualLRPCrashedEvent) GetCrashReason() string { + if m != nil { + return m.CrashReason + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ActualLRPCrashedEvent) SetCrashReason(value string) { + if m != nil { + m.CrashReason = value + } +} +func (m *ActualLRPCrashedEvent) GetSince() int64 { + if m != nil { + return m.Since + } + var defaultValue int64 + defaultValue = 0 + return defaultValue +} +func (m *ActualLRPCrashedEvent) SetSince(value int64) { + if m != nil { + m.Since = value + } +} +func (x *ActualLRPCrashedEvent) ToProto() *ProtoActualLRPCrashedEvent { + if x == nil { + return nil + } + + proto := &ProtoActualLRPCrashedEvent{ + ActualLrpKey: x.ActualLrpKey.ToProto(), + ActualLrpInstanceKey: x.ActualLrpInstanceKey.ToProto(), + CrashCount: x.CrashCount, + CrashReason: x.CrashReason, + Since: x.Since, + } + return proto +} + +func (x *ProtoActualLRPCrashedEvent) FromProto() *ActualLRPCrashedEvent { + if x == nil { + return nil + } + + copysafe := &ActualLRPCrashedEvent{ + ActualLrpKey: *x.ActualLrpKey.FromProto(), + ActualLrpInstanceKey: *x.ActualLrpInstanceKey.FromProto(), + CrashCount: x.CrashCount, + CrashReason: x.CrashReason, + Since: x.Since, + } + return copysafe +} + +func ActualLRPCrashedEventToProtoSlice(values []*ActualLRPCrashedEvent) []*ProtoActualLRPCrashedEvent { + if values == nil { + return nil + } + result := make([]*ProtoActualLRPCrashedEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ActualLRPCrashedEventFromProtoSlice(values []*ProtoActualLRPCrashedEvent) []*ActualLRPCrashedEvent { + if values == nil { + return nil + } + result := make([]*ActualLRPCrashedEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoEventsByCellId directly +type EventsByCellId struct { + CellId string `json:"cell_id"` +} + +func (this *EventsByCellId) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*EventsByCellId) + if !ok { + that2, ok := that.(EventsByCellId) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.CellId != that1.CellId { + return false + } + return true +} +func (m *EventsByCellId) GetCellId() string { + if m != nil { + return m.CellId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *EventsByCellId) SetCellId(value string) { + if m != nil { + m.CellId = value + } +} +func (x *EventsByCellId) ToProto() *ProtoEventsByCellId { + if x == nil { + return nil + } + + proto := &ProtoEventsByCellId{ + CellId: x.CellId, + } + return proto +} + +func (x *ProtoEventsByCellId) FromProto() *EventsByCellId { + if x == nil { + return nil + } + + copysafe := &EventsByCellId{ + CellId: x.CellId, + } + return copysafe +} + +func EventsByCellIdToProtoSlice(values []*EventsByCellId) []*ProtoEventsByCellId { + if values == nil { + return nil + } + result := make([]*ProtoEventsByCellId, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func EventsByCellIdFromProtoSlice(values []*ProtoEventsByCellId) []*EventsByCellId { + if values == nil { + return nil + } + result := make([]*EventsByCellId, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoTaskCreatedEvent directly +type TaskCreatedEvent struct { + Task *Task `json:"task,omitempty"` +} + +func (this *TaskCreatedEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TaskCreatedEvent) + if !ok { + that2, ok := that.(TaskCreatedEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Task == nil { + if that1.Task != nil { + return false + } + } else if !this.Task.Equal(*that1.Task) { + return false + } + return true +} +func (m *TaskCreatedEvent) GetTask() *Task { + if m != nil { + return m.Task + } + return nil +} +func (m *TaskCreatedEvent) SetTask(value *Task) { + if m != nil { + m.Task = value + } +} +func (x *TaskCreatedEvent) ToProto() *ProtoTaskCreatedEvent { + if x == nil { + return nil + } + + proto := &ProtoTaskCreatedEvent{ + Task: x.Task.ToProto(), + } + return proto +} + +func (x *ProtoTaskCreatedEvent) FromProto() *TaskCreatedEvent { + if x == nil { + return nil + } + + copysafe := &TaskCreatedEvent{ + Task: x.Task.FromProto(), + } + return copysafe +} + +func TaskCreatedEventToProtoSlice(values []*TaskCreatedEvent) []*ProtoTaskCreatedEvent { + if values == nil { + return nil + } + result := make([]*ProtoTaskCreatedEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TaskCreatedEventFromProtoSlice(values []*ProtoTaskCreatedEvent) []*TaskCreatedEvent { + if values == nil { + return nil + } + result := make([]*TaskCreatedEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoTaskChangedEvent directly +type TaskChangedEvent struct { + Before *Task `json:"before,omitempty"` + After *Task `json:"after,omitempty"` +} + +func (this *TaskChangedEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TaskChangedEvent) + if !ok { + that2, ok := that.(TaskChangedEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Before == nil { + if that1.Before != nil { + return false + } + } else if !this.Before.Equal(*that1.Before) { + return false + } + if this.After == nil { + if that1.After != nil { + return false + } + } else if !this.After.Equal(*that1.After) { + return false + } + return true +} +func (m *TaskChangedEvent) GetBefore() *Task { + if m != nil { + return m.Before + } + return nil +} +func (m *TaskChangedEvent) SetBefore(value *Task) { + if m != nil { + m.Before = value + } +} +func (m *TaskChangedEvent) GetAfter() *Task { + if m != nil { + return m.After + } + return nil +} +func (m *TaskChangedEvent) SetAfter(value *Task) { + if m != nil { + m.After = value + } +} +func (x *TaskChangedEvent) ToProto() *ProtoTaskChangedEvent { + if x == nil { + return nil + } + + proto := &ProtoTaskChangedEvent{ + Before: x.Before.ToProto(), + After: x.After.ToProto(), + } + return proto +} + +func (x *ProtoTaskChangedEvent) FromProto() *TaskChangedEvent { + if x == nil { + return nil + } + + copysafe := &TaskChangedEvent{ + Before: x.Before.FromProto(), + After: x.After.FromProto(), + } + return copysafe +} + +func TaskChangedEventToProtoSlice(values []*TaskChangedEvent) []*ProtoTaskChangedEvent { + if values == nil { + return nil + } + result := make([]*ProtoTaskChangedEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TaskChangedEventFromProtoSlice(values []*ProtoTaskChangedEvent) []*TaskChangedEvent { + if values == nil { + return nil + } + result := make([]*TaskChangedEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoTaskRemovedEvent directly +type TaskRemovedEvent struct { + Task *Task `json:"task,omitempty"` +} + +func (this *TaskRemovedEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TaskRemovedEvent) + if !ok { + that2, ok := that.(TaskRemovedEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Task == nil { + if that1.Task != nil { + return false + } + } else if !this.Task.Equal(*that1.Task) { + return false + } + return true +} +func (m *TaskRemovedEvent) GetTask() *Task { + if m != nil { + return m.Task + } + return nil +} +func (m *TaskRemovedEvent) SetTask(value *Task) { + if m != nil { + m.Task = value + } +} +func (x *TaskRemovedEvent) ToProto() *ProtoTaskRemovedEvent { + if x == nil { + return nil + } + + proto := &ProtoTaskRemovedEvent{ + Task: x.Task.ToProto(), + } + return proto +} + +func (x *ProtoTaskRemovedEvent) FromProto() *TaskRemovedEvent { + if x == nil { + return nil + } + + copysafe := &TaskRemovedEvent{ + Task: x.Task.FromProto(), + } + return copysafe +} + +func TaskRemovedEventToProtoSlice(values []*TaskRemovedEvent) []*ProtoTaskRemovedEvent { + if values == nil { + return nil + } + result := make([]*ProtoTaskRemovedEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TaskRemovedEventFromProtoSlice(values []*ProtoTaskRemovedEvent) []*TaskRemovedEvent { + if values == nil { + return nil + } + result := make([]*TaskRemovedEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoFakeEvent directly +type FakeEvent struct { + Token string `json:"token,omitempty"` +} + +func (this *FakeEvent) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*FakeEvent) + if !ok { + that2, ok := that.(FakeEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Token != that1.Token { + return false + } + return true +} +func (m *FakeEvent) GetToken() string { + if m != nil { + return m.Token + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *FakeEvent) SetToken(value string) { + if m != nil { + m.Token = value + } +} +func (x *FakeEvent) ToProto() *ProtoFakeEvent { + if x == nil { + return nil + } + + proto := &ProtoFakeEvent{ + Token: x.Token, + } + return proto +} + +func (x *ProtoFakeEvent) FromProto() *FakeEvent { + if x == nil { + return nil + } + + copysafe := &FakeEvent{ + Token: x.Token, + } + return copysafe +} + +func FakeEventToProtoSlice(values []*FakeEvent) []*ProtoFakeEvent { + if values == nil { + return nil + } + result := make([]*ProtoFakeEvent, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func FakeEventFromProtoSlice(values []*ProtoFakeEvent) []*FakeEvent { + if values == nil { + return nil + } + result := make([]*FakeEvent, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/events_test.go b/models/events_test.go index 4acf7441..d885b3c1 100644 --- a/models/events_test.go +++ b/models/events_test.go @@ -14,12 +14,12 @@ var _ = Describe("Events", func() { Context("when before is set", func() { BeforeEach(func() { before = &models.ActualLRP{ - ActualLRPKey: models.ActualLRPKey{ + ActualLrpKey: models.ActualLRPKey{ ProcessGuid: "before-process-guid", Index: 5, Domain: "before-domain", }, - ActualLRPInstanceKey: models.ActualLRPInstanceKey{ + ActualLrpInstanceKey: models.ActualLRPInstanceKey{ InstanceGuid: "before-instance-guid", CellId: "before-cell-id", }, @@ -29,12 +29,12 @@ var _ = Describe("Events", func() { Context("when after is set", func() { BeforeEach(func() { after = &models.ActualLRP{ - ActualLRPKey: models.ActualLRPKey{ + ActualLrpKey: models.ActualLRPKey{ ProcessGuid: "after-process-guid", Index: 7, Domain: "after-domain", }, - ActualLRPInstanceKey: models.ActualLRPInstanceKey{ + ActualLrpInstanceKey: models.ActualLRPInstanceKey{ InstanceGuid: "after-instance-guid", CellId: "after-cell-id", }, @@ -43,15 +43,15 @@ var _ = Describe("Events", func() { It("returns the after's actual lrp key and instance key", func() { event := models.NewActualLRPInstanceChangedEvent(before, after, "some-trace-id") - Expect(event.ActualLRPKey).To(Equal(after.ActualLRPKey)) - Expect(event.ActualLRPInstanceKey).To(Equal(after.ActualLRPInstanceKey)) + Expect(event.ActualLrpKey).To(Equal(after.ActualLrpKey)) + Expect(event.ActualLrpInstanceKey).To(Equal(after.ActualLrpInstanceKey)) }) }) Context("when after is unclaimed", func() { BeforeEach(func() { after = &models.ActualLRP{ - ActualLRPKey: models.ActualLRPKey{ + ActualLrpKey: models.ActualLRPKey{ ProcessGuid: "after-process-guid", Index: 7, Domain: "after-domain", @@ -62,8 +62,8 @@ var _ = Describe("Events", func() { It("returns after's actual lrp key and before's instance key", func() { event := models.NewActualLRPInstanceChangedEvent(before, after, "some-trace-id") - Expect(event.ActualLRPKey).To(Equal(after.ActualLRPKey)) - Expect(event.ActualLRPInstanceKey).To(Equal(before.ActualLRPInstanceKey)) + Expect(event.ActualLrpKey).To(Equal(after.ActualLrpKey)) + Expect(event.ActualLrpInstanceKey).To(Equal(before.ActualLrpInstanceKey)) }) }) @@ -74,8 +74,8 @@ var _ = Describe("Events", func() { It("returns the before's actual lrp key and instance key", func() { event := models.NewActualLRPInstanceChangedEvent(before, after, "some-trace-id") - Expect(event.ActualLRPKey).To(Equal(before.ActualLRPKey)) - Expect(event.ActualLRPInstanceKey).To(Equal(before.ActualLRPInstanceKey)) + Expect(event.ActualLrpKey).To(Equal(before.ActualLrpKey)) + Expect(event.ActualLrpInstanceKey).To(Equal(before.ActualLrpInstanceKey)) }) }) }) @@ -88,12 +88,12 @@ var _ = Describe("Events", func() { Context("when after is set", func() { BeforeEach(func() { after = &models.ActualLRP{ - ActualLRPKey: models.ActualLRPKey{ + ActualLrpKey: models.ActualLRPKey{ ProcessGuid: "after-process-guid", Index: 7, Domain: "after-domain", }, - ActualLRPInstanceKey: models.ActualLRPInstanceKey{ + ActualLrpInstanceKey: models.ActualLRPInstanceKey{ InstanceGuid: "after-instance-guid", CellId: "after-cell-id", }, @@ -102,14 +102,14 @@ var _ = Describe("Events", func() { It("returns the after's actual lrp key and instance key", func() { event := models.NewActualLRPInstanceChangedEvent(before, after, "some-trace-id") - Expect(event.ActualLRPKey).To(Equal(after.ActualLRPKey)) - Expect(event.ActualLRPInstanceKey).To(Equal(after.ActualLRPInstanceKey)) + Expect(event.ActualLrpKey).To(Equal(after.ActualLrpKey)) + Expect(event.ActualLrpInstanceKey).To(Equal(after.ActualLrpInstanceKey)) }) Context("when before is unclaimed", func() { BeforeEach(func() { before = &models.ActualLRP{ - ActualLRPKey: models.ActualLRPKey{ + ActualLrpKey: models.ActualLRPKey{ ProcessGuid: "before-process-guid", Index: 5, Domain: "before-domain", @@ -120,8 +120,8 @@ var _ = Describe("Events", func() { It("returns after's actual lrp key and after's instance key", func() { event := models.NewActualLRPInstanceChangedEvent(before, after, "some-trace-id") - Expect(event.ActualLRPKey).To(Equal(after.ActualLRPKey)) - Expect(event.ActualLRPInstanceKey).To(Equal(after.ActualLRPInstanceKey)) + Expect(event.ActualLrpKey).To(Equal(after.ActualLrpKey)) + Expect(event.ActualLrpInstanceKey).To(Equal(after.ActualLrpInstanceKey)) }) }) }) @@ -133,8 +133,8 @@ var _ = Describe("Events", func() { It("returns the empty actual lrp key and instance key", func() { event := models.NewActualLRPInstanceChangedEvent(before, after, "some-trace-id") - Expect(event.ActualLRPKey).To(Equal(models.ActualLRPKey{})) - Expect(event.ActualLRPInstanceKey).To(Equal(models.ActualLRPInstanceKey{})) + Expect(event.ActualLrpKey).To(Equal(models.ActualLRPKey{})) + Expect(event.ActualLrpInstanceKey).To(Equal(models.ActualLRPInstanceKey{})) }) }) }) diff --git a/models/file.pb.go b/models/file.pb.go index e93426fc..d501ab7d 100644 --- a/models/file.pb.go +++ b/models/file.pb.go @@ -1,434 +1,132 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: file.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type File struct { - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path"` - Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content"` -} - -func (m *File) Reset() { *m = File{} } -func (*File) ProtoMessage() {} -func (*File) Descriptor() ([]byte, []int) { - return fileDescriptor_9188e3b7e55e1162, []int{0} -} -func (m *File) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *File) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_File.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *File) XXX_Merge(src proto.Message) { - xxx_messageInfo_File.Merge(m, src) -} -func (m *File) XXX_Size() int { - return m.Size() -} -func (m *File) XXX_DiscardUnknown() { - xxx_messageInfo_File.DiscardUnknown(m) -} - -var xxx_messageInfo_File proto.InternalMessageInfo - -func (m *File) GetPath() string { - if m != nil { - return m.Path - } - return "" -} +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -func (m *File) GetContent() string { - if m != nil { - return m.Content - } - return "" +type ProtoFile struct { + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { - proto.RegisterType((*File)(nil), "models.File") +func (x *ProtoFile) Reset() { + *x = ProtoFile{} + mi := &file_file_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func init() { proto.RegisterFile("file.proto", fileDescriptor_9188e3b7e55e1162) } - -var fileDescriptor_9188e3b7e55e1162 = []byte{ - // 192 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0xcb, 0xcc, 0x49, - 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xcb, 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0x96, 0xd2, - 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, - 0x07, 0x4b, 0x27, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0xd1, 0xa6, 0xe4, 0xcd, 0xc5, - 0xe2, 0x96, 0x99, 0x93, 0x2a, 0x24, 0xc3, 0xc5, 0x52, 0x90, 0x58, 0x92, 0x21, 0xc1, 0xa8, 0xc0, - 0xa8, 0xc1, 0xe9, 0xc4, 0xf1, 0xea, 0x9e, 0x3c, 0x98, 0x1f, 0x04, 0x26, 0x85, 0x54, 0xb9, 0xd8, - 0x93, 0xf3, 0xf3, 0x4a, 0x52, 0xf3, 0x4a, 0x24, 0x98, 0xc0, 0x0a, 0xb8, 0x5f, 0xdd, 0x93, 0x87, - 0x09, 0x05, 0xc1, 0x18, 0x4e, 0x26, 0x17, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xf0, 0xe1, - 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, - 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x3c, 0x92, 0x63, - 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0x92, 0xd8, 0xc0, - 0x2e, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xcd, 0x8f, 0x30, 0x8c, 0xce, 0x00, 0x00, 0x00, +func (x *ProtoFile) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *File) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoFile) ProtoMessage() {} - that1, ok := that.(*File) - if !ok { - that2, ok := that.(File) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoFile) ProtoReflect() protoreflect.Message { + mi := &file_file_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Path != that1.Path { - return false - } - if this.Content != that1.Content { - return false - } - return true -} -func (this *File) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.File{") - s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") - s = append(s, "Content: "+fmt.Sprintf("%#v", this.Content)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringFile(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *File) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *File) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoFile.ProtoReflect.Descriptor instead. +func (*ProtoFile) Descriptor() ([]byte, []int) { + return file_file_proto_rawDescGZIP(), []int{0} } -func (m *File) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Content) > 0 { - i -= len(m.Content) - copy(dAtA[i:], m.Content) - i = encodeVarintFile(dAtA, i, uint64(len(m.Content))) - i-- - dAtA[i] = 0x12 - } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintFile(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0xa +func (x *ProtoFile) GetPath() string { + if x != nil { + return x.Path } - return len(dAtA) - i, nil + return "" } -func encodeVarintFile(dAtA []byte, offset int, v uint64) int { - offset -= sovFile(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *File) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Path) - if l > 0 { - n += 1 + l + sovFile(uint64(l)) +func (x *ProtoFile) GetContent() string { + if x != nil { + return x.Content } - l = len(m.Content) - if l > 0 { - n += 1 + l + sovFile(uint64(l)) - } - return n + return "" } -func sovFile(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozFile(x uint64) (n int) { - return sovFile(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *File) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&File{`, - `Path:` + fmt.Sprintf("%v", this.Path) + `,`, - `Content:` + fmt.Sprintf("%v", this.Content) + `,`, - `}`, - }, "") - return s -} -func valueToStringFile(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *File) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFile - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: File: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: File: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFile - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthFile - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFile - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFile - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthFile - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFile - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Content = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipFile(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFile - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var File_file_proto protoreflect.FileDescriptor - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipFile(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowFile - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowFile - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowFile - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthFile - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupFile - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthFile - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +const file_file_proto_rawDesc = "" + + "\n" + + "\n" + + "file.proto\x12\x06models\"9\n" + + "\tProtoFile\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12\x18\n" + + "\acontent\x18\x02 \x01(\tR\acontentB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthFile = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowFile = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupFile = fmt.Errorf("proto: unexpected end of group") + file_file_proto_rawDescOnce sync.Once + file_file_proto_rawDescData []byte ) + +func file_file_proto_rawDescGZIP() []byte { + file_file_proto_rawDescOnce.Do(func() { + file_file_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_file_proto_rawDesc), len(file_file_proto_rawDesc))) + }) + return file_file_proto_rawDescData +} + +var file_file_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_file_proto_goTypes = []any{ + (*ProtoFile)(nil), // 0: models.ProtoFile +} +var file_file_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_file_proto_init() } +func file_file_proto_init() { + if File_file_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_file_proto_rawDesc), len(file_file_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_file_proto_goTypes, + DependencyIndexes: file_file_proto_depIdxs, + MessageInfos: file_file_proto_msgTypes, + }.Build() + File_file_proto = out.File + file_file_proto_goTypes = nil + file_file_proto_depIdxs = nil +} diff --git a/models/file.proto b/models/file.proto index 9f314e63..db1e5bd3 100644 --- a/models/file.proto +++ b/models/file.proto @@ -1,10 +1,9 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -message File { - string path = 1 [(gogoproto.jsontag) = "path"]; - string content = 2 [(gogoproto.jsontag) = "content"]; -} \ No newline at end of file +message ProtoFile { + string path = 1 [json_name = "path"]; + string content = 2 [json_name = "content"]; +} diff --git a/models/file_bbs.pb.go b/models/file_bbs.pb.go new file mode 100644 index 00000000..f0e2e1fa --- /dev/null +++ b/models/file_bbs.pb.go @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: file.proto + +package models + +// Prevent copylock errors when using ProtoFile directly +type File struct { + Path string `json:"path,omitempty"` + Content string `json:"content,omitempty"` +} + +func (this *File) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*File) + if !ok { + that2, ok := that.(File) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Path != that1.Path { + return false + } + if this.Content != that1.Content { + return false + } + return true +} +func (m *File) GetPath() string { + if m != nil { + return m.Path + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *File) SetPath(value string) { + if m != nil { + m.Path = value + } +} +func (m *File) GetContent() string { + if m != nil { + return m.Content + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *File) SetContent(value string) { + if m != nil { + m.Content = value + } +} +func (x *File) ToProto() *ProtoFile { + if x == nil { + return nil + } + + proto := &ProtoFile{ + Path: x.Path, + Content: x.Content, + } + return proto +} + +func (x *ProtoFile) FromProto() *File { + if x == nil { + return nil + } + + copysafe := &File{ + Path: x.Path, + Content: x.Content, + } + return copysafe +} + +func FileToProtoSlice(values []*File) []*ProtoFile { + if values == nil { + return nil + } + result := make([]*ProtoFile, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func FileFromProtoSlice(values []*ProtoFile) []*File { + if values == nil { + return nil + } + result := make([]*File, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/image_layer.go b/models/image_layer.go index 6a62e561..edb2ef5a 100644 --- a/models/image_layer.go +++ b/models/image_layer.go @@ -25,11 +25,11 @@ func (l *ImageLayer) Validate() error { validationError = validationError.Append(ErrInvalidField{"media_type"}) } - if (l.DigestValue != "" || l.LayerType == LayerTypeExclusive) && l.DigestAlgorithm == DigestAlgorithmInvalid { + if (l.DigestValue != "" || l.LayerType == ImageLayer_LayerTypeExclusive) && l.DigestAlgorithm == ImageLayer_DigestAlgorithmInvalid { validationError = validationError.Append(ErrInvalidField{"digest_algorithm"}) } - if (l.DigestAlgorithm != DigestAlgorithmInvalid || l.LayerType == LayerTypeExclusive) && l.DigestValue == "" { + if (l.DigestAlgorithm != ImageLayer_DigestAlgorithmInvalid || l.LayerType == ImageLayer_LayerTypeExclusive) && l.DigestValue == "" { validationError = validationError.Append(ErrInvalidField{"digest_value"}) } @@ -56,7 +56,7 @@ func validateImageLayers(layers []*ImageLayer, legacyDownloadUser string) Valida validationError = validationError.Append(err) } - if layer.LayerType == LayerTypeExclusive { + if layer.LayerType == ImageLayer_LayerTypeExclusive { requiresLegacyDownloadUser = true } } @@ -85,7 +85,7 @@ func (layers ImageLayers) FilterByType(layerType ImageLayer_Type) ImageLayers { func (layers ImageLayers) ToDownloadActions(legacyDownloadUser string, existingAction *Action) *Action { downloadActions := []ActionInterface{} - for _, layer := range layers.FilterByType(LayerTypeExclusive) { + for _, layer := range layers.FilterByType(ImageLayer_LayerTypeExclusive) { digestAlgorithmName := strings.ToLower(layer.DigestAlgorithm.String()) downloadActions = append(downloadActions, &DownloadAction{ Artifact: layer.Name, @@ -115,7 +115,7 @@ func (layers ImageLayers) ToDownloadActions(legacyDownloadUser string, existingA func (layers ImageLayers) ToCachedDependencies() []*CachedDependency { cachedDependencies := []*CachedDependency{} - for _, layer := range layers.FilterByType(LayerTypeShared) { + for _, layer := range layers.FilterByType(ImageLayer_LayerTypeShared) { c := &CachedDependency{ Name: layer.Name, From: layer.Url, @@ -123,7 +123,7 @@ func (layers ImageLayers) ToCachedDependencies() []*CachedDependency { ChecksumValue: layer.DigestValue, } - if layer.DigestAlgorithm == DigestAlgorithmInvalid { + if layer.DigestAlgorithm == ImageLayer_DigestAlgorithmInvalid { c.ChecksumAlgorithm = "" } else { c.ChecksumAlgorithm = strings.ToLower(layer.DigestAlgorithm.String()) @@ -143,9 +143,9 @@ func (layers ImageLayers) ToCachedDependencies() []*CachedDependency { func (d ImageLayer_DigestAlgorithm) Valid() bool { switch d { - case DigestAlgorithmSha256: + case ImageLayer_DigestAlgorithmSha256: return true - case DigestAlgorithmSha512: + case ImageLayer_DigestAlgorithmSha512: return true default: return false @@ -154,11 +154,11 @@ func (d ImageLayer_DigestAlgorithm) Valid() bool { func (m ImageLayer_MediaType) Valid() bool { switch m { - case MediaTypeTar: + case ImageLayer_MediaTypeTar: return true - case MediaTypeTgz: + case ImageLayer_MediaTypeTgz: return true - case MediaTypeZip: + case ImageLayer_MediaTypeZip: return true default: return false @@ -167,9 +167,9 @@ func (m ImageLayer_MediaType) Valid() bool { func (t ImageLayer_Type) Valid() bool { switch t { - case LayerTypeExclusive: + case ImageLayer_LayerTypeExclusive: return true - case LayerTypeShared: + case ImageLayer_LayerTypeShared: return true default: return false diff --git a/models/image_layer.pb.go b/models/image_layer.pb.go index 8dda5974..9355d1ed 100644 --- a/models/image_layer.pb.go +++ b/models/image_layer.pb.go @@ -1,788 +1,353 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: image_layer.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strconv "strconv" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -type ImageLayer_DigestAlgorithm int32 +type ProtoImageLayer_DigestAlgorithm int32 const ( - DigestAlgorithmInvalid ImageLayer_DigestAlgorithm = 0 - DigestAlgorithmSha256 ImageLayer_DigestAlgorithm = 1 - DigestAlgorithmSha512 ImageLayer_DigestAlgorithm = 2 // Deprecated: Do not use. + ProtoImageLayer_DigestAlgorithmInvalid ProtoImageLayer_DigestAlgorithm = 0 // not camel cased since it isn't supposed to be used by API users + ProtoImageLayer_SHA256 ProtoImageLayer_DigestAlgorithm = 1 + // Deprecated: Marked as deprecated in image_layer.proto. + ProtoImageLayer_SHA512 ProtoImageLayer_DigestAlgorithm = 2 ) -var ImageLayer_DigestAlgorithm_name = map[int32]string{ - 0: "DigestAlgorithmInvalid", - 1: "SHA256", - 2: "SHA512", -} +// Enum value maps for ProtoImageLayer_DigestAlgorithm. +var ( + ProtoImageLayer_DigestAlgorithm_name = map[int32]string{ + 0: "DigestAlgorithmInvalid", + 1: "SHA256", + 2: "SHA512", + } + ProtoImageLayer_DigestAlgorithm_value = map[string]int32{ + "DigestAlgorithmInvalid": 0, + "SHA256": 1, + "SHA512": 2, + } +) -var ImageLayer_DigestAlgorithm_value = map[string]int32{ - "DigestAlgorithmInvalid": 0, - "SHA256": 1, - "SHA512": 2, +func (x ProtoImageLayer_DigestAlgorithm) Enum() *ProtoImageLayer_DigestAlgorithm { + p := new(ProtoImageLayer_DigestAlgorithm) + *p = x + return p } -func (ImageLayer_DigestAlgorithm) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c089288d9f3c46a0, []int{0, 0} +func (x ProtoImageLayer_DigestAlgorithm) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -type ImageLayer_MediaType int32 - -const ( - MediaTypeInvalid ImageLayer_MediaType = 0 - MediaTypeTgz ImageLayer_MediaType = 1 - MediaTypeTar ImageLayer_MediaType = 2 - MediaTypeZip ImageLayer_MediaType = 3 -) +func (ProtoImageLayer_DigestAlgorithm) Descriptor() protoreflect.EnumDescriptor { + return file_image_layer_proto_enumTypes[0].Descriptor() +} -var ImageLayer_MediaType_name = map[int32]string{ - 0: "MediaTypeInvalid", - 1: "TGZ", - 2: "TAR", - 3: "ZIP", +func (ProtoImageLayer_DigestAlgorithm) Type() protoreflect.EnumType { + return &file_image_layer_proto_enumTypes[0] } -var ImageLayer_MediaType_value = map[string]int32{ - "MediaTypeInvalid": 0, - "TGZ": 1, - "TAR": 2, - "ZIP": 3, +func (x ProtoImageLayer_DigestAlgorithm) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (ImageLayer_MediaType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c089288d9f3c46a0, []int{0, 1} +// Deprecated: Use ProtoImageLayer_DigestAlgorithm.Descriptor instead. +func (ProtoImageLayer_DigestAlgorithm) EnumDescriptor() ([]byte, []int) { + return file_image_layer_proto_rawDescGZIP(), []int{0, 0} } -type ImageLayer_Type int32 +type ProtoImageLayer_MediaType int32 const ( - LayerTypeInvalid ImageLayer_Type = 0 - LayerTypeShared ImageLayer_Type = 1 - LayerTypeExclusive ImageLayer_Type = 2 + ProtoImageLayer_MediaTypeInvalid ProtoImageLayer_MediaType = 0 // not camel cased since it isn't supposed to be used by API users + ProtoImageLayer_TGZ ProtoImageLayer_MediaType = 1 + ProtoImageLayer_TAR ProtoImageLayer_MediaType = 2 + ProtoImageLayer_ZIP ProtoImageLayer_MediaType = 3 ) -var ImageLayer_Type_name = map[int32]string{ - 0: "LayerTypeInvalid", - 1: "SHARED", - 2: "EXCLUSIVE", -} +// Enum value maps for ProtoImageLayer_MediaType. +var ( + ProtoImageLayer_MediaType_name = map[int32]string{ + 0: "MediaTypeInvalid", + 1: "TGZ", + 2: "TAR", + 3: "ZIP", + } + ProtoImageLayer_MediaType_value = map[string]int32{ + "MediaTypeInvalid": 0, + "TGZ": 1, + "TAR": 2, + "ZIP": 3, + } +) -var ImageLayer_Type_value = map[string]int32{ - "LayerTypeInvalid": 0, - "SHARED": 1, - "EXCLUSIVE": 2, +func (x ProtoImageLayer_MediaType) Enum() *ProtoImageLayer_MediaType { + p := new(ProtoImageLayer_MediaType) + *p = x + return p } -func (ImageLayer_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c089288d9f3c46a0, []int{0, 2} +func (x ProtoImageLayer_MediaType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -type ImageLayer struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url"` - DestinationPath string `protobuf:"bytes,3,opt,name=destination_path,json=destinationPath,proto3" json:"destination_path"` - LayerType ImageLayer_Type `protobuf:"varint,4,opt,name=layer_type,json=layerType,proto3,enum=models.ImageLayer_Type" json:"layer_type"` - MediaType ImageLayer_MediaType `protobuf:"varint,5,opt,name=media_type,json=mediaType,proto3,enum=models.ImageLayer_MediaType" json:"media_type"` - DigestAlgorithm ImageLayer_DigestAlgorithm `protobuf:"varint,6,opt,name=digest_algorithm,json=digestAlgorithm,proto3,enum=models.ImageLayer_DigestAlgorithm" json:"digest_algorithm,omitempty"` - DigestValue string `protobuf:"bytes,7,opt,name=digest_value,json=digestValue,proto3" json:"digest_value,omitempty"` +func (ProtoImageLayer_MediaType) Descriptor() protoreflect.EnumDescriptor { + return file_image_layer_proto_enumTypes[1].Descriptor() } -func (m *ImageLayer) Reset() { *m = ImageLayer{} } -func (*ImageLayer) ProtoMessage() {} -func (*ImageLayer) Descriptor() ([]byte, []int) { - return fileDescriptor_c089288d9f3c46a0, []int{0} -} -func (m *ImageLayer) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ImageLayer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ImageLayer.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ImageLayer) XXX_Merge(src proto.Message) { - xxx_messageInfo_ImageLayer.Merge(m, src) +func (ProtoImageLayer_MediaType) Type() protoreflect.EnumType { + return &file_image_layer_proto_enumTypes[1] } -func (m *ImageLayer) XXX_Size() int { - return m.Size() + +func (x ProtoImageLayer_MediaType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *ImageLayer) XXX_DiscardUnknown() { - xxx_messageInfo_ImageLayer.DiscardUnknown(m) + +// Deprecated: Use ProtoImageLayer_MediaType.Descriptor instead. +func (ProtoImageLayer_MediaType) EnumDescriptor() ([]byte, []int) { + return file_image_layer_proto_rawDescGZIP(), []int{0, 1} } -var xxx_messageInfo_ImageLayer proto.InternalMessageInfo +type ProtoImageLayer_Type int32 -func (m *ImageLayer) GetName() string { - if m != nil { - return m.Name - } - return "" -} +const ( + ProtoImageLayer_LayerTypeInvalid ProtoImageLayer_Type = 0 // not camel cased since it isn't supposed to be used by API users + ProtoImageLayer_SHARED ProtoImageLayer_Type = 1 + ProtoImageLayer_EXCLUSIVE ProtoImageLayer_Type = 2 +) -func (m *ImageLayer) GetUrl() string { - if m != nil { - return m.Url +// Enum value maps for ProtoImageLayer_Type. +var ( + ProtoImageLayer_Type_name = map[int32]string{ + 0: "LayerTypeInvalid", + 1: "SHARED", + 2: "EXCLUSIVE", } - return "" + ProtoImageLayer_Type_value = map[string]int32{ + "LayerTypeInvalid": 0, + "SHARED": 1, + "EXCLUSIVE": 2, + } +) + +func (x ProtoImageLayer_Type) Enum() *ProtoImageLayer_Type { + p := new(ProtoImageLayer_Type) + *p = x + return p } -func (m *ImageLayer) GetDestinationPath() string { - if m != nil { - return m.DestinationPath - } - return "" +func (x ProtoImageLayer_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (m *ImageLayer) GetLayerType() ImageLayer_Type { - if m != nil { - return m.LayerType - } - return LayerTypeInvalid +func (ProtoImageLayer_Type) Descriptor() protoreflect.EnumDescriptor { + return file_image_layer_proto_enumTypes[2].Descriptor() } -func (m *ImageLayer) GetMediaType() ImageLayer_MediaType { - if m != nil { - return m.MediaType - } - return MediaTypeInvalid +func (ProtoImageLayer_Type) Type() protoreflect.EnumType { + return &file_image_layer_proto_enumTypes[2] } -func (m *ImageLayer) GetDigestAlgorithm() ImageLayer_DigestAlgorithm { - if m != nil { - return m.DigestAlgorithm - } - return DigestAlgorithmInvalid +func (x ProtoImageLayer_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *ImageLayer) GetDigestValue() string { - if m != nil { - return m.DigestValue - } - return "" +// Deprecated: Use ProtoImageLayer_Type.Descriptor instead. +func (ProtoImageLayer_Type) EnumDescriptor() ([]byte, []int) { + return file_image_layer_proto_rawDescGZIP(), []int{0, 2} } -func init() { - proto.RegisterEnum("models.ImageLayer_DigestAlgorithm", ImageLayer_DigestAlgorithm_name, ImageLayer_DigestAlgorithm_value) - proto.RegisterEnum("models.ImageLayer_MediaType", ImageLayer_MediaType_name, ImageLayer_MediaType_value) - proto.RegisterEnum("models.ImageLayer_Type", ImageLayer_Type_name, ImageLayer_Type_value) - proto.RegisterType((*ImageLayer)(nil), "models.ImageLayer") -} - -func init() { proto.RegisterFile("image_layer.proto", fileDescriptor_c089288d9f3c46a0) } - -var fileDescriptor_c089288d9f3c46a0 = []byte{ - // 533 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0x41, 0x6f, 0x12, 0x41, - 0x14, 0xc7, 0x77, 0xa0, 0xa5, 0xf2, 0x6c, 0xca, 0x38, 0xd6, 0xba, 0xac, 0x66, 0x58, 0x49, 0x1a, - 0x7b, 0x91, 0xa6, 0x28, 0xbd, 0x1a, 0xb0, 0xa8, 0x44, 0x9a, 0x34, 0x0b, 0x36, 0x86, 0x0b, 0x19, - 0xba, 0xe3, 0xee, 0x26, 0xbb, 0x2c, 0x59, 0x16, 0x22, 0x26, 0x26, 0x9e, 0x39, 0xf9, 0x05, 0xb8, - 0xfb, 0x51, 0x3c, 0x72, 0xec, 0xc1, 0x10, 0x59, 0x2e, 0x86, 0x53, 0x3f, 0x82, 0xd9, 0x41, 0xa0, - 0xae, 0x5c, 0x36, 0xef, 0xfd, 0xff, 0xbf, 0xf9, 0xbf, 0x99, 0xd9, 0x0c, 0xdc, 0xb3, 0x1c, 0x66, - 0xf0, 0xa6, 0xcd, 0x06, 0xdc, 0xcb, 0x75, 0x3c, 0xd7, 0x77, 0x49, 0xc2, 0x71, 0x75, 0x6e, 0x77, - 0x95, 0x67, 0x86, 0xe5, 0x9b, 0xbd, 0x56, 0xee, 0xca, 0x75, 0x8e, 0x0d, 0xd7, 0x70, 0x8f, 0x85, - 0xdd, 0xea, 0x7d, 0x14, 0x9d, 0x68, 0x44, 0xb5, 0x58, 0x96, 0xfd, 0xb9, 0x0d, 0x50, 0x09, 0xc3, - 0xaa, 0x61, 0x16, 0x21, 0xb0, 0xd5, 0x66, 0x0e, 0x97, 0x91, 0x8a, 0x8e, 0x92, 0x9a, 0xa8, 0x49, - 0x1a, 0xe2, 0x3d, 0xcf, 0x96, 0x63, 0xa1, 0x54, 0xda, 0x99, 0x4f, 0x32, 0x61, 0xab, 0x85, 0x1f, - 0xf2, 0x12, 0xb0, 0xce, 0xbb, 0xbe, 0xd5, 0x66, 0xbe, 0xe5, 0xb6, 0x9b, 0x1d, 0xe6, 0x9b, 0x72, - 0x5c, 0x70, 0xfb, 0xf3, 0x49, 0xe6, 0x3f, 0x4f, 0x4b, 0xdd, 0x52, 0x2e, 0x98, 0x6f, 0x92, 0xd7, - 0x00, 0xe2, 0x10, 0x4d, 0x7f, 0xd0, 0xe1, 0xf2, 0x96, 0x8a, 0x8e, 0xf6, 0xf2, 0x0f, 0x73, 0x8b, - 0xa3, 0xe4, 0xd6, 0xfb, 0xca, 0xd5, 0x07, 0x1d, 0x5e, 0xda, 0x9b, 0x4f, 0x32, 0xb7, 0x70, 0x2d, - 0x29, 0xea, 0xd0, 0x22, 0xef, 0x00, 0x1c, 0xae, 0x5b, 0x6c, 0x91, 0xb3, 0x2d, 0x72, 0x1e, 0x6f, - 0xc8, 0x39, 0x0f, 0xa1, 0x75, 0xd8, 0x7a, 0x8d, 0x96, 0x74, 0x96, 0x16, 0x39, 0x07, 0xac, 0x5b, - 0x06, 0xef, 0xfa, 0x4d, 0x66, 0x1b, 0xae, 0x67, 0xf9, 0xa6, 0x23, 0x27, 0x44, 0x64, 0x76, 0x43, - 0xe4, 0x99, 0x40, 0x8b, 0x4b, 0x52, 0x4b, 0xe9, 0xff, 0x0a, 0xe4, 0x09, 0xec, 0xfe, 0x8d, 0xeb, - 0x33, 0xbb, 0xc7, 0xe5, 0x1d, 0x71, 0xb7, 0x77, 0x17, 0xda, 0x65, 0x28, 0x65, 0xbf, 0x40, 0x2a, - 0x12, 0x43, 0x14, 0x38, 0x88, 0x48, 0x95, 0x76, 0x9f, 0xd9, 0x96, 0x8e, 0x25, 0x72, 0x08, 0x89, - 0xda, 0xdb, 0x62, 0xbe, 0x70, 0x8a, 0x91, 0x92, 0x1e, 0x8e, 0xd4, 0x07, 0x11, 0xb2, 0x66, 0xb2, - 0x7c, 0xe1, 0x94, 0x3c, 0x15, 0x58, 0xe1, 0x24, 0x8f, 0x63, 0xca, 0xa3, 0xcd, 0x58, 0xe1, 0x24, - 0x7f, 0x07, 0x65, 0x3d, 0x48, 0xae, 0x2e, 0x86, 0xec, 0x03, 0x5e, 0x35, 0xeb, 0x91, 0x69, 0x88, - 0xd7, 0xdf, 0x34, 0x30, 0x52, 0xf0, 0x70, 0xa4, 0xee, 0xae, 0x80, 0xba, 0xf1, 0x59, 0x58, 0x45, - 0x0d, 0xc7, 0xa2, 0x16, 0xf3, 0x42, 0xab, 0x51, 0xb9, 0xc0, 0xf1, 0x88, 0xd5, 0xb0, 0x3a, 0x59, - 0x1d, 0xb6, 0x96, 0xe3, 0xaa, 0xcb, 0xdf, 0xb8, 0x1e, 0x97, 0x11, 0x5b, 0xd7, 0xca, 0x67, 0x18, - 0x29, 0xf7, 0x87, 0x23, 0x35, 0xb5, 0x62, 0x6a, 0x26, 0xf3, 0xb8, 0x4e, 0x0e, 0x21, 0x59, 0xfe, - 0xf0, 0xaa, 0xfa, 0xbe, 0x56, 0xb9, 0x2c, 0xe3, 0x98, 0x72, 0x30, 0x1c, 0xa9, 0x64, 0xc5, 0x94, - 0x3f, 0x5d, 0xd9, 0xbd, 0xae, 0xd5, 0xe7, 0xa5, 0x17, 0xe3, 0x29, 0x95, 0xae, 0xa7, 0x54, 0xba, - 0x99, 0x52, 0xf4, 0x35, 0xa0, 0xe8, 0x7b, 0x40, 0xd1, 0x8f, 0x80, 0xa2, 0x71, 0x40, 0xd1, 0xaf, - 0x80, 0xa2, 0xdf, 0x01, 0x95, 0x6e, 0x02, 0x8a, 0xbe, 0xcd, 0xa8, 0x34, 0x9e, 0x51, 0xe9, 0x7a, - 0x46, 0xa5, 0x56, 0x42, 0xbc, 0x8d, 0xe7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x90, 0xc9, - 0x42, 0x67, 0x03, 0x00, 0x00, -} - -func (x ImageLayer_DigestAlgorithm) String() string { - s, ok := ImageLayer_DigestAlgorithm_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) +type ProtoImageLayer struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + DestinationPath string `protobuf:"bytes,3,opt,name=destination_path,proto3" json:"destination_path,omitempty"` + LayerType ProtoImageLayer_Type `protobuf:"varint,4,opt,name=layer_type,proto3,enum=models.ProtoImageLayer_Type" json:"layer_type,omitempty"` + MediaType ProtoImageLayer_MediaType `protobuf:"varint,5,opt,name=media_type,proto3,enum=models.ProtoImageLayer_MediaType" json:"media_type,omitempty"` + DigestAlgorithm ProtoImageLayer_DigestAlgorithm `protobuf:"varint,6,opt,name=digest_algorithm,proto3,enum=models.ProtoImageLayer_DigestAlgorithm" json:"digest_algorithm,omitempty"` + DigestValue string `protobuf:"bytes,7,opt,name=digest_value,proto3" json:"digest_value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (x ImageLayer_MediaType) String() string { - s, ok := ImageLayer_MediaType_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) + +func (x *ProtoImageLayer) Reset() { + *x = ProtoImageLayer{} + mi := &file_image_layer_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (x ImageLayer_Type) String() string { - s, ok := ImageLayer_Type_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) + +func (x *ProtoImageLayer) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *ImageLayer) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ImageLayer) - if !ok { - that2, ok := that.(ImageLayer) - if ok { - that1 = &that2 - } else { - return false +func (*ProtoImageLayer) ProtoMessage() {} + +func (x *ProtoImageLayer) ProtoReflect() protoreflect.Message { + mi := &file_image_layer_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Url != that1.Url { - return false - } - if this.DestinationPath != that1.DestinationPath { - return false - } - if this.LayerType != that1.LayerType { - return false - } - if this.MediaType != that1.MediaType { - return false - } - if this.DigestAlgorithm != that1.DigestAlgorithm { - return false - } - if this.DigestValue != that1.DigestValue { - return false - } - return true -} -func (this *ImageLayer) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&models.ImageLayer{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "Url: "+fmt.Sprintf("%#v", this.Url)+",\n") - s = append(s, "DestinationPath: "+fmt.Sprintf("%#v", this.DestinationPath)+",\n") - s = append(s, "LayerType: "+fmt.Sprintf("%#v", this.LayerType)+",\n") - s = append(s, "MediaType: "+fmt.Sprintf("%#v", this.MediaType)+",\n") - s = append(s, "DigestAlgorithm: "+fmt.Sprintf("%#v", this.DigestAlgorithm)+",\n") - s = append(s, "DigestValue: "+fmt.Sprintf("%#v", this.DigestValue)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringImageLayer(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *ImageLayer) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *ImageLayer) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoImageLayer.ProtoReflect.Descriptor instead. +func (*ProtoImageLayer) Descriptor() ([]byte, []int) { + return file_image_layer_proto_rawDescGZIP(), []int{0} } -func (m *ImageLayer) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DigestValue) > 0 { - i -= len(m.DigestValue) - copy(dAtA[i:], m.DigestValue) - i = encodeVarintImageLayer(dAtA, i, uint64(len(m.DigestValue))) - i-- - dAtA[i] = 0x3a - } - if m.DigestAlgorithm != 0 { - i = encodeVarintImageLayer(dAtA, i, uint64(m.DigestAlgorithm)) - i-- - dAtA[i] = 0x30 +func (x *ProtoImageLayer) GetName() string { + if x != nil { + return x.Name } - if m.MediaType != 0 { - i = encodeVarintImageLayer(dAtA, i, uint64(m.MediaType)) - i-- - dAtA[i] = 0x28 - } - if m.LayerType != 0 { - i = encodeVarintImageLayer(dAtA, i, uint64(m.LayerType)) - i-- - dAtA[i] = 0x20 - } - if len(m.DestinationPath) > 0 { - i -= len(m.DestinationPath) - copy(dAtA[i:], m.DestinationPath) - i = encodeVarintImageLayer(dAtA, i, uint64(len(m.DestinationPath))) - i-- - dAtA[i] = 0x1a - } - if len(m.Url) > 0 { - i -= len(m.Url) - copy(dAtA[i:], m.Url) - i = encodeVarintImageLayer(dAtA, i, uint64(len(m.Url))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintImageLayer(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return "" } -func encodeVarintImageLayer(dAtA []byte, offset int, v uint64) int { - offset -= sovImageLayer(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (x *ProtoImageLayer) GetUrl() string { + if x != nil { + return x.Url } - dAtA[offset] = uint8(v) - return base + return "" } -func (m *ImageLayer) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovImageLayer(uint64(l)) - } - l = len(m.Url) - if l > 0 { - n += 1 + l + sovImageLayer(uint64(l)) - } - l = len(m.DestinationPath) - if l > 0 { - n += 1 + l + sovImageLayer(uint64(l)) - } - if m.LayerType != 0 { - n += 1 + sovImageLayer(uint64(m.LayerType)) - } - if m.MediaType != 0 { - n += 1 + sovImageLayer(uint64(m.MediaType)) - } - if m.DigestAlgorithm != 0 { - n += 1 + sovImageLayer(uint64(m.DigestAlgorithm)) - } - l = len(m.DigestValue) - if l > 0 { - n += 1 + l + sovImageLayer(uint64(l)) + +func (x *ProtoImageLayer) GetDestinationPath() string { + if x != nil { + return x.DestinationPath } - return n + return "" } -func sovImageLayer(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozImageLayer(x uint64) (n int) { - return sovImageLayer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *ImageLayer) String() string { - if this == nil { - return "nil" +func (x *ProtoImageLayer) GetLayerType() ProtoImageLayer_Type { + if x != nil { + return x.LayerType } - s := strings.Join([]string{`&ImageLayer{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Url:` + fmt.Sprintf("%v", this.Url) + `,`, - `DestinationPath:` + fmt.Sprintf("%v", this.DestinationPath) + `,`, - `LayerType:` + fmt.Sprintf("%v", this.LayerType) + `,`, - `MediaType:` + fmt.Sprintf("%v", this.MediaType) + `,`, - `DigestAlgorithm:` + fmt.Sprintf("%v", this.DigestAlgorithm) + `,`, - `DigestValue:` + fmt.Sprintf("%v", this.DigestValue) + `,`, - `}`, - }, "") - return s -} -func valueToStringImageLayer(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *ImageLayer) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowImageLayer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ImageLayer: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ImageLayer: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowImageLayer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthImageLayer - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthImageLayer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowImageLayer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthImageLayer - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthImageLayer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Url = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowImageLayer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthImageLayer - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthImageLayer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DestinationPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LayerType", wireType) - } - m.LayerType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowImageLayer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LayerType |= ImageLayer_Type(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MediaType", wireType) - } - m.MediaType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowImageLayer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MediaType |= ImageLayer_MediaType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DigestAlgorithm", wireType) - } - m.DigestAlgorithm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowImageLayer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DigestAlgorithm |= ImageLayer_DigestAlgorithm(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DigestValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowImageLayer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthImageLayer - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthImageLayer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DigestValue = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipImageLayer(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthImageLayer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + return ProtoImageLayer_LayerTypeInvalid +} + +func (x *ProtoImageLayer) GetMediaType() ProtoImageLayer_MediaType { + if x != nil { + return x.MediaType } + return ProtoImageLayer_MediaTypeInvalid +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoImageLayer) GetDigestAlgorithm() ProtoImageLayer_DigestAlgorithm { + if x != nil { + return x.DigestAlgorithm } - return nil -} -func skipImageLayer(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowImageLayer - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowImageLayer - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowImageLayer - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthImageLayer - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupImageLayer - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthImageLayer - } - if depth == 0 { - return iNdEx, nil - } + return ProtoImageLayer_DigestAlgorithmInvalid +} + +func (x *ProtoImageLayer) GetDigestValue() string { + if x != nil { + return x.DigestValue } - return 0, io.ErrUnexpectedEOF + return "" } +var File_image_layer_proto protoreflect.FileDescriptor + +const file_image_layer_proto_rawDesc = "" + + "\n" + + "\x11image_layer.proto\x12\x06models\x1a\tbbs.proto\"\xc3\x05\n" + + "\x0fProtoImageLayer\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x15\n" + + "\x03url\x18\x02 \x01(\tB\x03\xc0>\x01R\x03url\x12/\n" + + "\x10destination_path\x18\x03 \x01(\tB\x03\xc0>\x01R\x10destination_path\x12A\n" + + "\n" + + "layer_type\x18\x04 \x01(\x0e2\x1c.models.ProtoImageLayer.TypeB\x03\xc0>\x01R\n" + + "layer_type\x12F\n" + + "\n" + + "media_type\x18\x05 \x01(\x0e2!.models.ProtoImageLayer.MediaTypeB\x03\xc0>\x01R\n" + + "media_type\x12S\n" + + "\x10digest_algorithm\x18\x06 \x01(\x0e2'.models.ProtoImageLayer.DigestAlgorithmR\x10digest_algorithm\x12\"\n" + + "\fdigest_value\x18\a \x01(\tR\fdigest_value\"{\n" + + "\x0fDigestAlgorithm\x12\x1a\n" + + "\x16DigestAlgorithmInvalid\x10\x00\x12$\n" + + "\x06SHA256\x10\x01\x1a\x18\x82}\x15DigestAlgorithmSha256\x12&\n" + + "\x06SHA512\x10\x02\x1a\x1a\x82}\x15DigestAlgorithmSha512\b\x01\"o\n" + + "\tMediaType\x12\x14\n" + + "\x10MediaTypeInvalid\x10\x00\x12\x18\n" + + "\x03TGZ\x10\x01\x1a\x0f\x82}\fMediaTypeTgz\x12\x18\n" + + "\x03TAR\x10\x02\x1a\x0f\x82}\fMediaTypeTar\x12\x18\n" + + "\x03ZIP\x10\x03\x1a\x0f\x82}\fMediaTypeZip\"b\n" + + "\x04Type\x12\x14\n" + + "\x10LayerTypeInvalid\x10\x00\x12\x1e\n" + + "\x06SHARED\x10\x01\x1a\x12\x82}\x0fLayerTypeShared\x12$\n" + + "\tEXCLUSIVE\x10\x02\x1a\x15\x82}\x12LayerTypeExclusiveB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" + var ( - ErrInvalidLengthImageLayer = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowImageLayer = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupImageLayer = fmt.Errorf("proto: unexpected end of group") + file_image_layer_proto_rawDescOnce sync.Once + file_image_layer_proto_rawDescData []byte ) + +func file_image_layer_proto_rawDescGZIP() []byte { + file_image_layer_proto_rawDescOnce.Do(func() { + file_image_layer_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_image_layer_proto_rawDesc), len(file_image_layer_proto_rawDesc))) + }) + return file_image_layer_proto_rawDescData +} + +var file_image_layer_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_image_layer_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_image_layer_proto_goTypes = []any{ + (ProtoImageLayer_DigestAlgorithm)(0), // 0: models.ProtoImageLayer.DigestAlgorithm + (ProtoImageLayer_MediaType)(0), // 1: models.ProtoImageLayer.MediaType + (ProtoImageLayer_Type)(0), // 2: models.ProtoImageLayer.Type + (*ProtoImageLayer)(nil), // 3: models.ProtoImageLayer +} +var file_image_layer_proto_depIdxs = []int32{ + 2, // 0: models.ProtoImageLayer.layer_type:type_name -> models.ProtoImageLayer.Type + 1, // 1: models.ProtoImageLayer.media_type:type_name -> models.ProtoImageLayer.MediaType + 0, // 2: models.ProtoImageLayer.digest_algorithm:type_name -> models.ProtoImageLayer.DigestAlgorithm + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_image_layer_proto_init() } +func file_image_layer_proto_init() { + if File_image_layer_proto != nil { + return + } + file_bbs_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_image_layer_proto_rawDesc), len(file_image_layer_proto_rawDesc)), + NumEnums: 3, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_image_layer_proto_goTypes, + DependencyIndexes: file_image_layer_proto_depIdxs, + EnumInfos: file_image_layer_proto_enumTypes, + MessageInfos: file_image_layer_proto_msgTypes, + }.Build() + File_image_layer_proto = out.File + file_image_layer_proto_goTypes = nil + file_image_layer_proto_depIdxs = nil +} diff --git a/models/image_layer.proto b/models/image_layer.proto index 07b64913..a0967253 100644 --- a/models/image_layer.proto +++ b/models/image_layer.proto @@ -1,34 +1,35 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; -message ImageLayer { +message ProtoImageLayer { enum DigestAlgorithm { DigestAlgorithmInvalid = 0; // not camel cased since it isn't supposed to be used by API users - SHA256 = 1 [(gogoproto.enumvalue_customname) = "DigestAlgorithmSha256"]; - SHA512 = 2 [(gogoproto.enumvalue_customname) = "DigestAlgorithmSha512", deprecated=true]; + SHA256 = 1 [(bbs.bbs_enumvalue_customname) = "DigestAlgorithmSha256"]; + SHA512 = 2 [(bbs.bbs_enumvalue_customname) = "DigestAlgorithmSha512", deprecated=true]; } enum MediaType { MediaTypeInvalid = 0; // not camel cased since it isn't supposed to be used by API users - TGZ = 1 [(gogoproto.enumvalue_customname) = "MediaTypeTgz"]; - TAR = 2 [(gogoproto.enumvalue_customname) = "MediaTypeTar"]; - ZIP = 3 [(gogoproto.enumvalue_customname) = "MediaTypeZip"]; + TGZ = 1 [(bbs.bbs_enumvalue_customname) = "MediaTypeTgz"]; + TAR = 2 [(bbs.bbs_enumvalue_customname) = "MediaTypeTar"]; + ZIP = 3 [(bbs.bbs_enumvalue_customname) = "MediaTypeZip"]; } enum Type { LayerTypeInvalid = 0; // not camel cased since it isn't supposed to be used by API users - SHARED = 1 [(gogoproto.enumvalue_customname) = "LayerTypeShared"]; - EXCLUSIVE = 2 [(gogoproto.enumvalue_customname) = "LayerTypeExclusive"]; + SHARED = 1 [(bbs.bbs_enumvalue_customname) = "LayerTypeShared"]; + EXCLUSIVE = 2 [(bbs.bbs_enumvalue_customname) = "LayerTypeExclusive"]; } string name = 1; - string url = 2 [(gogoproto.jsontag) = "url"]; - string destination_path = 3 [(gogoproto.jsontag) = "destination_path"]; - Type layer_type = 4 [(gogoproto.jsontag) = "layer_type"]; - MediaType media_type = 5 [(gogoproto.jsontag) = "media_type"]; - DigestAlgorithm digest_algorithm = 6; - string digest_value = 7; + string url = 2 [json_name = "url", (bbs.bbs_json_always_emit) = true]; + string destination_path = 3 [json_name = "destination_path", (bbs.bbs_json_always_emit) = true]; + Type layer_type = 4 [json_name = "layer_type", (bbs.bbs_json_always_emit) = true]; + MediaType media_type = 5 [json_name = "media_type", (bbs.bbs_json_always_emit) = true]; + DigestAlgorithm digest_algorithm = 6 [json_name = "digest_algorithm"]; + string digest_value = 7 [json_name = "digest_value"]; } diff --git a/models/image_layer_bbs.pb.go b/models/image_layer_bbs.pb.go new file mode 100644 index 00000000..e3c9e52b --- /dev/null +++ b/models/image_layer_bbs.pb.go @@ -0,0 +1,308 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: image_layer.proto + +package models + +import ( + strconv "strconv" +) + +type ImageLayer_DigestAlgorithm int32 + +const ( + ImageLayer_DigestAlgorithmInvalid ImageLayer_DigestAlgorithm = 0 + ImageLayer_DigestAlgorithmSha256 ImageLayer_DigestAlgorithm = 1 + // Deprecated: marked deprecated in proto file + ImageLayer_DigestAlgorithmSha512 ImageLayer_DigestAlgorithm = 2 +) + +// Enum value maps for ImageLayer_DigestAlgorithm +var ( + ImageLayer_DigestAlgorithm_name = map[int32]string{ + 0: "DigestAlgorithmInvalid", + 1: "SHA256", + 2: "SHA512", + } + ImageLayer_DigestAlgorithm_value = map[string]int32{ + "DigestAlgorithmInvalid": 0, + "SHA256": 1, + "SHA512": 2, + } +) + +func (m ImageLayer_DigestAlgorithm) String() string { + s, ok := ImageLayer_DigestAlgorithm_name[int32(m)] + if ok { + return s + } + return strconv.Itoa(int(m)) +} + +type ImageLayer_MediaType int32 + +const ( + ImageLayer_MediaTypeInvalid ImageLayer_MediaType = 0 + ImageLayer_MediaTypeTgz ImageLayer_MediaType = 1 + ImageLayer_MediaTypeTar ImageLayer_MediaType = 2 + ImageLayer_MediaTypeZip ImageLayer_MediaType = 3 +) + +// Enum value maps for ImageLayer_MediaType +var ( + ImageLayer_MediaType_name = map[int32]string{ + 0: "MediaTypeInvalid", + 1: "TGZ", + 2: "TAR", + 3: "ZIP", + } + ImageLayer_MediaType_value = map[string]int32{ + "MediaTypeInvalid": 0, + "TGZ": 1, + "TAR": 2, + "ZIP": 3, + } +) + +func (m ImageLayer_MediaType) String() string { + s, ok := ImageLayer_MediaType_name[int32(m)] + if ok { + return s + } + return strconv.Itoa(int(m)) +} + +type ImageLayer_Type int32 + +const ( + ImageLayer_LayerTypeInvalid ImageLayer_Type = 0 + ImageLayer_LayerTypeShared ImageLayer_Type = 1 + ImageLayer_LayerTypeExclusive ImageLayer_Type = 2 +) + +// Enum value maps for ImageLayer_Type +var ( + ImageLayer_Type_name = map[int32]string{ + 0: "LayerTypeInvalid", + 1: "SHARED", + 2: "EXCLUSIVE", + } + ImageLayer_Type_value = map[string]int32{ + "LayerTypeInvalid": 0, + "SHARED": 1, + "EXCLUSIVE": 2, + } +) + +func (m ImageLayer_Type) String() string { + s, ok := ImageLayer_Type_name[int32(m)] + if ok { + return s + } + return strconv.Itoa(int(m)) +} + +// Prevent copylock errors when using ProtoImageLayer directly +type ImageLayer struct { + Name string `json:"name,omitempty"` + Url string `json:"url"` + DestinationPath string `json:"destination_path"` + LayerType ImageLayer_Type `json:"layer_type"` + MediaType ImageLayer_MediaType `json:"media_type"` + DigestAlgorithm ImageLayer_DigestAlgorithm `json:"digest_algorithm,omitempty"` + DigestValue string `json:"digest_value,omitempty"` +} + +func (this *ImageLayer) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ImageLayer) + if !ok { + that2, ok := that.(ImageLayer) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Name != that1.Name { + return false + } + if this.Url != that1.Url { + return false + } + if this.DestinationPath != that1.DestinationPath { + return false + } + if this.LayerType != that1.LayerType { + return false + } + if this.MediaType != that1.MediaType { + return false + } + if this.DigestAlgorithm != that1.DigestAlgorithm { + return false + } + if this.DigestValue != that1.DigestValue { + return false + } + return true +} +func (m *ImageLayer) GetName() string { + if m != nil { + return m.Name + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ImageLayer) SetName(value string) { + if m != nil { + m.Name = value + } +} +func (m *ImageLayer) GetUrl() string { + if m != nil { + return m.Url + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ImageLayer) SetUrl(value string) { + if m != nil { + m.Url = value + } +} +func (m *ImageLayer) GetDestinationPath() string { + if m != nil { + return m.DestinationPath + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ImageLayer) SetDestinationPath(value string) { + if m != nil { + m.DestinationPath = value + } +} +func (m *ImageLayer) GetLayerType() ImageLayer_Type { + if m != nil { + return m.LayerType + } + var defaultValue ImageLayer_Type + defaultValue = 0 + return defaultValue +} +func (m *ImageLayer) SetLayerType(value ImageLayer_Type) { + if m != nil { + m.LayerType = value + } +} +func (m *ImageLayer) GetMediaType() ImageLayer_MediaType { + if m != nil { + return m.MediaType + } + var defaultValue ImageLayer_MediaType + defaultValue = 0 + return defaultValue +} +func (m *ImageLayer) SetMediaType(value ImageLayer_MediaType) { + if m != nil { + m.MediaType = value + } +} +func (m *ImageLayer) GetDigestAlgorithm() ImageLayer_DigestAlgorithm { + if m != nil { + return m.DigestAlgorithm + } + var defaultValue ImageLayer_DigestAlgorithm + defaultValue = 0 + return defaultValue +} +func (m *ImageLayer) SetDigestAlgorithm(value ImageLayer_DigestAlgorithm) { + if m != nil { + m.DigestAlgorithm = value + } +} +func (m *ImageLayer) GetDigestValue() string { + if m != nil { + return m.DigestValue + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ImageLayer) SetDigestValue(value string) { + if m != nil { + m.DigestValue = value + } +} +func (x *ImageLayer) ToProto() *ProtoImageLayer { + if x == nil { + return nil + } + + proto := &ProtoImageLayer{ + Name: x.Name, + Url: x.Url, + DestinationPath: x.DestinationPath, + LayerType: ProtoImageLayer_Type(x.LayerType), + MediaType: ProtoImageLayer_MediaType(x.MediaType), + DigestAlgorithm: ProtoImageLayer_DigestAlgorithm(x.DigestAlgorithm), + DigestValue: x.DigestValue, + } + return proto +} + +func (x *ProtoImageLayer) FromProto() *ImageLayer { + if x == nil { + return nil + } + + copysafe := &ImageLayer{ + Name: x.Name, + Url: x.Url, + DestinationPath: x.DestinationPath, + LayerType: ImageLayer_Type(x.LayerType), + MediaType: ImageLayer_MediaType(x.MediaType), + DigestAlgorithm: ImageLayer_DigestAlgorithm(x.DigestAlgorithm), + DigestValue: x.DigestValue, + } + return copysafe +} + +func ImageLayerToProtoSlice(values []*ImageLayer) []*ProtoImageLayer { + if values == nil { + return nil + } + result := make([]*ProtoImageLayer, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ImageLayerFromProtoSlice(values []*ProtoImageLayer) []*ImageLayer { + if values == nil { + return nil + } + result := make([]*ImageLayer, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/image_layer_test.go b/models/image_layer_test.go index a3f9803c..9add33c6 100644 --- a/models/image_layer_test.go +++ b/models/image_layer_test.go @@ -17,8 +17,8 @@ var _ = Describe("ImageLayer", func() { layer = &models.ImageLayer{ Url: "web_location", DestinationPath: "local_location", - MediaType: models.MediaTypeTgz, - LayerType: models.LayerTypeShared, + MediaType: models.ImageLayer_MediaTypeTgz, + LayerType: models.ImageLayer_LayerTypeShared, } err := layer.Validate() @@ -31,9 +31,9 @@ var _ = Describe("ImageLayer", func() { Url: "web_location", DestinationPath: "local_location", DigestValue: "some digest", - DigestAlgorithm: models.DigestAlgorithmSha256, - MediaType: models.MediaTypeTgz, - LayerType: models.LayerTypeExclusive, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, + MediaType: models.ImageLayer_MediaTypeTgz, + LayerType: models.ImageLayer_LayerTypeExclusive, } err := layer.Validate() @@ -70,8 +70,8 @@ var _ = Describe("ImageLayer", func() { &models.ImageLayer{ Url: "web_location", DestinationPath: "local_location", - DigestAlgorithm: models.DigestAlgorithmSha256, - MediaType: models.MediaTypeTgz, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, + MediaType: models.ImageLayer_MediaTypeTgz, }, }, { @@ -80,7 +80,7 @@ var _ = Describe("ImageLayer", func() { Url: "web_location", DestinationPath: "local_location", DigestValue: "some digest", - MediaType: models.MediaTypeTgz, + MediaType: models.ImageLayer_MediaTypeTgz, }, }, { @@ -88,8 +88,8 @@ var _ = Describe("ImageLayer", func() { &models.ImageLayer{ Url: "web_location", DestinationPath: "local_location", - MediaType: models.MediaTypeTgz, - LayerType: models.LayerTypeExclusive, + MediaType: models.ImageLayer_MediaTypeTgz, + LayerType: models.ImageLayer_LayerTypeExclusive, }, }, { @@ -97,8 +97,8 @@ var _ = Describe("ImageLayer", func() { &models.ImageLayer{ Url: "web_location", DestinationPath: "local_location", - MediaType: models.MediaTypeTgz, - LayerType: models.LayerTypeExclusive, + MediaType: models.ImageLayer_MediaTypeTgz, + LayerType: models.ImageLayer_LayerTypeExclusive, }, }, { @@ -108,7 +108,7 @@ var _ = Describe("ImageLayer", func() { DestinationPath: "local_location", DigestAlgorithm: models.ImageLayer_DigestAlgorithm(5), DigestValue: "some digest", - MediaType: models.MediaTypeTgz, + MediaType: models.ImageLayer_MediaTypeTgz, }, }, { @@ -116,7 +116,7 @@ var _ = Describe("ImageLayer", func() { &models.ImageLayer{ Url: "web_location", DestinationPath: "local_location", - DigestAlgorithm: models.DigestAlgorithmSha256, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, DigestValue: "some digest", }, }, @@ -125,7 +125,7 @@ var _ = Describe("ImageLayer", func() { &models.ImageLayer{ Url: "web_location", DestinationPath: "local_location", - DigestAlgorithm: models.DigestAlgorithmSha256, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, DigestValue: "some digest", MediaType: models.ImageLayer_MediaType(9), }, @@ -144,9 +144,9 @@ var _ = Describe("ImageLayer", func() { Expect(json.Unmarshal([]byte(expectedJSON), &testV)).To(Succeed()) Expect(testV).To(Equal(v)) }, - Entry("invalid", models.DigestAlgorithmInvalid, `"DigestAlgorithmInvalid"`), - Entry("sha256", models.DigestAlgorithmSha256, `"SHA256"`), - Entry("sha512", models.DigestAlgorithmSha512, `"SHA512"`), + Entry("invalid", models.ImageLayer_DigestAlgorithmInvalid, `"DigestAlgorithmInvalid"`), + Entry("sha256", models.ImageLayer_DigestAlgorithmSha256, `"SHA256"`), + Entry("sha512", models.ImageLayer_DigestAlgorithmSha512, `"SHA512"`), ) }) }) @@ -160,10 +160,10 @@ var _ = Describe("ImageLayer", func() { Expect(json.Unmarshal([]byte(expectedJSON), &testV)).To(Succeed()) Expect(testV).To(Equal(v)) }, - Entry("invalid", models.MediaTypeInvalid, `"MediaTypeInvalid"`), - Entry("tgz", models.MediaTypeTgz, `"TGZ"`), - Entry("tar", models.MediaTypeTar, `"TAR"`), - Entry("zip", models.MediaTypeZip, `"ZIP"`), + Entry("invalid", models.ImageLayer_MediaTypeInvalid, `"MediaTypeInvalid"`), + Entry("tgz", models.ImageLayer_MediaTypeTgz, `"TGZ"`), + Entry("tar", models.ImageLayer_MediaTypeTar, `"TAR"`), + Entry("zip", models.ImageLayer_MediaTypeZip, `"ZIP"`), ) }) }) @@ -177,9 +177,9 @@ var _ = Describe("ImageLayer", func() { Expect(json.Unmarshal([]byte(expectedJSON), &testV)).To(Succeed()) Expect(testV).To(Equal(v)) }, - Entry("invalid", models.LayerTypeInvalid, `"LayerTypeInvalid"`), - Entry("shared", models.LayerTypeShared, `"SHARED"`), - Entry("exclusive", models.LayerTypeExclusive, `"EXCLUSIVE"`), + Entry("invalid", models.ImageLayer_LayerTypeInvalid, `"LayerTypeInvalid"`), + Entry("shared", models.ImageLayer_LayerTypeShared, `"SHARED"`), + Entry("exclusive", models.ImageLayer_LayerTypeExclusive, `"EXCLUSIVE"`), ) }) }) diff --git a/models/log_rate_limit.pb.go b/models/log_rate_limit.pb.go index 0ccdf6db..fa721329 100644 --- a/models/log_rate_limit.pb.go +++ b/models/log_rate_limit.pb.go @@ -1,360 +1,122 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: log_rate_limit.proto package models import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type LogRateLimit struct { - BytesPerSecond int64 `protobuf:"varint,1,opt,name=bytes_per_second,json=bytesPerSecond,proto3" json:"bytes_per_second,omitempty"` -} +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -func (m *LogRateLimit) Reset() { *m = LogRateLimit{} } -func (*LogRateLimit) ProtoMessage() {} -func (*LogRateLimit) Descriptor() ([]byte, []int) { - return fileDescriptor_bfeb7b5141d983ba, []int{0} -} -func (m *LogRateLimit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LogRateLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LogRateLimit.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LogRateLimit) XXX_Merge(src proto.Message) { - xxx_messageInfo_LogRateLimit.Merge(m, src) -} -func (m *LogRateLimit) XXX_Size() int { - return m.Size() -} -func (m *LogRateLimit) XXX_DiscardUnknown() { - xxx_messageInfo_LogRateLimit.DiscardUnknown(m) +type ProtoLogRateLimit struct { + state protoimpl.MessageState `protogen:"open.v1"` + BytesPerSecond int64 `protobuf:"varint,1,opt,name=bytes_per_second,proto3" json:"bytes_per_second,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -var xxx_messageInfo_LogRateLimit proto.InternalMessageInfo - -func (m *LogRateLimit) GetBytesPerSecond() int64 { - if m != nil { - return m.BytesPerSecond - } - return 0 +func (x *ProtoLogRateLimit) Reset() { + *x = ProtoLogRateLimit{} + mi := &file_log_rate_limit_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func init() { - proto.RegisterType((*LogRateLimit)(nil), "models.LogRateLimit") +func (x *ProtoLogRateLimit) String() string { + return protoimpl.X.MessageStringOf(x) } -func init() { proto.RegisterFile("log_rate_limit.proto", fileDescriptor_bfeb7b5141d983ba) } +func (*ProtoLogRateLimit) ProtoMessage() {} -var fileDescriptor_bfeb7b5141d983ba = []byte{ - // 166 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc9, 0xc9, 0x4f, 0x8f, - 0x2f, 0x4a, 0x2c, 0x49, 0x8d, 0xcf, 0xc9, 0xcc, 0xcd, 0x2c, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, - 0x17, 0x62, 0xcb, 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0x56, 0xb2, 0xe0, 0xe2, 0xf1, 0xc9, 0x4f, 0x0f, - 0x4a, 0x2c, 0x49, 0xf5, 0x01, 0xc9, 0x0a, 0x69, 0x70, 0x09, 0x24, 0x55, 0x96, 0xa4, 0x16, 0xc7, - 0x17, 0xa4, 0x16, 0xc5, 0x17, 0xa7, 0x26, 0xe7, 0xe7, 0xa5, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x30, - 0x07, 0xf1, 0x81, 0xc5, 0x03, 0x52, 0x8b, 0x82, 0xc1, 0xa2, 0x4e, 0x26, 0x17, 0x1e, 0xca, 0x31, - 0xdc, 0x78, 0x28, 0xc7, 0xf0, 0xe1, 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x15, 0x8f, 0xe4, - 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x17, 0x8f, - 0xe4, 0x18, 0x3e, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, - 0x8f, 0xe5, 0x18, 0x92, 0xd8, 0xc0, 0xd6, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xba, 0xbc, - 0x7d, 0xdf, 0x96, 0x00, 0x00, 0x00, -} - -func (this *LogRateLimit) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LogRateLimit) - if !ok { - that2, ok := that.(LogRateLimit) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoLogRateLimit) ProtoReflect() protoreflect.Message { + mi := &file_log_rate_limit_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.BytesPerSecond != that1.BytesPerSecond { - return false - } - return true -} -func (this *LogRateLimit) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.LogRateLimit{") - s = append(s, "BytesPerSecond: "+fmt.Sprintf("%#v", this.BytesPerSecond)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringLogRateLimit(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *LogRateLimit) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LogRateLimit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return mi.MessageOf(x) } -func (m *LogRateLimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.BytesPerSecond != 0 { - i = encodeVarintLogRateLimit(dAtA, i, uint64(m.BytesPerSecond)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil +// Deprecated: Use ProtoLogRateLimit.ProtoReflect.Descriptor instead. +func (*ProtoLogRateLimit) Descriptor() ([]byte, []int) { + return file_log_rate_limit_proto_rawDescGZIP(), []int{0} } -func encodeVarintLogRateLimit(dAtA []byte, offset int, v uint64) int { - offset -= sovLogRateLimit(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *LogRateLimit) Size() (n int) { - if m == nil { - return 0 +func (x *ProtoLogRateLimit) GetBytesPerSecond() int64 { + if x != nil { + return x.BytesPerSecond } - var l int - _ = l - if m.BytesPerSecond != 0 { - n += 1 + sovLogRateLimit(uint64(m.BytesPerSecond)) - } - return n + return 0 } -func sovLogRateLimit(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozLogRateLimit(x uint64) (n int) { - return sovLogRateLimit(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *LogRateLimit) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LogRateLimit{`, - `BytesPerSecond:` + fmt.Sprintf("%v", this.BytesPerSecond) + `,`, - `}`, - }, "") - return s -} -func valueToStringLogRateLimit(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *LogRateLimit) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogRateLimit - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LogRateLimit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LogRateLimit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BytesPerSecond", wireType) - } - m.BytesPerSecond = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogRateLimit - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BytesPerSecond |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipLogRateLimit(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogRateLimit - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var File_log_rate_limit_proto protoreflect.FileDescriptor - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipLogRateLimit(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLogRateLimit - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLogRateLimit - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLogRateLimit - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthLogRateLimit - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupLogRateLimit - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthLogRateLimit - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +const file_log_rate_limit_proto_rawDesc = "" + + "\n" + + "\x14log_rate_limit.proto\x12\x06models\"?\n" + + "\x11ProtoLogRateLimit\x12*\n" + + "\x10bytes_per_second\x18\x01 \x01(\x03R\x10bytes_per_secondB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthLogRateLimit = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowLogRateLimit = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupLogRateLimit = fmt.Errorf("proto: unexpected end of group") + file_log_rate_limit_proto_rawDescOnce sync.Once + file_log_rate_limit_proto_rawDescData []byte ) + +func file_log_rate_limit_proto_rawDescGZIP() []byte { + file_log_rate_limit_proto_rawDescOnce.Do(func() { + file_log_rate_limit_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_log_rate_limit_proto_rawDesc), len(file_log_rate_limit_proto_rawDesc))) + }) + return file_log_rate_limit_proto_rawDescData +} + +var file_log_rate_limit_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_log_rate_limit_proto_goTypes = []any{ + (*ProtoLogRateLimit)(nil), // 0: models.ProtoLogRateLimit +} +var file_log_rate_limit_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_log_rate_limit_proto_init() } +func file_log_rate_limit_proto_init() { + if File_log_rate_limit_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_log_rate_limit_proto_rawDesc), len(file_log_rate_limit_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_log_rate_limit_proto_goTypes, + DependencyIndexes: file_log_rate_limit_proto_depIdxs, + MessageInfos: file_log_rate_limit_proto_msgTypes, + }.Build() + File_log_rate_limit_proto = out.File + file_log_rate_limit_proto_goTypes = nil + file_log_rate_limit_proto_depIdxs = nil +} diff --git a/models/log_rate_limit.proto b/models/log_rate_limit.proto index 7248103b..1167f1f1 100644 --- a/models/log_rate_limit.proto +++ b/models/log_rate_limit.proto @@ -1,7 +1,8 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -message LogRateLimit { - int64 bytes_per_second = 1; +message ProtoLogRateLimit { + int64 bytes_per_second = 1 [json_name = "bytes_per_second"]; } diff --git a/models/log_rate_limit_bbs.pb.go b/models/log_rate_limit_bbs.pb.go new file mode 100644 index 00000000..8c989c28 --- /dev/null +++ b/models/log_rate_limit_bbs.pb.go @@ -0,0 +1,96 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: log_rate_limit.proto + +package models + +// Prevent copylock errors when using ProtoLogRateLimit directly +type LogRateLimit struct { + BytesPerSecond int64 `json:"bytes_per_second,omitempty"` +} + +func (this *LogRateLimit) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*LogRateLimit) + if !ok { + that2, ok := that.(LogRateLimit) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.BytesPerSecond != that1.BytesPerSecond { + return false + } + return true +} +func (m *LogRateLimit) GetBytesPerSecond() int64 { + if m != nil { + return m.BytesPerSecond + } + var defaultValue int64 + defaultValue = 0 + return defaultValue +} +func (m *LogRateLimit) SetBytesPerSecond(value int64) { + if m != nil { + m.BytesPerSecond = value + } +} +func (x *LogRateLimit) ToProto() *ProtoLogRateLimit { + if x == nil { + return nil + } + + proto := &ProtoLogRateLimit{ + BytesPerSecond: x.BytesPerSecond, + } + return proto +} + +func (x *ProtoLogRateLimit) FromProto() *LogRateLimit { + if x == nil { + return nil + } + + copysafe := &LogRateLimit{ + BytesPerSecond: x.BytesPerSecond, + } + return copysafe +} + +func LogRateLimitToProtoSlice(values []*LogRateLimit) []*ProtoLogRateLimit { + if values == nil { + return nil + } + result := make([]*ProtoLogRateLimit, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func LogRateLimitFromProtoSlice(values []*ProtoLogRateLimit) []*LogRateLimit { + if values == nil { + return nil + } + result := make([]*LogRateLimit, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/metric_tags.go b/models/metric_tags.go index 2c1e246b..937a41d2 100644 --- a/models/metric_tags.go +++ b/models/metric_tags.go @@ -28,9 +28,9 @@ func (m *MetricTagValue) Validate() error { func (v MetricTagValue_DynamicValue) Valid() bool { switch v { - case MetricTagDynamicValueIndex: + case MetricTagValue_MetricTagDynamicValueIndex: return true - case MetricTagDynamicValueInstanceGuid: + case MetricTagValue_MetricTagDynamicValueInstanceGuid: return true default: return false @@ -42,16 +42,16 @@ func ConvertMetricTags(metricTags map[string]*MetricTagValue, info map[MetricTag for k, v := range metricTags { if v.Dynamic > 0 { switch v.Dynamic { - case MetricTagDynamicValueIndex: - val, ok := info[MetricTagDynamicValueIndex].(int32) + case MetricTagValue_MetricTagDynamicValueIndex: + val, ok := info[MetricTagValue_MetricTagDynamicValueIndex].(int32) if !ok { - return nil, fmt.Errorf("could not convert value %+v of type %T to int32", info[MetricTagDynamicValueIndex], info[MetricTagDynamicValueIndex]) + return nil, fmt.Errorf("could not convert value %+v of type %T to int32", info[MetricTagValue_MetricTagDynamicValueIndex], info[MetricTagValue_MetricTagDynamicValueIndex]) } tags[k] = strconv.FormatInt(int64(val), 10) - case MetricTagDynamicValueInstanceGuid: - val, ok := info[MetricTagDynamicValueInstanceGuid].(string) + case MetricTagValue_MetricTagDynamicValueInstanceGuid: + val, ok := info[MetricTagValue_MetricTagDynamicValueInstanceGuid].(string) if !ok { - return nil, fmt.Errorf("could not convert value %+v of type %T to string", info[MetricTagDynamicValueInstanceGuid], info[MetricTagDynamicValueInstanceGuid]) + return nil, fmt.Errorf("could not convert value %+v of type %T to string", info[MetricTagValue_MetricTagDynamicValueInstanceGuid], info[MetricTagValue_MetricTagDynamicValueInstanceGuid]) } tags[k] = val } diff --git a/models/metric_tags.pb.go b/models/metric_tags.pb.go index 1ab472f0..859ccdbd 100644 --- a/models/metric_tags.pb.go +++ b/models/metric_tags.pb.go @@ -1,460 +1,191 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: metric_tags.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strconv "strconv" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -type MetricTagValue_DynamicValue int32 +type ProtoMetricTagValue_DynamicValue int32 const ( - DynamicValueInvalid MetricTagValue_DynamicValue = 0 - MetricTagDynamicValueIndex MetricTagValue_DynamicValue = 1 - MetricTagDynamicValueInstanceGuid MetricTagValue_DynamicValue = 2 + ProtoMetricTagValue_DynamicValueInvalid ProtoMetricTagValue_DynamicValue = 0 + ProtoMetricTagValue_INDEX ProtoMetricTagValue_DynamicValue = 1 + ProtoMetricTagValue_INSTANCE_GUID ProtoMetricTagValue_DynamicValue = 2 ) -var MetricTagValue_DynamicValue_name = map[int32]string{ - 0: "DynamicValueInvalid", - 1: "INDEX", - 2: "INSTANCE_GUID", -} +// Enum value maps for ProtoMetricTagValue_DynamicValue. +var ( + ProtoMetricTagValue_DynamicValue_name = map[int32]string{ + 0: "DynamicValueInvalid", + 1: "INDEX", + 2: "INSTANCE_GUID", + } + ProtoMetricTagValue_DynamicValue_value = map[string]int32{ + "DynamicValueInvalid": 0, + "INDEX": 1, + "INSTANCE_GUID": 2, + } +) -var MetricTagValue_DynamicValue_value = map[string]int32{ - "DynamicValueInvalid": 0, - "INDEX": 1, - "INSTANCE_GUID": 2, +func (x ProtoMetricTagValue_DynamicValue) Enum() *ProtoMetricTagValue_DynamicValue { + p := new(ProtoMetricTagValue_DynamicValue) + *p = x + return p } -func (MetricTagValue_DynamicValue) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_6fa2ee0541447d5e, []int{0, 0} +func (x ProtoMetricTagValue_DynamicValue) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -type MetricTagValue struct { - // Note: we only expect one of the following set of fields to be - // set. - Static string `protobuf:"bytes,1,opt,name=static,proto3" json:"static,omitempty"` - Dynamic MetricTagValue_DynamicValue `protobuf:"varint,2,opt,name=dynamic,proto3,enum=models.MetricTagValue_DynamicValue" json:"dynamic,omitempty"` +func (ProtoMetricTagValue_DynamicValue) Descriptor() protoreflect.EnumDescriptor { + return file_metric_tags_proto_enumTypes[0].Descriptor() } -func (m *MetricTagValue) Reset() { *m = MetricTagValue{} } -func (*MetricTagValue) ProtoMessage() {} -func (*MetricTagValue) Descriptor() ([]byte, []int) { - return fileDescriptor_6fa2ee0541447d5e, []int{0} -} -func (m *MetricTagValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MetricTagValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MetricTagValue.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MetricTagValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricTagValue.Merge(m, src) -} -func (m *MetricTagValue) XXX_Size() int { - return m.Size() +func (ProtoMetricTagValue_DynamicValue) Type() protoreflect.EnumType { + return &file_metric_tags_proto_enumTypes[0] } -func (m *MetricTagValue) XXX_DiscardUnknown() { - xxx_messageInfo_MetricTagValue.DiscardUnknown(m) -} - -var xxx_messageInfo_MetricTagValue proto.InternalMessageInfo -func (m *MetricTagValue) GetStatic() string { - if m != nil { - return m.Static - } - return "" +func (x ProtoMetricTagValue_DynamicValue) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *MetricTagValue) GetDynamic() MetricTagValue_DynamicValue { - if m != nil { - return m.Dynamic - } - return DynamicValueInvalid +// Deprecated: Use ProtoMetricTagValue_DynamicValue.Descriptor instead. +func (ProtoMetricTagValue_DynamicValue) EnumDescriptor() ([]byte, []int) { + return file_metric_tags_proto_rawDescGZIP(), []int{0, 0} } -func init() { - proto.RegisterEnum("models.MetricTagValue_DynamicValue", MetricTagValue_DynamicValue_name, MetricTagValue_DynamicValue_value) - proto.RegisterType((*MetricTagValue)(nil), "models.MetricTagValue") +type ProtoMetricTagValue struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Note: we only expect one of the following set of fields to be + // set. + Static string `protobuf:"bytes,1,opt,name=static,proto3" json:"static,omitempty"` + Dynamic ProtoMetricTagValue_DynamicValue `protobuf:"varint,2,opt,name=dynamic,proto3,enum=models.ProtoMetricTagValue_DynamicValue" json:"dynamic,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { proto.RegisterFile("metric_tags.proto", fileDescriptor_6fa2ee0541447d5e) } - -var fileDescriptor_6fa2ee0541447d5e = []byte{ - // 296 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcc, 0x4d, 0x2d, 0x29, - 0xca, 0x4c, 0x8e, 0x2f, 0x49, 0x4c, 0x2f, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xcb, - 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0x96, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, - 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0x4b, 0x27, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, - 0x98, 0x05, 0xd1, 0xa6, 0xf4, 0x8d, 0x91, 0x8b, 0xcf, 0x17, 0x6c, 0x58, 0x48, 0x62, 0x7a, 0x58, - 0x62, 0x4e, 0x69, 0xaa, 0x90, 0x18, 0x17, 0x5b, 0x71, 0x49, 0x62, 0x49, 0x66, 0xb2, 0x04, 0xa3, - 0x02, 0xa3, 0x06, 0x67, 0x10, 0x94, 0x27, 0x64, 0xcb, 0xc5, 0x9e, 0x52, 0x99, 0x97, 0x98, 0x9b, - 0x99, 0x2c, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x67, 0xa4, 0xac, 0x07, 0xb1, 0x53, 0x0f, 0xd5, 0x00, - 0x3d, 0x17, 0x88, 0x2a, 0x30, 0x27, 0x08, 0xa6, 0x47, 0xa9, 0x87, 0x91, 0x8b, 0x07, 0x59, 0x46, - 0x48, 0x9c, 0x4b, 0x18, 0x99, 0xef, 0x99, 0x57, 0x96, 0x98, 0x93, 0x99, 0x22, 0xc0, 0x20, 0xa4, - 0xc9, 0xc5, 0xea, 0xe9, 0xe7, 0xe2, 0x1a, 0x21, 0xc0, 0x28, 0x25, 0xd7, 0x35, 0x57, 0x41, 0x0a, - 0x6e, 0x3c, 0xaa, 0xf2, 0x94, 0xd4, 0x0a, 0x21, 0x0b, 0x2e, 0x5e, 0x4f, 0xbf, 0xe0, 0x10, 0x47, - 0x3f, 0x67, 0xd7, 0x78, 0xf7, 0x50, 0x4f, 0x17, 0x01, 0x26, 0x29, 0xd5, 0xae, 0xb9, 0x0a, 0x8a, - 0x38, 0xb4, 0x14, 0x97, 0x24, 0xe6, 0x25, 0xa7, 0xba, 0x97, 0x66, 0xa6, 0x38, 0x99, 0x5c, 0x78, - 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 0xc3, 0x87, 0x87, 0x72, 0x8c, 0x0d, 0x8f, 0xe4, 0x18, 0x57, - 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, - 0x5f, 0x3c, 0x92, 0x63, 0xf8, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, - 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x48, 0x62, 0x03, 0x87, 0x9a, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, - 0x9b, 0x83, 0x77, 0xc8, 0x81, 0x01, 0x00, 0x00, +func (x *ProtoMetricTagValue) Reset() { + *x = ProtoMetricTagValue{} + mi := &file_metric_tags_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (x MetricTagValue_DynamicValue) String() string { - s, ok := MetricTagValue_DynamicValue_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) +func (x *ProtoMetricTagValue) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *MetricTagValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*MetricTagValue) - if !ok { - that2, ok := that.(MetricTagValue) - if ok { - that1 = &that2 - } else { - return false +func (*ProtoMetricTagValue) ProtoMessage() {} + +func (x *ProtoMetricTagValue) ProtoReflect() protoreflect.Message { + mi := &file_metric_tags_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Static != that1.Static { - return false - } - if this.Dynamic != that1.Dynamic { - return false - } - return true -} -func (this *MetricTagValue) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.MetricTagValue{") - s = append(s, "Static: "+fmt.Sprintf("%#v", this.Static)+",\n") - s = append(s, "Dynamic: "+fmt.Sprintf("%#v", this.Dynamic)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringMetricTags(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *MetricTagValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *MetricTagValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoMetricTagValue.ProtoReflect.Descriptor instead. +func (*ProtoMetricTagValue) Descriptor() ([]byte, []int) { + return file_metric_tags_proto_rawDescGZIP(), []int{0} } -func (m *MetricTagValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Dynamic != 0 { - i = encodeVarintMetricTags(dAtA, i, uint64(m.Dynamic)) - i-- - dAtA[i] = 0x10 +func (x *ProtoMetricTagValue) GetStatic() string { + if x != nil { + return x.Static } - if len(m.Static) > 0 { - i -= len(m.Static) - copy(dAtA[i:], m.Static) - i = encodeVarintMetricTags(dAtA, i, uint64(len(m.Static))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return "" } -func encodeVarintMetricTags(dAtA []byte, offset int, v uint64) int { - offset -= sovMetricTags(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MetricTagValue) Size() (n int) { - if m == nil { - return 0 +func (x *ProtoMetricTagValue) GetDynamic() ProtoMetricTagValue_DynamicValue { + if x != nil { + return x.Dynamic } - var l int - _ = l - l = len(m.Static) - if l > 0 { - n += 1 + l + sovMetricTags(uint64(l)) - } - if m.Dynamic != 0 { - n += 1 + sovMetricTags(uint64(m.Dynamic)) - } - return n + return ProtoMetricTagValue_DynamicValueInvalid } -func sovMetricTags(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozMetricTags(x uint64) (n int) { - return sovMetricTags(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *MetricTagValue) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&MetricTagValue{`, - `Static:` + fmt.Sprintf("%v", this.Static) + `,`, - `Dynamic:` + fmt.Sprintf("%v", this.Dynamic) + `,`, - `}`, - }, "") - return s -} -func valueToStringMetricTags(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *MetricTagValue) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricTags - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MetricTagValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricTagValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Static", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricTags - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMetricTags - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMetricTags - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Static = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Dynamic", wireType) - } - m.Dynamic = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricTags - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Dynamic |= MetricTagValue_DynamicValue(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipMetricTags(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetricTags - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var File_metric_tags_proto protoreflect.FileDescriptor - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipMetricTags(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMetricTags - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMetricTags - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMetricTags - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthMetricTags - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupMetricTags - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthMetricTags - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +const file_metric_tags_proto_rawDesc = "" + + "\n" + + "\x11metric_tags.proto\x12\x06models\x1a\tbbs.proto\"\xfe\x01\n" + + "\x13ProtoMetricTagValue\x12\x16\n" + + "\x06static\x18\x01 \x01(\tR\x06static\x12B\n" + + "\adynamic\x18\x02 \x01(\x0e2(.models.ProtoMetricTagValue.DynamicValueR\adynamic\"\x8a\x01\n" + + "\fDynamicValue\x12\x17\n" + + "\x13DynamicValueInvalid\x10\x00\x12(\n" + + "\x05INDEX\x10\x01\x1a\x1d\x82}\x1aMetricTagDynamicValueIndex\x127\n" + + "\rINSTANCE_GUID\x10\x02\x1a$\x82}!MetricTagDynamicValueInstanceGuidB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthMetricTags = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMetricTags = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupMetricTags = fmt.Errorf("proto: unexpected end of group") + file_metric_tags_proto_rawDescOnce sync.Once + file_metric_tags_proto_rawDescData []byte ) + +func file_metric_tags_proto_rawDescGZIP() []byte { + file_metric_tags_proto_rawDescOnce.Do(func() { + file_metric_tags_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_metric_tags_proto_rawDesc), len(file_metric_tags_proto_rawDesc))) + }) + return file_metric_tags_proto_rawDescData +} + +var file_metric_tags_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_metric_tags_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_metric_tags_proto_goTypes = []any{ + (ProtoMetricTagValue_DynamicValue)(0), // 0: models.ProtoMetricTagValue.DynamicValue + (*ProtoMetricTagValue)(nil), // 1: models.ProtoMetricTagValue +} +var file_metric_tags_proto_depIdxs = []int32{ + 0, // 0: models.ProtoMetricTagValue.dynamic:type_name -> models.ProtoMetricTagValue.DynamicValue + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_metric_tags_proto_init() } +func file_metric_tags_proto_init() { + if File_metric_tags_proto != nil { + return + } + file_bbs_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_metric_tags_proto_rawDesc), len(file_metric_tags_proto_rawDesc)), + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_metric_tags_proto_goTypes, + DependencyIndexes: file_metric_tags_proto_depIdxs, + EnumInfos: file_metric_tags_proto_enumTypes, + MessageInfos: file_metric_tags_proto_msgTypes, + }.Build() + File_metric_tags_proto = out.File + file_metric_tags_proto_goTypes = nil + file_metric_tags_proto_depIdxs = nil +} diff --git a/models/metric_tags.proto b/models/metric_tags.proto index 18293e0f..870565e2 100644 --- a/models/metric_tags.proto +++ b/models/metric_tags.proto @@ -1,18 +1,19 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; -message MetricTagValue { +message ProtoMetricTagValue { enum DynamicValue { DynamicValueInvalid = 0; - INDEX = 1 [(gogoproto.enumvalue_customname) = "MetricTagDynamicValueIndex"]; - INSTANCE_GUID = 2 [(gogoproto.enumvalue_customname) = "MetricTagDynamicValueInstanceGuid"]; + INDEX = 1 [(bbs.bbs_enumvalue_customname) = "MetricTagDynamicValueIndex"]; + INSTANCE_GUID = 2 [(bbs.bbs_enumvalue_customname) = "MetricTagDynamicValueInstanceGuid"]; } // Note: we only expect one of the following set of fields to be // set. - string static = 1; - DynamicValue dynamic = 2; + string static = 1 [json_name = "static"]; + DynamicValue dynamic = 2 [json_name = "dynamic"]; } diff --git a/models/metric_tags_bbs.pb.go b/models/metric_tags_bbs.pb.go new file mode 100644 index 00000000..bbe5d3e5 --- /dev/null +++ b/models/metric_tags_bbs.pb.go @@ -0,0 +1,149 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: metric_tags.proto + +package models + +import ( + strconv "strconv" +) + +type MetricTagValue_DynamicValue int32 + +const ( + MetricTagValue_DynamicValueInvalid MetricTagValue_DynamicValue = 0 + MetricTagValue_MetricTagDynamicValueIndex MetricTagValue_DynamicValue = 1 + MetricTagValue_MetricTagDynamicValueInstanceGuid MetricTagValue_DynamicValue = 2 +) + +// Enum value maps for MetricTagValue_DynamicValue +var ( + MetricTagValue_DynamicValue_name = map[int32]string{ + 0: "DynamicValueInvalid", + 1: "INDEX", + 2: "INSTANCE_GUID", + } + MetricTagValue_DynamicValue_value = map[string]int32{ + "DynamicValueInvalid": 0, + "INDEX": 1, + "INSTANCE_GUID": 2, + } +) + +func (m MetricTagValue_DynamicValue) String() string { + s, ok := MetricTagValue_DynamicValue_name[int32(m)] + if ok { + return s + } + return strconv.Itoa(int(m)) +} + +// Prevent copylock errors when using ProtoMetricTagValue directly +type MetricTagValue struct { + Static string `json:"static,omitempty"` + Dynamic MetricTagValue_DynamicValue `json:"dynamic,omitempty"` +} + +func (this *MetricTagValue) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*MetricTagValue) + if !ok { + that2, ok := that.(MetricTagValue) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Static != that1.Static { + return false + } + if this.Dynamic != that1.Dynamic { + return false + } + return true +} +func (m *MetricTagValue) GetStatic() string { + if m != nil { + return m.Static + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *MetricTagValue) SetStatic(value string) { + if m != nil { + m.Static = value + } +} +func (m *MetricTagValue) GetDynamic() MetricTagValue_DynamicValue { + if m != nil { + return m.Dynamic + } + var defaultValue MetricTagValue_DynamicValue + defaultValue = 0 + return defaultValue +} +func (m *MetricTagValue) SetDynamic(value MetricTagValue_DynamicValue) { + if m != nil { + m.Dynamic = value + } +} +func (x *MetricTagValue) ToProto() *ProtoMetricTagValue { + if x == nil { + return nil + } + + proto := &ProtoMetricTagValue{ + Static: x.Static, + Dynamic: ProtoMetricTagValue_DynamicValue(x.Dynamic), + } + return proto +} + +func (x *ProtoMetricTagValue) FromProto() *MetricTagValue { + if x == nil { + return nil + } + + copysafe := &MetricTagValue{ + Static: x.Static, + Dynamic: MetricTagValue_DynamicValue(x.Dynamic), + } + return copysafe +} + +func MetricTagValueToProtoSlice(values []*MetricTagValue) []*ProtoMetricTagValue { + if values == nil { + return nil + } + result := make([]*ProtoMetricTagValue, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func MetricTagValueFromProtoSlice(values []*ProtoMetricTagValue) []*MetricTagValue { + if values == nil { + return nil + } + result := make([]*MetricTagValue, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/metric_tags_test.go b/models/metric_tags_test.go index a4227497..559294c6 100644 --- a/models/metric_tags_test.go +++ b/models/metric_tags_test.go @@ -19,7 +19,7 @@ var _ = Describe("MetricTagValue", func() { It("is valid when there is only a dynamic value specified", func() { value := &models.MetricTagValue{ - Dynamic: models.MetricTagDynamicValueIndex, + Dynamic: models.MetricTagValue_MetricTagDynamicValueIndex, } Expect(value.Validate()).To(Succeed()) }) @@ -34,7 +34,7 @@ var _ = Describe("MetricTagValue", func() { It("is not valid when both static and dynamic values are specified", func() { value := &models.MetricTagValue{ Static: "some-value", - Dynamic: models.MetricTagDynamicValueIndex, + Dynamic: models.MetricTagValue_MetricTagDynamicValueIndex, } err := value.Validate() Expect(err).To(MatchError(ContainSubstring("static"))) @@ -58,9 +58,9 @@ var _ = Describe("MetricTagValue", func() { Expect(json.Unmarshal([]byte(expectedJSON), &testV)).To(Succeed()) Expect(testV).To(Equal(v)) }, - Entry("invalid", models.DynamicValueInvalid, `"DynamicValueInvalid"`), - Entry("index", models.MetricTagDynamicValueIndex, `"INDEX"`), - Entry("instance_guid", models.MetricTagDynamicValueInstanceGuid, `"INSTANCE_GUID"`), + Entry("invalid", models.MetricTagValue_DynamicValueInvalid, `"DynamicValueInvalid"`), + Entry("index", models.MetricTagValue_MetricTagDynamicValueIndex, `"INDEX"`), + Entry("instance_guid", models.MetricTagValue_MetricTagDynamicValueInstanceGuid, `"INSTANCE_GUID"`), ) }) }) @@ -69,11 +69,11 @@ var _ = Describe("MetricTagValue", func() { It("converts a valid maps", func() { tags, err := models.ConvertMetricTags(map[string]*models.MetricTagValue{ "foo": &models.MetricTagValue{Static: "bar"}, - "biz": &models.MetricTagValue{Dynamic: models.MetricTagDynamicValueIndex}, - "baz": &models.MetricTagValue{Dynamic: models.MetricTagDynamicValueInstanceGuid}, + "biz": &models.MetricTagValue{Dynamic: models.MetricTagValue_MetricTagDynamicValueIndex}, + "baz": &models.MetricTagValue{Dynamic: models.MetricTagValue_MetricTagDynamicValueInstanceGuid}, }, map[models.MetricTagValue_DynamicValue]interface{}{ - models.MetricTagDynamicValueIndex: int32(4), - models.MetricTagDynamicValueInstanceGuid: "my-guid", + models.MetricTagValue_MetricTagDynamicValueIndex: int32(4), + models.MetricTagValue_MetricTagDynamicValueInstanceGuid: "my-guid", }) Expect(err).To(Succeed()) Expect(tags).To(Equal(map[string]string{ @@ -86,11 +86,11 @@ var _ = Describe("MetricTagValue", func() { It("errors with invalid Index value", func() { _, err := models.ConvertMetricTags(map[string]*models.MetricTagValue{ "foo": &models.MetricTagValue{Static: "bar"}, - "biz": &models.MetricTagValue{Dynamic: models.MetricTagDynamicValueIndex}, - "baz": &models.MetricTagValue{Dynamic: models.MetricTagDynamicValueInstanceGuid}, + "biz": &models.MetricTagValue{Dynamic: models.MetricTagValue_MetricTagDynamicValueIndex}, + "baz": &models.MetricTagValue{Dynamic: models.MetricTagValue_MetricTagDynamicValueInstanceGuid}, }, map[models.MetricTagValue_DynamicValue]interface{}{ - models.MetricTagDynamicValueIndex: "$44", - models.MetricTagDynamicValueInstanceGuid: "my-guid", + models.MetricTagValue_MetricTagDynamicValueIndex: "$44", + models.MetricTagValue_MetricTagDynamicValueInstanceGuid: "my-guid", }) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal("could not convert value $44 of type string to int32")) @@ -99,11 +99,11 @@ var _ = Describe("MetricTagValue", func() { It("errors with invalid InstanceGuid value", func() { _, err := models.ConvertMetricTags(map[string]*models.MetricTagValue{ "foo": &models.MetricTagValue{Static: "bar"}, - "biz": &models.MetricTagValue{Dynamic: models.MetricTagDynamicValueIndex}, - "baz": &models.MetricTagValue{Dynamic: models.MetricTagDynamicValueInstanceGuid}, + "biz": &models.MetricTagValue{Dynamic: models.MetricTagValue_MetricTagDynamicValueIndex}, + "baz": &models.MetricTagValue{Dynamic: models.MetricTagValue_MetricTagDynamicValueInstanceGuid}, }, map[models.MetricTagValue_DynamicValue]interface{}{ - models.MetricTagDynamicValueIndex: int32(33), - models.MetricTagDynamicValueInstanceGuid: 55, + models.MetricTagValue_MetricTagDynamicValueIndex: int32(33), + models.MetricTagValue_MetricTagDynamicValueInstanceGuid: 55, }) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal("could not convert value 55 of type int to string")) @@ -112,8 +112,8 @@ var _ = Describe("MetricTagValue", func() { It("errors with nil dynamic value map", func() { _, err := models.ConvertMetricTags(map[string]*models.MetricTagValue{ "foo": &models.MetricTagValue{Static: "bar"}, - "biz": &models.MetricTagValue{Dynamic: models.MetricTagDynamicValueIndex}, - "baz": &models.MetricTagValue{Dynamic: models.MetricTagDynamicValueInstanceGuid}, + "biz": &models.MetricTagValue{Dynamic: models.MetricTagValue_MetricTagDynamicValueIndex}, + "baz": &models.MetricTagValue{Dynamic: models.MetricTagValue_MetricTagDynamicValueInstanceGuid}, }, map[models.MetricTagValue_DynamicValue]interface{}{}) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("could not convert value of type ")) diff --git a/models/modification_tag.pb.go b/models/modification_tag.pb.go index e1fe576e..9bc08d13 100644 --- a/models/modification_tag.pb.go +++ b/models/modification_tag.pb.go @@ -1,419 +1,132 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: modification_tag.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ModificationTag struct { - Epoch string `protobuf:"bytes,1,opt,name=epoch,proto3" json:"epoch"` - Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index"` -} - -func (m *ModificationTag) Reset() { *m = ModificationTag{} } -func (*ModificationTag) ProtoMessage() {} -func (*ModificationTag) Descriptor() ([]byte, []int) { - return fileDescriptor_b84c9c806e96b4e3, []int{0} -} -func (m *ModificationTag) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ModificationTag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ModificationTag.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ModificationTag) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModificationTag.Merge(m, src) -} -func (m *ModificationTag) XXX_Size() int { - return m.Size() -} -func (m *ModificationTag) XXX_DiscardUnknown() { - xxx_messageInfo_ModificationTag.DiscardUnknown(m) -} - -var xxx_messageInfo_ModificationTag proto.InternalMessageInfo - -func (m *ModificationTag) GetEpoch() string { - if m != nil { - return m.Epoch - } - return "" -} +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -func (m *ModificationTag) GetIndex() uint32 { - if m != nil { - return m.Index - } - return 0 +type ProtoModificationTag struct { + state protoimpl.MessageState `protogen:"open.v1"` + Epoch string `protobuf:"bytes,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { - proto.RegisterType((*ModificationTag)(nil), "models.ModificationTag") +func (x *ProtoModificationTag) Reset() { + *x = ProtoModificationTag{} + mi := &file_modification_tag_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func init() { proto.RegisterFile("modification_tag.proto", fileDescriptor_b84c9c806e96b4e3) } - -var fileDescriptor_b84c9c806e96b4e3 = []byte{ - // 203 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcb, 0xcd, 0x4f, 0xc9, - 0x4c, 0xcb, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, 0x8b, 0x2f, 0x49, 0x4c, 0xd7, 0x2b, 0x28, 0xca, - 0x2f, 0xc9, 0x17, 0x62, 0xcb, 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0x96, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, - 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0x4b, 0x27, 0x95, - 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0xd1, 0xa6, 0x14, 0xcc, 0xc5, 0xef, 0x8b, 0x64, 0x60, - 0x48, 0x62, 0xba, 0x90, 0x3c, 0x17, 0x6b, 0x6a, 0x41, 0x7e, 0x72, 0x86, 0x04, 0xa3, 0x02, 0xa3, - 0x06, 0xa7, 0x13, 0xe7, 0xab, 0x7b, 0xf2, 0x10, 0x81, 0x20, 0x08, 0x05, 0x52, 0x90, 0x99, 0x97, - 0x92, 0x5a, 0x21, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x0b, 0x51, 0x00, 0x16, 0x08, 0x82, 0x50, 0x4e, - 0x26, 0x17, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xf0, 0xe1, 0xa1, 0x1c, 0x63, 0xc3, 0x23, - 0x39, 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, - 0x23, 0x39, 0xc6, 0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, - 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0x92, 0xd8, 0xc0, 0x2e, 0x32, 0x06, 0x04, 0x00, - 0x00, 0xff, 0xff, 0x12, 0xa6, 0xaa, 0xa3, 0xe2, 0x00, 0x00, 0x00, +func (x *ProtoModificationTag) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *ModificationTag) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoModificationTag) ProtoMessage() {} - that1, ok := that.(*ModificationTag) - if !ok { - that2, ok := that.(ModificationTag) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoModificationTag) ProtoReflect() protoreflect.Message { + mi := &file_modification_tag_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Epoch != that1.Epoch { - return false - } - if this.Index != that1.Index { - return false - } - return true -} -func (this *ModificationTag) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ModificationTag{") - s = append(s, "Epoch: "+fmt.Sprintf("%#v", this.Epoch)+",\n") - s = append(s, "Index: "+fmt.Sprintf("%#v", this.Index)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringModificationTag(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *ModificationTag) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *ModificationTag) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoModificationTag.ProtoReflect.Descriptor instead. +func (*ProtoModificationTag) Descriptor() ([]byte, []int) { + return file_modification_tag_proto_rawDescGZIP(), []int{0} } -func (m *ModificationTag) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Index != 0 { - i = encodeVarintModificationTag(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x10 - } - if len(m.Epoch) > 0 { - i -= len(m.Epoch) - copy(dAtA[i:], m.Epoch) - i = encodeVarintModificationTag(dAtA, i, uint64(len(m.Epoch))) - i-- - dAtA[i] = 0xa +func (x *ProtoModificationTag) GetEpoch() string { + if x != nil { + return x.Epoch } - return len(dAtA) - i, nil + return "" } -func encodeVarintModificationTag(dAtA []byte, offset int, v uint64) int { - offset -= sovModificationTag(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ModificationTag) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Epoch) - if l > 0 { - n += 1 + l + sovModificationTag(uint64(l)) +func (x *ProtoModificationTag) GetIndex() uint32 { + if x != nil { + return x.Index } - if m.Index != 0 { - n += 1 + sovModificationTag(uint64(m.Index)) - } - return n + return 0 } -func sovModificationTag(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozModificationTag(x uint64) (n int) { - return sovModificationTag(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *ModificationTag) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ModificationTag{`, - `Epoch:` + fmt.Sprintf("%v", this.Epoch) + `,`, - `Index:` + fmt.Sprintf("%v", this.Index) + `,`, - `}`, - }, "") - return s -} -func valueToStringModificationTag(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *ModificationTag) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModificationTag - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ModificationTag: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ModificationTag: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Epoch", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModificationTag - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModificationTag - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModificationTag - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Epoch = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModificationTag - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipModificationTag(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModificationTag - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var File_modification_tag_proto protoreflect.FileDescriptor - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipModificationTag(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowModificationTag - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowModificationTag - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowModificationTag - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthModificationTag - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupModificationTag - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthModificationTag - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +const file_modification_tag_proto_rawDesc = "" + + "\n" + + "\x16modification_tag.proto\x12\x06models\x1a\tbbs.proto\"L\n" + + "\x14ProtoModificationTag\x12\x19\n" + + "\x05epoch\x18\x01 \x01(\tB\x03\xc0>\x01R\x05epoch\x12\x19\n" + + "\x05index\x18\x02 \x01(\rB\x03\xc0>\x01R\x05indexB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthModificationTag = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowModificationTag = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupModificationTag = fmt.Errorf("proto: unexpected end of group") + file_modification_tag_proto_rawDescOnce sync.Once + file_modification_tag_proto_rawDescData []byte ) + +func file_modification_tag_proto_rawDescGZIP() []byte { + file_modification_tag_proto_rawDescOnce.Do(func() { + file_modification_tag_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_modification_tag_proto_rawDesc), len(file_modification_tag_proto_rawDesc))) + }) + return file_modification_tag_proto_rawDescData +} + +var file_modification_tag_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_modification_tag_proto_goTypes = []any{ + (*ProtoModificationTag)(nil), // 0: models.ProtoModificationTag +} +var file_modification_tag_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_modification_tag_proto_init() } +func file_modification_tag_proto_init() { + if File_modification_tag_proto != nil { + return + } + file_bbs_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_modification_tag_proto_rawDesc), len(file_modification_tag_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modification_tag_proto_goTypes, + DependencyIndexes: file_modification_tag_proto_depIdxs, + MessageInfos: file_modification_tag_proto_msgTypes, + }.Build() + File_modification_tag_proto = out.File + file_modification_tag_proto_goTypes = nil + file_modification_tag_proto_depIdxs = nil +} diff --git a/models/modification_tag.proto b/models/modification_tag.proto index 0b413b54..9deedf04 100644 --- a/models/modification_tag.proto +++ b/models/modification_tag.proto @@ -1,11 +1,12 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; -message ModificationTag { - string epoch = 1 [(gogoproto.jsontag) = "epoch"]; - uint32 index = 2 [(gogoproto.jsontag) = "index"]; +message ProtoModificationTag { + string epoch = 1 [json_name = "epoch", (bbs.bbs_json_always_emit) = true]; + uint32 index = 2 [json_name = "index", (bbs.bbs_json_always_emit) = true]; } diff --git a/models/modification_tag_bbs.pb.go b/models/modification_tag_bbs.pb.go new file mode 100644 index 00000000..a312da0d --- /dev/null +++ b/models/modification_tag_bbs.pb.go @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: modification_tag.proto + +package models + +// Prevent copylock errors when using ProtoModificationTag directly +type ModificationTag struct { + Epoch string `json:"epoch"` + Index uint32 `json:"index"` +} + +func (this *ModificationTag) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ModificationTag) + if !ok { + that2, ok := that.(ModificationTag) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Epoch != that1.Epoch { + return false + } + if this.Index != that1.Index { + return false + } + return true +} +func (m *ModificationTag) GetEpoch() string { + if m != nil { + return m.Epoch + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *ModificationTag) SetEpoch(value string) { + if m != nil { + m.Epoch = value + } +} +func (m *ModificationTag) GetIndex() uint32 { + if m != nil { + return m.Index + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} +func (m *ModificationTag) SetIndex(value uint32) { + if m != nil { + m.Index = value + } +} +func (x *ModificationTag) ToProto() *ProtoModificationTag { + if x == nil { + return nil + } + + proto := &ProtoModificationTag{ + Epoch: x.Epoch, + Index: x.Index, + } + return proto +} + +func (x *ProtoModificationTag) FromProto() *ModificationTag { + if x == nil { + return nil + } + + copysafe := &ModificationTag{ + Epoch: x.Epoch, + Index: x.Index, + } + return copysafe +} + +func ModificationTagToProtoSlice(values []*ModificationTag) []*ProtoModificationTag { + if values == nil { + return nil + } + result := make([]*ProtoModificationTag, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ModificationTagFromProtoSlice(values []*ProtoModificationTag) []*ModificationTag { + if values == nil { + return nil + } + result := make([]*ModificationTag, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/network.pb.go b/models/network.pb.go index 6bd2eb70..d52d6e39 100644 --- a/models/network.pb.go +++ b/models/network.pb.go @@ -1,522 +1,129 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: network.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Network struct { - Properties map[string]string `protobuf:"bytes,1,rep,name=properties,proto3" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *Network) Reset() { *m = Network{} } -func (*Network) ProtoMessage() {} -func (*Network) Descriptor() ([]byte, []int) { - return fileDescriptor_8571034d60397816, []int{0} -} -func (m *Network) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Network) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Network.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Network) XXX_Merge(src proto.Message) { - xxx_messageInfo_Network.Merge(m, src) -} -func (m *Network) XXX_Size() int { - return m.Size() -} -func (m *Network) XXX_DiscardUnknown() { - xxx_messageInfo_Network.DiscardUnknown(m) -} - -var xxx_messageInfo_Network proto.InternalMessageInfo +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -func (m *Network) GetProperties() map[string]string { - if m != nil { - return m.Properties - } - return nil +type ProtoNetwork struct { + state protoimpl.MessageState `protogen:"open.v1"` + Properties map[string]string `protobuf:"bytes,1,rep,name=properties,proto3" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { - proto.RegisterType((*Network)(nil), "models.Network") - proto.RegisterMapType((map[string]string)(nil), "models.Network.PropertiesEntry") +func (x *ProtoNetwork) Reset() { + *x = ProtoNetwork{} + mi := &file_network_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func init() { proto.RegisterFile("network.proto", fileDescriptor_8571034d60397816) } - -var fileDescriptor_8571034d60397816 = []byte{ - // 247 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcd, 0x4b, 0x2d, 0x29, - 0xcf, 0x2f, 0xca, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xcb, 0xcd, 0x4f, 0x49, 0xcd, - 0x29, 0x96, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, - 0x4f, 0xcf, 0xd7, 0x07, 0x4b, 0x27, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0xd1, 0xa6, - 0xb4, 0x98, 0x91, 0x8b, 0xdd, 0x0f, 0x62, 0x90, 0x50, 0x24, 0x17, 0x57, 0x41, 0x51, 0x7e, 0x41, - 0x6a, 0x51, 0x49, 0x66, 0x6a, 0xb1, 0x04, 0xa3, 0x02, 0xb3, 0x06, 0xb7, 0x91, 0xbc, 0x1e, 0xc4, - 0x5c, 0x3d, 0xa8, 0x22, 0xbd, 0x00, 0xb8, 0x0a, 0xd7, 0xbc, 0x92, 0xa2, 0x4a, 0x27, 0x89, 0x57, - 0xf7, 0xe4, 0x45, 0x10, 0xda, 0x74, 0xf2, 0x73, 0x33, 0x4b, 0x52, 0x73, 0x0b, 0x4a, 0x2a, 0x83, - 0x90, 0x0c, 0x93, 0xb2, 0xe5, 0xe2, 0x47, 0xd3, 0x28, 0x24, 0xc0, 0xc5, 0x9c, 0x9d, 0x5a, 0x29, - 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0x62, 0x0a, 0x89, 0x70, 0xb1, 0x96, 0x25, 0xe6, 0x94, - 0xa6, 0x4a, 0x30, 0x81, 0xc5, 0x20, 0x1c, 0x2b, 0x26, 0x0b, 0x46, 0x27, 0x93, 0x0b, 0x0f, 0xe5, - 0x18, 0x6f, 0x3c, 0x94, 0x63, 0xf8, 0xf0, 0x50, 0x8e, 0xb1, 0xe1, 0x91, 0x1c, 0xe3, 0x8a, 0x47, - 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x8b, - 0x47, 0x72, 0x0c, 0x1f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, - 0x8d, 0xc7, 0x72, 0x0c, 0x49, 0x6c, 0x60, 0x2f, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x38, - 0x3c, 0x9d, 0x4b, 0x2a, 0x01, 0x00, 0x00, +func (x *ProtoNetwork) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *Network) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoNetwork) ProtoMessage() {} - that1, ok := that.(*Network) - if !ok { - that2, ok := that.(Network) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Properties) != len(that1.Properties) { - return false - } - for i := range this.Properties { - if this.Properties[i] != that1.Properties[i] { - return false +func (x *ProtoNetwork) ProtoReflect() protoreflect.Message { + mi := &file_network_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return true -} -func (this *Network) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.Network{") - keysForProperties := make([]string, 0, len(this.Properties)) - for k, _ := range this.Properties { - keysForProperties = append(keysForProperties, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForProperties) - mapStringForProperties := "map[string]string{" - for _, k := range keysForProperties { - mapStringForProperties += fmt.Sprintf("%#v: %#v,", k, this.Properties[k]) - } - mapStringForProperties += "}" - if this.Properties != nil { - s = append(s, "Properties: "+mapStringForProperties+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringNetwork(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *Network) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Network) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return mi.MessageOf(x) } -func (m *Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Properties) > 0 { - for k := range m.Properties { - v := m.Properties[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintNetwork(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintNetwork(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintNetwork(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil +// Deprecated: Use ProtoNetwork.ProtoReflect.Descriptor instead. +func (*ProtoNetwork) Descriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{0} } -func encodeVarintNetwork(dAtA []byte, offset int, v uint64) int { - offset -= sovNetwork(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Network) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Properties) > 0 { - for k, v := range m.Properties { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovNetwork(uint64(len(k))) + 1 + len(v) + sovNetwork(uint64(len(v))) - n += mapEntrySize + 1 + sovNetwork(uint64(mapEntrySize)) - } +func (x *ProtoNetwork) GetProperties() map[string]string { + if x != nil { + return x.Properties } - return n + return nil } -func sovNetwork(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozNetwork(x uint64) (n int) { - return sovNetwork(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Network) String() string { - if this == nil { - return "nil" - } - keysForProperties := make([]string, 0, len(this.Properties)) - for k, _ := range this.Properties { - keysForProperties = append(keysForProperties, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForProperties) - mapStringForProperties := "map[string]string{" - for _, k := range keysForProperties { - mapStringForProperties += fmt.Sprintf("%v: %v,", k, this.Properties[k]) - } - mapStringForProperties += "}" - s := strings.Join([]string{`&Network{`, - `Properties:` + mapStringForProperties + `,`, - `}`, - }, "") - return s -} -func valueToStringNetwork(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Network) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowNetwork - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Network: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Network: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Properties", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowNetwork - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthNetwork - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthNetwork - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Properties == nil { - m.Properties = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowNetwork - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowNetwork - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthNetwork - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthNetwork - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowNetwork - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthNetwork - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthNetwork - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipNetwork(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthNetwork - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Properties[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipNetwork(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthNetwork - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var File_network_proto protoreflect.FileDescriptor - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipNetwork(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowNetwork - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowNetwork - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowNetwork - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthNetwork - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupNetwork - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthNetwork - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +const file_network_proto_rawDesc = "" + + "\n" + + "\rnetwork.proto\x12\x06models\"\x93\x01\n" + + "\fProtoNetwork\x12D\n" + + "\n" + + "properties\x18\x01 \x03(\v2$.models.ProtoNetwork.PropertiesEntryR\n" + + "properties\x1a=\n" + + "\x0fPropertiesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthNetwork = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowNetwork = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupNetwork = fmt.Errorf("proto: unexpected end of group") + file_network_proto_rawDescOnce sync.Once + file_network_proto_rawDescData []byte ) + +func file_network_proto_rawDescGZIP() []byte { + file_network_proto_rawDescOnce.Do(func() { + file_network_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_network_proto_rawDesc), len(file_network_proto_rawDesc))) + }) + return file_network_proto_rawDescData +} + +var file_network_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_network_proto_goTypes = []any{ + (*ProtoNetwork)(nil), // 0: models.ProtoNetwork + nil, // 1: models.ProtoNetwork.PropertiesEntry +} +var file_network_proto_depIdxs = []int32{ + 1, // 0: models.ProtoNetwork.properties:type_name -> models.ProtoNetwork.PropertiesEntry + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_network_proto_init() } +func file_network_proto_init() { + if File_network_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_network_proto_rawDesc), len(file_network_proto_rawDesc)), + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_network_proto_goTypes, + DependencyIndexes: file_network_proto_depIdxs, + MessageInfos: file_network_proto_msgTypes, + }.Build() + File_network_proto = out.File + file_network_proto_goTypes = nil + file_network_proto_depIdxs = nil +} diff --git a/models/network.proto b/models/network.proto index 95185656..ff2f91e8 100644 --- a/models/network.proto +++ b/models/network.proto @@ -1,11 +1,8 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.goproto_enum_prefix_all) = true; - -message Network { - map properties = 1 [(gogoproto.jsontag) = "properties,omitempty"]; +message ProtoNetwork { + map properties = 1 [json_name = "properties"]; } diff --git a/models/network_bbs.pb.go b/models/network_bbs.pb.go new file mode 100644 index 00000000..33cbba46 --- /dev/null +++ b/models/network_bbs.pb.go @@ -0,0 +1,103 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: network.proto + +package models + +// Prevent copylock errors when using ProtoNetwork directly +type Network struct { + Properties map[string]string `json:"properties,omitempty"` +} + +func (this *Network) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*Network) + if !ok { + that2, ok := that.(Network) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Properties == nil { + if that1.Properties != nil { + return false + } + } else if len(this.Properties) != len(that1.Properties) { + return false + } + for i := range this.Properties { + if this.Properties[i] != that1.Properties[i] { + return false + } + } + return true +} +func (m *Network) GetProperties() map[string]string { + if m != nil { + return m.Properties + } + return nil +} +func (m *Network) SetProperties(value map[string]string) { + if m != nil { + m.Properties = value + } +} +func (x *Network) ToProto() *ProtoNetwork { + if x == nil { + return nil + } + + proto := &ProtoNetwork{ + Properties: x.Properties, + } + return proto +} + +func (x *ProtoNetwork) FromProto() *Network { + if x == nil { + return nil + } + + copysafe := &Network{ + Properties: x.Properties, + } + return copysafe +} + +func NetworkToProtoSlice(values []*Network) []*ProtoNetwork { + if values == nil { + return nil + } + result := make([]*ProtoNetwork, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func NetworkFromProtoSlice(values []*ProtoNetwork) []*Network { + if values == nil { + return nil + } + result := make([]*Network, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/performance/bbs_plugin_test.go b/models/performance/bbs_plugin_test.go new file mode 100644 index 00000000..6fcb6088 --- /dev/null +++ b/models/performance/bbs_plugin_test.go @@ -0,0 +1,501 @@ +package performance + +import ( + "encoding/json" + "time" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + gmeasure "github.com/onsi/gomega/gmeasure" + "google.golang.org/protobuf/proto" + + "code.cloudfoundry.org/bbs/models" +) + +var skipPerformanceTests = true + +var _ = Describe("BBS Plugin Conversion: Desired LRP", func() { + var nanosecondPrecision = gmeasure.Precision(1 * time.Nanosecond) + var desiredLRP models.DesiredLRP + + desiredLRPjson := `{ + "setup": { + "serial": { + "actions": [ + { + "download": { + "from": "http://file-server.service.cf.internal:8080/v1/static/buildpack_app_lifecycle/buildpack_app_lifecycle.tgz", + "to": "/tmp/lifecycle", + "cache_key": "buildpack-cflinuxfs3-lifecycle", + "user": "someone", + "checksum_algorithm": "md5", + "checksum_value": "some random value" + } + }, + { + "download": { + "from": "http://cloud-controller-ng.service.cf.internal:9022/internal/v2/droplets/some-guid/some-guid/download", + "to": ".", + "cache_key": "droplets-some-guid", + "user": "someone" + } + } + ] + } + }, + "action": { + "codependent": { + "actions": [ + { + "run": { + "path": "/tmp/lifecycle/launcher", + "args": [ + "app", + "", + "{\"start_command\":\"bundle exec rackup config.ru -p $PORT\"}" + ], + "env": [ + { + "name": "VCAP_APPLICATION", + "value": "{\"limits\":{\"mem\":1024,\"disk\":1024,\"fds\":16384},\"application_id\":\"some-guid\",\"application_version\":\"some-guid\",\"application_name\":\"some-guid\",\"version\":\"some-guid\",\"name\":\"some-guid\",\"space_name\":\"CATS-SPACE-3-2015_07_01-11h28m01.515s\",\"space_id\":\"bc640806-ea03-40c6-8371-1c2b23fa4662\"}" + }, + { + "name": "VCAP_SERVICES", + "value": "{}" + }, + { + "name": "MEMORY_LIMIT", + "value": "1024m" + }, + { + "name": "CF_STACK", + "value": "cflinuxfs3" + }, + { + "name": "PORT", + "value": "8080" + } + ], + "resource_limits": { + "nofile": 16384 + }, + "user": "vcap", + "log_source": "APP", + "suppress_log_output": false, + "volume_mounted_files": null + } + }, + { + "run": { + "path": "/tmp/lifecycle/diego-sshd", + "args": [ + "-address=0.0.0.0:2222", + "-hostKey=-----BEGIN RSA PRIVATE KEY-----\nMIICWwIBAAKBgQCp72ylz6ow8P4km1Nzd2yyN9aiXAI8MHl6Crl6vjpBNQIhy+YH\nEf5fgAI/wHydaajSsk28Byf/hAm/Q/3EmT1bUmdCsVzzndzJvPNf5t11LGmPFcNV\nZ9vsfnFjMlsFM/ZHU60PT8POSoE8VnrplTLRhEtQFopdMcDN8nRl6imhUQIDAQAB\nAoGAWz8aQbZOFlVwwUs99gQsM03US/3HnXYR5DwZ+BRox1alPGx1qVo6EiF0E7NR\ntlxjsC7ZmprlGUhWy4LAom3+CUj712fI7Qnud9AH4GUHN4JrxytiDDLJJh/hRADB\niD/MKo9ih7c2bQvBU+FwLYlXyI/GViBMqIYzZ+6r7yVkp/kCQQDZIcMKzNwVV+LL\nnDXZg4nIyFgR3CGZb+cVrXnDaIEwmC5ABHlnhJJzI7FdsGuhwOJnKdMHQgI6+o+Z\nvmizsdyDAkEAyFrXDX+wRMPrEjmNga2TYaCIt6AWR3b4aLJskZQnf0iMI2DzL74e\na7Ibkxp+OxtSL2YIR7NCfDz/DiUtqvQKmwJAVRxX0K72geM+QiOMNCPMaYimhPGt\ntfBYO3YRaZhYM40ja/KVCA++PCW8i4Xw2qm51UhesNSd/TJkAZbSgcVxMwJAQSKX\nK4JJkfGHqKMhR/lgIqsIB3p6A72/wHnRJfreZFj3hkDsjqbmSOjcYhSI2Tpmm5Y2\nNukmQjGqUbTwhdVU5QJALpewrw7eiWAjnYxus6Fi0XiEduE91OEtuc3yHRrR0ubI\nCt2HP6jQ43siwcx+FAA8kBfvtQElIC2TF2qwjezEcA==\n-----END RSA PRIVATE KEY-----\n", + "-authorizedKey=ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDuOfcUnfiXE6g6Cvgur3Om6t8cEx27FAoVrDrxMzy+q2NTJaQFNYqG2DDDHZCLG2mJasryKZfDyK30c48ITpecBkCux429aZN2gEJCEsyYgsZheI+5eNYs1vzl68KQ1LdxlgNOqFZijyVjTOD60GMPCVlDICqGNUFH4aPTHA0fVw==\n", + "-inheritDaemonEnv", + "-logLevel=fatal" + ], + "env": [ + { + "name": "VCAP_APPLICATION", + "value": "{\"limits\":{\"mem\":1024,\"disk\":1024,\"fds\":16384},\"application_id\":\"some-guid\",\"application_version\":\"some-guid\",\"application_name\":\"some-guid\",\"version\":\"some-guid\",\"name\":\"some-guid\",\"space_name\":\"CATS-SPACE-3-2015_07_01-11h28m01.515s\",\"space_id\":\"some-guid\"}" + }, + { + "name": "VCAP_SERVICES", + "value": "{}" + }, + { + "name": "MEMORY_LIMIT", + "value": "1024m" + }, + { + "name": "CF_STACK", + "value": "cflinuxfs3" + }, + { + "name": "PORT", + "value": "8080" + } + ], + "resource_limits": { + "nofile": 16384 + }, + "user": "vcap", + "suppress_log_output": false, + "volume_mounted_files": null + } + } + ] + } + }, + "monitor": { + "timeout": { + "action": { + "run": { + "path": "/tmp/lifecycle/healthcheck", + "args": [ + "-port=8080" + ], + "resource_limits": { + "nofile": 1024 + }, + "user": "vcap", + "log_source": "HEALTH", + "suppress_log_output": true, + "volume_mounted_files": null + } + }, + "timeout_ms": 30000000 + } + }, + "process_guid": "some-guid", + "domain": "cf-apps", + "rootfs": "preloaded:cflinuxfs3", + "instances": 2, + "env": [ + { + "name": "LANG", + "value": "en_US.UTF-8" + } + ], + "start_timeout_ms": 60000, + "disk_mb": 1024, + "memory_mb": 1024, + "cpu_weight": 10, + "privileged": true, + "ports": [ + 8080, + 2222 + ], + "routes": { + "cf-router": [ + { + "hostnames": [ + "some-route.example.com" + ], + "port": 8080 + } + ], + "diego-ssh": { + "container_port": 2222, + "host_fingerprint": "ac:99:67:20:7e:c2:7c:2c:d2:22:37:bc:9f:14:01:ec", + "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIICXQIBAAKBgQDuOfcUnfiXE6g6Cvgur3Om6t8cEx27FAoVrDrxMzy+q2NTJaQF\nNYqG2DDDHZCLG2mJasryKZfDyK30c48ITpecBkCux429aZN2gEJCEsyYgsZheI+5\neNYs1vzl68KQ1LdxlgNOqFZijyVjTOD60GMPCVlDICqGNUFH4aPTHA0fVwIDAQAB\nAoGBAO1Ak19YGHy1mgP8asFsAT1KitrV+vUW9xgwiB8xjRzDac8kHJ8HfKfg5Wdc\nqViw+0FdNzNH0xqsYPqkn92BECDqdWOzhlEYNj/AFSHTdRPrs9w82b7h/LhrX0H/\nRUrU2QrcI2uSV/SQfQvFwC6YaYugCo35noljJEcD8EYQTcRxAkEA+jfjumM6da8O\n8u8Rc58Tih1C5mumeIfJMPKRz3FBLQEylyMWtGlr1XT6ppqiHkAAkQRUBgKi+Ffi\nYedQOvE0/wJBAPO7I+brmrknzOGtSK2tvVKnMqBY6F8cqmG4ZUm0W9tMLKiR7JWO\nAsjSlQfEEnpOr/AmuONwTsNg+g93IILv3akCQQDnrKfmA8o0/IlS1ZfK/hcRYlZ3\nEmVoZBEciPwInkxCZ0F4Prze/l0hntYVPEeuyoO7wc4qYnaSiozJKWtXp83xAkBo\nk+ubsYv51jH6wzdkDiAlzsfSNVO/O7V/qHcNYO3o8o5W5gX1RbG8KV74rhCfmhOz\nn2nFbPLeskWZTSwOAo3BAkBWHBjvCj1sBgsIG4v6Tn2ig21akbmssJezmZRjiqeh\nqt0sAzMVixAwIFM0GsW3vQ8Hr/eBTb5EBQVZ/doRqUzf\n-----END RSA PRIVATE KEY-----\n" + } + }, + "log_guid": "some-guid", + "log_source": "CELL", + "metrics_guid": "some-guid", + "annotation": "1435775395.194748", + "egress_rules": [ + { + "protocol": "all", + "destinations": [ + "0.0.0.0-9.255.255.255" + ], + "log": false + }, + { + "protocol": "all", + "destinations": [ + "11.0.0.0-169.253.255.255" + ], + "log": false + }, + { + "protocol": "all", + "destinations": [ + "169.255.0.0-172.15.255.255" + ], + "log": false + }, + { + "protocol": "all", + "destinations": [ + "172.32.0.0-192.167.255.255" + ], + "log": false + }, + { + "protocol": "all", + "destinations": [ + "192.169.0.0-255.255.255.255" + ], + "log": false + }, + { + "protocol": "tcp", + "destinations": [ + "0.0.0.0/0" + ], + "ports": [ + 53 + ], + "log": false + }, + { + "protocol": "udp", + "destinations": [ + "0.0.0.0/0" + ], + "ports": [ + 53 + ], + "log": false + } + ], + "modification_tag": { + "epoch": "some-guid", + "index": 0 + }, + "placement_tags": ["red-tag", "blue-tag"], + "trusted_system_certificates_path": "/etc/cf-system-certificates", + "network": { + "properties": { + "key": "value", + "another_key": "another_value" + } + }, + "max_pids": 256, + "certificate_properties": { + "organizational_unit": ["stuff"] + }, + "check_definition": { + "checks": [ + { + "tcp_check": { + "port": 12345, + "connect_timeout_ms": 100 + } + } + ], + "readiness_checks": [ + { + "tcp_check": { + "port": 12345 + } + } + ], + "log_source": "healthcheck_log_source" + }, + "image_layers": [ + { + "url": "some-url", + "destination_path": "/tmp", + "digest_algorithm": "SHA512", + "digest_value": "abc123", + "media_type": "TGZ", + "layer_type": "SHARED" + } + ], + "legacy_download_user": "some-user", + "metric_tags": { + "source_id": { + "static": "some-guid" + }, + "foo": { + "static": "some-value" + }, + "bar": { + "dynamic": "INDEX" + } + }, + "sidecars": [ + { + "action": { + "codependent": { + "actions": [ + { + "run": { + "path": "/tmp/lifecycle/launcher", + "args": [ + "app", + "", + "{\"start_command\":\"/usr/local/bin/nginx\"}" + ], + "resource_limits": { + "nofile": 16384 + }, + "user": "vcap", + "log_source": "SIDECAR", + "suppress_log_output": false, + "volume_mounted_files": null + } + } + ] + } + }, + "disk_mb": 512, + "memory_mb": 512 + } + ], + "log_rate_limit": { + "bytes_per_second": 2048 + }, + "volume_mounted_files": null + }` + + Context("Conversion Performance Testing", func() { + Context("Starting with a BBS Plugin Struct", func() { + BeforeEach(func() { + if skipPerformanceTests { + Skip("Skipping Performnace Tests") + } + desiredLRP = models.DesiredLRP{} + err := json.Unmarshal([]byte(desiredLRPjson), &desiredLRP) + Expect(err).NotTo(HaveOccurred()) + }) + + DescribeTable("Measures conversion time", + func(experimentName string, number int, callback func(models.DesiredLRP)) { + experiment := gmeasure.NewExperiment(experimentName) + AddReportEntry(experiment.Name, experiment) + experiment.Sample(func(i int) { + stopwatch := experiment.NewStopwatch() + callback(desiredLRP) + stopwatch.Record("convert", nanosecondPrecision) + }, gmeasure.SamplingConfig{N: number}) + }, + // bbs struct to protobuf struct + Entry("1 conversion", "BBS Struct => Protobuf Struct", 1, bbsStructToProtobufStruct), + Entry("1,000 conversions", "BBS Struct => Protobuf Struct", 1000, bbsStructToProtobufStruct), + Entry("1,000,000 conversions", "BBS Struct => Protobuf Struct", 1000000, bbsStructToProtobufStruct), + // bbs struct to protobuf binary + Entry("1 conversion", "BBS Struct => Protobuf Binary", 1, bbsStructToProtobufBinary), + Entry("1,000 conversions", "BBS Struct => Protobuf Binary", 1000, bbsStructToProtobufBinary), + Entry("1,000,000 conversions", "BBS Struct => Protobuf Binary", 1000000, bbsStructToProtobufBinary), + // bbs struct to protobuf binary to bbs struct + Entry("1 conversion", "BBS Struct => Protobuf Binary => BBS Struct", 1, bbsStructRoundtrip), + Entry("1,000 conversions", "BBS Struct => Protobuf Binary => BBS Struct", 1000, bbsStructRoundtrip), + Entry("1,000,000 conversions", "BBS Struct => Protobuf Binary => BBS Struct", 1000000, bbsStructRoundtrip), + ) + }) + + Context("Starting with a Protobuf Struct", func() { + var protoDesiredLRP *models.ProtoDesiredLRP + BeforeEach(func() { + if skipPerformanceTests { + Skip("Skipping Performnace Tests") + } + desiredLRP = models.DesiredLRP{} + err := json.Unmarshal([]byte(desiredLRPjson), &desiredLRP) + protoDesiredLRP = desiredLRP.ToProto() + Expect(err).NotTo(HaveOccurred()) + }) + + DescribeTable("Measures conversion time", + func(experimentName string, number int, callback func(*models.ProtoDesiredLRP)) { + experiment := gmeasure.NewExperiment(experimentName) + AddReportEntry(experiment.Name, experiment) + experiment.Sample(func(i int) { + stopwatch := experiment.NewStopwatch() + callback(protoDesiredLRP) + stopwatch.Record("convert", nanosecondPrecision) + }, gmeasure.SamplingConfig{N: number}) + }, + // protobuf struct to bbs struct + Entry("1 conversion", "Protobuf Struct => BBS Struct", 1, protobufStructToBbsStruct), + Entry("1,000 conversions", "Protobuf Struct => BBS Struct", 1000, protobufStructToBbsStruct), + Entry("1,000,000 conversions", "Protobuf Struct => BBS Struct", 1000000, protobufStructToBbsStruct), + // protobuf struct to protobuf binary + Entry("1 conversion", "Protobuf Struct => Protobuf Binary", 1, protobufStructToProtobufBinary), + Entry("1,000 conversions", "Protobuf Struct => Protobuf Binary", 1000, protobufStructToProtobufBinary), + Entry("1,000,000 conversions", "Protobuf Struct => Protobuf Binary", 1000000, protobufStructToProtobufBinary), + // protobuf struct to protobuf binary to protobuf struct + Entry("1 conversion", "Protobuf Struct => Protobuf Binary", 1, protobufStructRoundtrip), + Entry("1,000 conversions", "Protobuf Struct => Protobuf Binary", 1000, protobufStructRoundtrip), + Entry("1,000,000 conversions", "Protobuf Struct => Protobuf Binary", 1000000, protobufStructRoundtrip), + ) + }) + + Context("Starting with a Protobuf Binary", func() { + var binaryDesiredLRP []byte + var protoDesiredLRP *models.ProtoDesiredLRP + BeforeEach(func() { + if skipPerformanceTests { + Skip("Skipping Performnace Tests") + } + desiredLRP = models.DesiredLRP{} + err := json.Unmarshal([]byte(desiredLRPjson), &desiredLRP) + protoDesiredLRP = desiredLRP.ToProto() + Expect(err).NotTo(HaveOccurred()) + binaryDesiredLRP, _ = proto.Marshal(protoDesiredLRP) + }) + + DescribeTable("Measures conversion time", + func(experimentName string, number int, callback func([]byte)) { + experiment := gmeasure.NewExperiment(experimentName) + AddReportEntry(experiment.Name, experiment) + experiment.Sample(func(i int) { + stopwatch := experiment.NewStopwatch() + callback(binaryDesiredLRP) + stopwatch.Record("convert", nanosecondPrecision) + }, gmeasure.SamplingConfig{N: number}) + }, + // protobuf binary to bbs struct + Entry("1 conversion", "Protobuf Binary => BBS Struct", 1, protobufBinaryToBbsStruct), + Entry("1,000 conversions", "Protobuf Binary => BBS Struct", 1000, protobufBinaryToBbsStruct), + Entry("1,000,000 conversions", "Protobuf Binary => BBS Struct", 1000000, protobufBinaryToBbsStruct), + // protobuf binary to protobuf struct + Entry("1 conversion", "Protobuf Binary => Protobuf Struct", 1, protobufBinaryToProtobufStruct), + Entry("1,000 conversions", "Protobuf Binary => Protobuf Struct", 1000, protobufBinaryToProtobufStruct), + Entry("1,000,000 conversions", "Protobuf Binary => Protobuf Struct", 1000000, protobufBinaryToProtobufStruct), + ) + }) + }) +}) + +func bbsStructToProtobufStruct(which models.DesiredLRP) { + // simple conversion between structs + which.ToProto() +} + +func bbsStructToProtobufBinary(which models.DesiredLRP) { + // simple conversion between structs + protoStruct := which.ToProto() + // marshal into protobuf binary / wire format + proto.Marshal(protoStruct) +} + +func protobufBinaryToBbsStruct(which []byte) { + var unmarshalProto models.ProtoDesiredLRP + // umarshal into protobuf binary / wire format + proto.Unmarshal(which, &unmarshalProto) + // single conversion to bbs struct + unmarshalProto.FromProto() +} + +func bbsStructRoundtrip(which models.DesiredLRP) { + var unmarshalProto models.ProtoDesiredLRP + // simple conversion to proto struct + protoStruct := which.ToProto() + // marshal into protobuf binary / wire format + marshalProto, _ := proto.Marshal(protoStruct) + // unmarshal from protobuf binary / wire format + proto.Unmarshal(marshalProto, &unmarshalProto) + // simple conversion to bbs struct + unmarshalProto.FromProto() +} + +func protobufStructToBbsStruct(which *models.ProtoDesiredLRP) { + // simple conversion to bbs struct + which.FromProto() +} + +func protobufStructToProtobufBinary(which *models.ProtoDesiredLRP) { + // marshal into protobuf binary / wire format + proto.Marshal(which) +} + +func protobufBinaryToProtobufStruct(which []byte) { + var unmarshalProto models.ProtoDesiredLRP + // umarshal into protobuf binary / wire format + proto.Unmarshal(which, &unmarshalProto) +} + +func protobufStructRoundtrip(which *models.ProtoDesiredLRP) { + var unmarshalProto models.ProtoDesiredLRP + // marshal into protobuf binary / wire format + marshalProto, _ := proto.Marshal(which) + // unmarshal from protobuf binary / wire format + proto.Unmarshal(marshalProto, &unmarshalProto) +} diff --git a/models/performance/performance_suite_test.go b/models/performance/performance_suite_test.go new file mode 100644 index 00000000..8fb693f9 --- /dev/null +++ b/models/performance/performance_suite_test.go @@ -0,0 +1,13 @@ +package performance_test + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestPerformance(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Performance Suite") +} diff --git a/models/performance/results/gogo-protobuf.txt b/models/performance/results/gogo-protobuf.txt new file mode 100644 index 00000000..0822f32f --- /dev/null +++ b/models/performance/results/gogo-protobuf.txt @@ -0,0 +1,121 @@ +Running Suite: Performance Suite - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance +========================================================================================================================= +Random Seed: 1740436834 + +Will run 9 of 9 specs +------------------------------ +• [0.002 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1 conversion +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:354 + + Report Entries >> + BBS Struct => Protobuf Binary - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:346 @ 02/24/25 22:40:35.606 + BBS Struct => Protobuf Binary + Name | N | Min | Median | Mean | StdDev | Max + =================================================================== + convert [duration] | 1 | 62.9µs | 62.9µs | 62.9µs | 0s | 62.9µs + << Report Entries +------------------------------ +• [0.062 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:355 + + Report Entries >> + BBS Struct => Protobuf Binary - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:346 @ 02/24/25 22:40:35.607 + BBS Struct => Protobuf Binary + Name | N | Min | Median | Mean | StdDev | Max + ================================================================================ + convert [duration] | 1000 | 8.9µs | 16.649µs | 21.383µs | 108.068µs | 3.380561ms + << Report Entries +------------------------------ +• [55.034 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1,000,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:356 + + Report Entries >> + BBS Struct => Protobuf Binary - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:346 @ 02/24/25 22:40:35.67 + BBS Struct => Protobuf Binary + Name | N | Min | Median | Mean | StdDev | Max + ================================================================================ + convert [duration] | 1000000 | 8.5µs | 10µs | 11.743µs | 15.225µs | 5.087044ms + << Report Entries +------------------------------ +• [0.001 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1 conversion +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:358 + + Report Entries >> + BBS Struct => Protobuf Binary => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:346 @ 02/24/25 22:41:30.761 + BBS Struct => Protobuf Binary => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + =========================================================================== + convert [duration] | 1 | 73.599µs | 73.599µs | 73.599µs | 0s | 73.599µs + << Report Entries +------------------------------ +• [0.066 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:359 + + Report Entries >> + BBS Struct => Protobuf Binary => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:346 @ 02/24/25 22:41:30.761 + BBS Struct => Protobuf Binary => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + ============================================================================== + convert [duration] | 1000 | 17.1µs | 19.201µs | 24.53µs | 33.678µs | 772.192µs + << Report Entries +------------------------------ +• [67.569 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1,000,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:360 + + Report Entries >> + BBS Struct => Protobuf Binary => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:346 @ 02/24/25 22:41:30.828 + BBS Struct => Protobuf Binary => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + ================================================================================= + convert [duration] | 1000000 | 16.799µs | 20.3µs | 23.513µs | 19.77µs | 7.67462ms + << Report Entries +------------------------------ +• [0.001 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Binary Measures conversion time 1 conversion +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:384 + + Report Entries >> + Protobuf Binary => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:376 @ 02/24/25 22:42:38.476 + Protobuf Binary => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + ============================================================= + convert [duration] | 1 | 37µs | 37µs | 37µs | 0s | 37µs + << Report Entries +------------------------------ +• [0.058 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Binary Measures conversion time 1,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:385 + + Report Entries >> + Protobuf Binary => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:376 @ 02/24/25 22:42:38.476 + Protobuf Binary => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + ========================================================================== + convert [duration] | 1000 | 14µs | 15.6µs | 16.839µs | 6.457µs | 103.399µs + << Report Entries +------------------------------ +• [60.051 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Binary Measures conversion time 1,000,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:386 + + Report Entries >> + Protobuf Binary => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/conversion_test.go:376 @ 02/24/25 22:42:38.535 + Protobuf Binary => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + ================================================================================ + convert [duration] | 1000000 | 13.2µs | 15.8µs | 17.68µs | 12.206µs | 2.280577ms + << Report Entries +------------------------------ + +Ran 9 of 9 Specs in 183.058 seconds +SUCCESS! -- 9 Passed | 0 Failed | 0 Pending | 0 Skipped +PASS + +Ginkgo ran 1 suite in 3m3.983728627s +Test Suite Passed diff --git a/models/performance/results/google-protobuf.txt b/models/performance/results/google-protobuf.txt new file mode 100644 index 00000000..920f140d --- /dev/null +++ b/models/performance/results/google-protobuf.txt @@ -0,0 +1,301 @@ +Running Suite: Performance Suite - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance +========================================================================================================================= +Random Seed: 1740437021 + +Will run 24 of 24 specs +------------------------------ +• [0.002 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1 conversion +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:354 + + Report Entries >> + BBS Struct => Protobuf Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:346 @ 02/24/25 22:43:42.464 + BBS Struct => Protobuf Struct + Name | N | Min | Median | Mean | StdDev | Max + =========================================================================== + convert [duration] | 1 | 51.799µs | 51.799µs | 51.799µs | 0s | 51.799µs + << Report Entries +------------------------------ +• [0.062 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:355 + + Report Entries >> + BBS Struct => Protobuf Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:346 @ 02/24/25 22:43:42.465 + BBS Struct => Protobuf Struct + Name | N | Min | Median | Mean | StdDev | Max + ============================================================================ + convert [duration] | 1000 | 7.8µs | 9.1µs | 19.333µs | 46.236µs | 990.891µs + << Report Entries +------------------------------ +• [51.649 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1,000,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:356 + + Report Entries >> + BBS Struct => Protobuf Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:346 @ 02/24/25 22:43:42.528 + BBS Struct => Protobuf Struct + Name | N | Min | Median | Mean | StdDev | Max + ================================================================================ + convert [duration] | 1000000 | 7.5µs | 9.1µs | 10.584µs | 17.173µs | 5.894842ms + << Report Entries +------------------------------ +• [0.002 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1 conversion +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:358 + + Report Entries >> + BBS Struct => Protobuf Binary - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:346 @ 02/24/25 22:44:34.234 + BBS Struct => Protobuf Binary + Name | N | Min | Median | Mean | StdDev | Max + =============================================================================== + convert [duration] | 1 | 904.491µs | 904.491µs | 904.491µs | 0s | 904.491µs + << Report Entries +------------------------------ +• [0.064 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:359 + + Report Entries >> + BBS Struct => Protobuf Binary - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:346 @ 02/24/25 22:44:34.236 + BBS Struct => Protobuf Binary + Name | N | Min | Median | Mean | StdDev | Max + ================================================================================= + convert [duration] | 1000 | 17.899µs | 19.999µs | 22.638µs | 20.519µs | 541.794µs + << Report Entries +------------------------------ +• [62.503 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1,000,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:360 + + Report Entries >> + BBS Struct => Protobuf Binary - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:346 @ 02/24/25 22:44:34.3 + BBS Struct => Protobuf Binary + Name | N | Min | Median | Mean | StdDev | Max + ================================================================================== + convert [duration] | 1000000 | 17.499µs | 19.8µs | 21.65µs | 14.392µs | 1.718484ms + << Report Entries +------------------------------ +• [0.001 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1 conversion +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:362 + + Report Entries >> + BBS Struct => Protobuf Binary => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:346 @ 02/24/25 22:45:36.866 + BBS Struct => Protobuf Binary => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + =============================================================================== + convert [duration] | 1 | 110.199µs | 110.199µs | 110.199µs | 0s | 110.199µs + << Report Entries +------------------------------ +• [0.082 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:363 + + Report Entries >> + BBS Struct => Protobuf Binary => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:346 @ 02/24/25 22:45:36.867 + BBS Struct => Protobuf Binary => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + ============================================================================= + convert [duration] | 1000 | 32.2µs | 36µs | 40.084µs | 12.761µs | 141.099µs + << Report Entries +------------------------------ +• [81.441 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a BBS Plugin Struct Measures conversion time 1,000,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:364 + + Report Entries >> + BBS Struct => Protobuf Binary => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:346 @ 02/24/25 22:45:36.949 + BBS Struct => Protobuf Binary => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + =================================================================================== + convert [duration] | 1000000 | 31.5µs | 36.699µs | 40.024µs | 23.476µs | 7.043036ms + << Report Entries +------------------------------ +• [0.001 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Struct Measures conversion time 1 conversion +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:388 + + Report Entries >> + Protobuf Struct => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:380 @ 02/24/25 22:46:58.471 + Protobuf Struct => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + =================================================================== + convert [duration] | 1 | 11.9µs | 11.9µs | 11.9µs | 0s | 11.9µs + << Report Entries +------------------------------ +• [0.052 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Struct Measures conversion time 1,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:389 + + Report Entries >> + Protobuf Struct => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:380 @ 02/24/25 22:46:58.472 + Protobuf Struct => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + ============================================================================= + convert [duration] | 1000 | 7.9µs | 8.999µs | 10.734µs | 22.383µs | 641.195µs + << Report Entries +------------------------------ +• [50.232 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Struct Measures conversion time 1,000,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:390 + + Report Entries >> + Protobuf Struct => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:380 @ 02/24/25 22:46:58.524 + Protobuf Struct => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + ============================================================================== + convert [duration] | 1000000 | 7.5µs | 8.9µs | 9.768µs | 7.655µs | 1.780784ms + << Report Entries +------------------------------ +• [0.001 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Struct Measures conversion time 1 conversion +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:392 + + Report Entries >> + Protobuf Struct => Protobuf Binary - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:380 @ 02/24/25 22:47:48.812 + Protobuf Struct => Protobuf Binary + Name | N | Min | Median | Mean | StdDev | Max + =================================================================== + convert [duration] | 1 | 48.5µs | 48.5µs | 48.5µs | 0s | 48.5µs + << Report Entries +------------------------------ +• [0.060 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Struct Measures conversion time 1,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:393 + + Report Entries >> + Protobuf Struct => Protobuf Binary - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:380 @ 02/24/25 22:47:48.813 + Protobuf Struct => Protobuf Binary + Name | N | Min | Median | Mean | StdDev | Max + =========================================================================== + convert [duration] | 1000 | 15.6µs | 16.6µs | 17.979µs | 6.091µs | 78.699µs + << Report Entries +------------------------------ +• [57.886 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Struct Measures conversion time 1,000,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:394 + + Report Entries >> + Protobuf Struct => Protobuf Binary - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:380 @ 02/24/25 22:47:48.873 + Protobuf Struct => Protobuf Binary + Name | N | Min | Median | Mean | StdDev | Max + ================================================================================== + convert [duration] | 1000000 | 14.699µs | 16.5µs | 17.548µs | 9.828µs | 4.373362ms + << Report Entries +------------------------------ +• [0.001 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Struct Measures conversion time 1 conversion +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:396 + + Report Entries >> + Protobuf Struct => Protobuf Binary - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:380 @ 02/24/25 22:48:46.812 + Protobuf Struct => Protobuf Binary + Name | N | Min | Median | Mean | StdDev | Max + =========================================================================== + convert [duration] | 1 | 72.699µs | 72.699µs | 72.699µs | 0s | 72.699µs + << Report Entries +------------------------------ +• [0.074 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Struct Measures conversion time 1,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:397 + + Report Entries >> + Protobuf Struct => Protobuf Binary - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:380 @ 02/24/25 22:48:46.813 + Protobuf Struct => Protobuf Binary + Name | N | Min | Median | Mean | StdDev | Max + =============================================================================== + convert [duration] | 1000 | 27.4µs | 29.949µs | 32.653µs | 10.381µs | 158.399µs + << Report Entries +------------------------------ +• [73.342 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Struct Measures conversion time 1,000,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:398 + + Report Entries >> + Protobuf Struct => Protobuf Binary - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:380 @ 02/24/25 22:48:46.887 + Protobuf Struct => Protobuf Binary + Name | N | Min | Median | Mean | StdDev | Max + =============================================================================== + convert [duration] | 1000000 | 26µs | 30.1µs | 32.552µs | 14.917µs | 4.022467ms + << Report Entries +------------------------------ +• [0.001 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Binary Measures conversion time 1 conversion +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:424 + + Report Entries >> + Protobuf Binary => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:416 @ 02/24/25 22:50:00.307 + Protobuf Binary => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + =========================================================================== + convert [duration] | 1 | 85.499µs | 85.499µs | 85.499µs | 0s | 85.499µs + << Report Entries +------------------------------ +• [0.070 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Binary Measures conversion time 1,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:425 + + Report Entries >> + Protobuf Binary => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:416 @ 02/24/25 22:50:00.308 + Protobuf Binary => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + ============================================================================ + convert [duration] | 1000 | 22µs | 24.349µs | 26.517µs | 7.621µs | 113.099µs + << Report Entries +------------------------------ +• [66.740 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Binary Measures conversion time 1,000,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:426 + + Report Entries >> + Protobuf Binary => BBS Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:416 @ 02/24/25 22:50:00.378 + Protobuf Binary => BBS Struct + Name | N | Min | Median | Mean | StdDev | Max + ================================================================================= + convert [duration] | 1000000 | 19.9µs | 23.3µs | 25.655µs | 15.308µs | 5.960651ms + << Report Entries +------------------------------ +• [0.001 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Binary Measures conversion time 1 conversion +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:428 + + Report Entries >> + Protobuf Binary => Protobuf Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:416 @ 02/24/25 22:51:07.188 + Protobuf Binary => Protobuf Struct + Name | N | Min | Median | Mean | StdDev | Max + =================================================================== + convert [duration] | 1 | 39.9µs | 39.9µs | 39.9µs | 0s | 39.9µs + << Report Entries +------------------------------ +• [0.063 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Binary Measures conversion time 1,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:429 + + Report Entries >> + Protobuf Binary => Protobuf Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:416 @ 02/24/25 22:51:07.189 + Protobuf Binary => Protobuf Struct + Name | N | Min | Median | Mean | StdDev | Max + ============================================================================ + convert [duration] | 1000 | 17.9µs | 20.1µs | 21.688µs | 6.919µs | 132.998µs + << Report Entries +------------------------------ +• [63.271 seconds] +BBS Plugin Conversion: Desired LRP Conversion Performance Testing Starting with a Protobuf Binary Measures conversion time 1,000,000 conversions +/home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:430 + + Report Entries >> + Protobuf Binary => Protobuf Struct - /home/pivotal/workspace/diego-release/src/code.cloudfoundry.org/bbs/models/performance/bbs_plugin_test.go:416 @ 02/24/25 22:51:07.252 + Protobuf Binary => Protobuf Struct + Name | N | Min | Median | Mean | StdDev | Max + =================================================================================== + convert [duration] | 1000000 | 17.399µs | 20.399µs | 22.27µs | 12.74µs | 3.224974ms + << Report Entries +------------------------------ + +Ran 24 of 24 Specs in 508.129 seconds +SUCCESS! -- 24 Passed | 0 Failed | 0 Pending | 0 Skipped +PASS + +Ginkgo ran 1 suite in 8m29.286576729s +Test Suite Passed diff --git a/models/ping.pb.go b/models/ping.pb.go index 6acb0b54..bfd91c26 100644 --- a/models/ping.pb.go +++ b/models/ping.pb.go @@ -1,368 +1,124 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: ping.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type PingResponse struct { - Available bool `protobuf:"varint,1,opt,name=available,proto3" json:"available"` -} - -func (m *PingResponse) Reset() { *m = PingResponse{} } -func (*PingResponse) ProtoMessage() {} -func (*PingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_6d51d96c3ad891f5, []int{0} -} -func (m *PingResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PingResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PingResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PingResponse.Merge(m, src) -} -func (m *PingResponse) XXX_Size() int { - return m.Size() -} -func (m *PingResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PingResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PingResponse proto.InternalMessageInfo +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -func (m *PingResponse) GetAvailable() bool { - if m != nil { - return m.Available - } - return false +type ProtoPingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Available bool `protobuf:"varint,1,opt,name=available,proto3" json:"available,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { - proto.RegisterType((*PingResponse)(nil), "models.PingResponse") +func (x *ProtoPingResponse) Reset() { + *x = ProtoPingResponse{} + mi := &file_ping_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func init() { proto.RegisterFile("ping.proto", fileDescriptor_6d51d96c3ad891f5) } - -var fileDescriptor_6d51d96c3ad891f5 = []byte{ - // 181 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0xc8, 0xcc, 0x4b, - 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xcb, 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0x96, 0xd2, - 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, - 0x07, 0x4b, 0x27, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0xd1, 0xa6, 0x64, 0xcd, 0xc5, - 0x13, 0x90, 0x99, 0x97, 0x1e, 0x94, 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x2a, 0xa4, 0xcd, 0xc5, - 0x99, 0x58, 0x96, 0x98, 0x99, 0x93, 0x98, 0x94, 0x93, 0x2a, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe1, - 0xc4, 0xfb, 0xea, 0x9e, 0x3c, 0x42, 0x30, 0x08, 0xc1, 0x74, 0x32, 0xb9, 0xf0, 0x50, 0x8e, 0xe1, - 0xc6, 0x43, 0x39, 0x86, 0x0f, 0x0f, 0xe5, 0x18, 0x1b, 0x1e, 0xc9, 0x31, 0xae, 0x78, 0x24, 0xc7, - 0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xbe, 0x78, 0x24, - 0xc7, 0xf0, 0xe1, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, - 0x2c, 0xc7, 0x90, 0xc4, 0x06, 0xb6, 0xd9, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x41, 0x03, - 0x47, 0xbe, 0x00, 0x00, 0x00, +func (x *ProtoPingResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *PingResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoPingResponse) ProtoMessage() {} - that1, ok := that.(*PingResponse) - if !ok { - that2, ok := that.(PingResponse) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoPingResponse) ProtoReflect() protoreflect.Message { + mi := &file_ping_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Available != that1.Available { - return false - } - return true -} -func (this *PingResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.PingResponse{") - s = append(s, "Available: "+fmt.Sprintf("%#v", this.Available)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringPing(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *PingResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *PingResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoPingResponse.ProtoReflect.Descriptor instead. +func (*ProtoPingResponse) Descriptor() ([]byte, []int) { + return file_ping_proto_rawDescGZIP(), []int{0} } -func (m *PingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Available { - i-- - if m.Available { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 +func (x *ProtoPingResponse) GetAvailable() bool { + if x != nil { + return x.Available } - return len(dAtA) - i, nil -} - -func encodeVarintPing(dAtA []byte, offset int, v uint64) int { - offset -= sovPing(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PingResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Available { - n += 2 - } - return n + return false } -func sovPing(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPing(x uint64) (n int) { - return sovPing(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *PingResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PingResponse{`, - `Available:` + fmt.Sprintf("%v", this.Available) + `,`, - `}`, - }, "") - return s -} -func valueToStringPing(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *PingResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPing - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PingResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PingResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Available", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPing - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Available = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipPing(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPing - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var File_ping_proto protoreflect.FileDescriptor - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPing(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPing - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPing - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPing - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthPing - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPing - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPing - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +const file_ping_proto_rawDesc = "" + + "\n" + + "\n" + + "ping.proto\x12\x06models\x1a\tbbs.proto\"6\n" + + "\x11ProtoPingResponse\x12!\n" + + "\tavailable\x18\x01 \x01(\bB\x03\xc0>\x01R\tavailableB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthPing = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPing = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPing = fmt.Errorf("proto: unexpected end of group") + file_ping_proto_rawDescOnce sync.Once + file_ping_proto_rawDescData []byte ) + +func file_ping_proto_rawDescGZIP() []byte { + file_ping_proto_rawDescOnce.Do(func() { + file_ping_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ping_proto_rawDesc), len(file_ping_proto_rawDesc))) + }) + return file_ping_proto_rawDescData +} + +var file_ping_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_ping_proto_goTypes = []any{ + (*ProtoPingResponse)(nil), // 0: models.ProtoPingResponse +} +var file_ping_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_ping_proto_init() } +func file_ping_proto_init() { + if File_ping_proto != nil { + return + } + file_bbs_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_ping_proto_rawDesc), len(file_ping_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ping_proto_goTypes, + DependencyIndexes: file_ping_proto_depIdxs, + MessageInfos: file_ping_proto_msgTypes, + }.Build() + File_ping_proto = out.File + file_ping_proto_goTypes = nil + file_ping_proto_depIdxs = nil +} diff --git a/models/ping.proto b/models/ping.proto index 2841864f..5afb0798 100644 --- a/models/ping.proto +++ b/models/ping.proto @@ -1,9 +1,10 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; -message PingResponse { - bool available = 1 [(gogoproto.jsontag) = "available"]; +message ProtoPingResponse { + bool available = 1 [json_name = "available", (bbs.bbs_json_always_emit) = true]; } diff --git a/models/ping_bbs.pb.go b/models/ping_bbs.pb.go new file mode 100644 index 00000000..8e730f66 --- /dev/null +++ b/models/ping_bbs.pb.go @@ -0,0 +1,96 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: ping.proto + +package models + +// Prevent copylock errors when using ProtoPingResponse directly +type PingResponse struct { + Available bool `json:"available"` +} + +func (this *PingResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*PingResponse) + if !ok { + that2, ok := that.(PingResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Available != that1.Available { + return false + } + return true +} +func (m *PingResponse) GetAvailable() bool { + if m != nil { + return m.Available + } + var defaultValue bool + defaultValue = false + return defaultValue +} +func (m *PingResponse) SetAvailable(value bool) { + if m != nil { + m.Available = value + } +} +func (x *PingResponse) ToProto() *ProtoPingResponse { + if x == nil { + return nil + } + + proto := &ProtoPingResponse{ + Available: x.Available, + } + return proto +} + +func (x *ProtoPingResponse) FromProto() *PingResponse { + if x == nil { + return nil + } + + copysafe := &PingResponse{ + Available: x.Available, + } + return copysafe +} + +func PingResponseToProtoSlice(values []*PingResponse) []*ProtoPingResponse { + if values == nil { + return nil + } + result := make([]*ProtoPingResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func PingResponseFromProtoSlice(values []*ProtoPingResponse) []*PingResponse { + if values == nil { + return nil + } + result := make([]*PingResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/routes.go b/models/routes.go index 6097fe12..c7dffde6 100644 --- a/models/routes.go +++ b/models/routes.go @@ -1,16 +1,34 @@ package models import ( - "bytes" + bytes "bytes" "encoding/json" ) type Routes map[string]*json.RawMessage -func (r *Routes) protoRoutes() *ProtoRoutes { +func ParseRoutes(b map[string][]byte) *Routes { + if b == nil { + return nil + } + + routes := Routes{} + for k, v := range b { + raw := json.RawMessage(v) + routes[k] = &raw + } + + return &routes +} + +func (r *Routes) ToProto() *ProtoRoutes { + if r == nil { + return nil + } pr := &ProtoRoutes{ Routes: map[string][]byte{}, } + // pr := make(map[string][]byte) for k, v := range *r { pr.Routes[k] = *v @@ -19,44 +37,24 @@ func (r *Routes) protoRoutes() *ProtoRoutes { return pr } -func (r *Routes) Marshal() ([]byte, error) { - return r.protoRoutes().Marshal() -} - -func (r *Routes) MarshalTo(data []byte) (n int, err error) { - return r.protoRoutes().MarshalTo(data) -} - -func (r *Routes) Unmarshal(data []byte) error { - pr := &ProtoRoutes{} - err := pr.Unmarshal(data) - if err != nil { - return err - } - - if pr.Routes == nil { +func (pr *ProtoRoutes) FromProto() *Routes { + if pr == nil || pr.Routes == nil || len(pr.Routes) == 0 { return nil } - routes := map[string]*json.RawMessage{} + r := Routes{} for k, v := range pr.Routes { raw := json.RawMessage(v) - routes[k] = &raw + r[k] = &raw } - *r = routes - return nil -} - -func (r *Routes) Size() int { - if r == nil { - return 0 - } - - return r.protoRoutes().Size() + return &r } func (r *Routes) Equal(other Routes) bool { + if other == nil { + return r == nil + } for k, v := range *r { if !bytes.Equal(*v, *other[k]) { return false diff --git a/models/routes_test.go b/models/routes_test.go index 42a1860d..eba2c820 100644 --- a/models/routes_test.go +++ b/models/routes_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "code.cloudfoundry.org/bbs/models" - "github.com/gogo/protobuf/proto" + "google.golang.org/protobuf/proto" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -12,29 +12,48 @@ import ( var _ = Describe("Routes", func() { var update models.DesiredLRPUpdate - var aJson models.DesiredLRPUpdate + var aJson models.ProtoDesiredLRPUpdate var aProto models.DesiredLRPUpdate + var resultProto models.ProtoDesiredLRPUpdate itSerializes := func(routes *models.Routes) { BeforeEach(func() { + update = models.DesiredLRPUpdate{ Routes: routes, } + /* + The point of these tests is to go from non-proto struct + to JSON/Protobuf (binary) representation and back. + With the new protobuf requirements we have to add a step + to convert to the Proto struct before we can get the + Proto binary representation. + + Old way: + DesiredLRPUpdate -> Protobuf binary -> DesiredLRPUpdate + + New way: + DesiredLRPUpdate -> ProtoDesiredLRPUpdate -> Protobuf binary -> ProtoDesiredLRPUpdate -> DesiredLRPUpdate + + 2024-05-15: It remains to be seen if this extra layer is going to cause performance issues + */ - b, err := json.Marshal(update) + b, err := json.Marshal(update.ToProto()) Expect(err).NotTo(HaveOccurred()) err = json.Unmarshal(b, &aJson) Expect(err).NotTo(HaveOccurred()) - b, err = proto.Marshal(&update) + protoUpdate := update.ToProto() + b, err = proto.Marshal(protoUpdate) Expect(err).NotTo(HaveOccurred()) - err = proto.Unmarshal(b, &aProto) + err = proto.Unmarshal(b, &resultProto) Expect(err).NotTo(HaveOccurred()) + aProto = *resultProto.FromProto() // make sure we convert back to non-proto }) It("marshals JSON properly", func() { - Expect(update.Equal(&aJson)).To(BeTrue()) - Expect(update).To(Equal(aJson)) + Expect(update.Equal(aJson.FromProto())).To(BeTrue()) + Expect(update).To(Equal(*aJson.FromProto())) }) It("marshals Proto properly", func() { diff --git a/models/security_group.pb.go b/models/security_group.pb.go index 87b40e03..afd5210d 100644 --- a/models/security_group.pb.go +++ b/models/security_group.pb.go @@ -1,1282 +1,293 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: security_group.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -type PortRange struct { - Start uint32 `protobuf:"varint,1,opt,name=start,proto3" json:"start"` - End uint32 `protobuf:"varint,2,opt,name=end,proto3" json:"end"` +type ProtoPortRange struct { + state protoimpl.MessageState `protogen:"open.v1"` + Start uint32 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` + End uint32 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *PortRange) Reset() { *m = PortRange{} } -func (*PortRange) ProtoMessage() {} -func (*PortRange) Descriptor() ([]byte, []int) { - return fileDescriptor_ff465b8f55f128fd, []int{0} -} -func (m *PortRange) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PortRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PortRange.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PortRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_PortRange.Merge(m, src) -} -func (m *PortRange) XXX_Size() int { - return m.Size() -} -func (m *PortRange) XXX_DiscardUnknown() { - xxx_messageInfo_PortRange.DiscardUnknown(m) +func (x *ProtoPortRange) Reset() { + *x = ProtoPortRange{} + mi := &file_security_group_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -var xxx_messageInfo_PortRange proto.InternalMessageInfo - -func (m *PortRange) GetStart() uint32 { - if m != nil { - return m.Start - } - return 0 +func (x *ProtoPortRange) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PortRange) GetEnd() uint32 { - if m != nil { - return m.End - } - return 0 -} +func (*ProtoPortRange) ProtoMessage() {} -type ICMPInfo struct { - Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type"` - Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code"` -} - -func (m *ICMPInfo) Reset() { *m = ICMPInfo{} } -func (*ICMPInfo) ProtoMessage() {} -func (*ICMPInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ff465b8f55f128fd, []int{1} -} -func (m *ICMPInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ICMPInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ICMPInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoPortRange) ProtoReflect() protoreflect.Message { + mi := &file_security_group_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *ICMPInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ICMPInfo.Merge(m, src) -} -func (m *ICMPInfo) XXX_Size() int { - return m.Size() -} -func (m *ICMPInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ICMPInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ICMPInfo proto.InternalMessageInfo -func (m *ICMPInfo) GetType() int32 { - if m != nil { - return m.Type - } - return 0 +// Deprecated: Use ProtoPortRange.ProtoReflect.Descriptor instead. +func (*ProtoPortRange) Descriptor() ([]byte, []int) { + return file_security_group_proto_rawDescGZIP(), []int{0} } -func (m *ICMPInfo) GetCode() int32 { - if m != nil { - return m.Code +func (x *ProtoPortRange) GetStart() uint32 { + if x != nil { + return x.Start } return 0 } -type SecurityGroupRule struct { - Protocol string `protobuf:"bytes,1,opt,name=protocol,proto3" json:"protocol,omitempty"` - Destinations []string `protobuf:"bytes,2,rep,name=destinations,proto3" json:"destinations,omitempty"` - Ports []uint32 `protobuf:"varint,3,rep,name=ports,proto3" json:"ports,omitempty"` - PortRange *PortRange `protobuf:"bytes,4,opt,name=port_range,json=portRange,proto3" json:"port_range,omitempty"` - IcmpInfo *ICMPInfo `protobuf:"bytes,5,opt,name=icmp_info,json=icmpInfo,proto3" json:"icmp_info,omitempty"` - Log bool `protobuf:"varint,6,opt,name=log,proto3" json:"log"` - Annotations []string `protobuf:"bytes,7,rep,name=annotations,proto3" json:"annotations,omitempty"` -} - -func (m *SecurityGroupRule) Reset() { *m = SecurityGroupRule{} } -func (*SecurityGroupRule) ProtoMessage() {} -func (*SecurityGroupRule) Descriptor() ([]byte, []int) { - return fileDescriptor_ff465b8f55f128fd, []int{2} -} -func (m *SecurityGroupRule) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SecurityGroupRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SecurityGroupRule.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SecurityGroupRule) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityGroupRule.Merge(m, src) -} -func (m *SecurityGroupRule) XXX_Size() int { - return m.Size() -} -func (m *SecurityGroupRule) XXX_DiscardUnknown() { - xxx_messageInfo_SecurityGroupRule.DiscardUnknown(m) -} - -var xxx_messageInfo_SecurityGroupRule proto.InternalMessageInfo - -func (m *SecurityGroupRule) GetProtocol() string { - if m != nil { - return m.Protocol - } - return "" -} - -func (m *SecurityGroupRule) GetDestinations() []string { - if m != nil { - return m.Destinations - } - return nil -} - -func (m *SecurityGroupRule) GetPorts() []uint32 { - if m != nil { - return m.Ports +func (x *ProtoPortRange) GetEnd() uint32 { + if x != nil { + return x.End } - return nil -} - -func (m *SecurityGroupRule) GetPortRange() *PortRange { - if m != nil { - return m.PortRange - } - return nil -} - -func (m *SecurityGroupRule) GetIcmpInfo() *ICMPInfo { - if m != nil { - return m.IcmpInfo - } - return nil -} - -func (m *SecurityGroupRule) GetLog() bool { - if m != nil { - return m.Log - } - return false + return 0 } -func (m *SecurityGroupRule) GetAnnotations() []string { - if m != nil { - return m.Annotations - } - return nil +type ProtoICMPInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` + Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { - proto.RegisterType((*PortRange)(nil), "models.PortRange") - proto.RegisterType((*ICMPInfo)(nil), "models.ICMPInfo") - proto.RegisterType((*SecurityGroupRule)(nil), "models.SecurityGroupRule") +func (x *ProtoICMPInfo) Reset() { + *x = ProtoICMPInfo{} + mi := &file_security_group_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func init() { proto.RegisterFile("security_group.proto", fileDescriptor_ff465b8f55f128fd) } - -var fileDescriptor_ff465b8f55f128fd = []byte{ - // 402 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xb1, 0x6e, 0xdb, 0x30, - 0x10, 0x86, 0x45, 0x2b, 0x76, 0x24, 0xa6, 0x01, 0x12, 0xa2, 0x03, 0x13, 0x14, 0x94, 0xa0, 0x49, - 0x4b, 0x94, 0xa2, 0xed, 0x13, 0xa8, 0x40, 0x83, 0x0c, 0x05, 0x02, 0xf6, 0x01, 0x0c, 0x59, 0xa2, - 0x55, 0x01, 0x32, 0x4f, 0x90, 0xa8, 0x21, 0x5b, 0xf7, 0x2e, 0x7d, 0x8c, 0x3e, 0x4a, 0x47, 0x8f, - 0x99, 0x8c, 0x5a, 0x5e, 0x0a, 0x4f, 0x79, 0x84, 0x82, 0x27, 0xc7, 0x68, 0x97, 0x13, 0xff, 0xff, - 0xd7, 0x1d, 0xee, 0x3e, 0xfa, 0xba, 0x53, 0x79, 0xdf, 0x56, 0xe6, 0x71, 0x5e, 0xb6, 0xd0, 0x37, - 0x49, 0xd3, 0x82, 0x01, 0x36, 0x5b, 0x41, 0xa1, 0xea, 0xee, 0xfa, 0xa6, 0xac, 0xcc, 0xd7, 0x7e, - 0x91, 0xe4, 0xb0, 0xba, 0x2d, 0xa1, 0x84, 0x5b, 0x8c, 0x17, 0xfd, 0x12, 0x15, 0x0a, 0x7c, 0x8d, - 0x6d, 0xd1, 0x1d, 0xf5, 0x1f, 0xa0, 0x35, 0x32, 0xd3, 0xa5, 0x62, 0x01, 0x9d, 0x76, 0x26, 0x6b, - 0x0d, 0x27, 0x21, 0x89, 0xcf, 0x53, 0x7f, 0xbf, 0x09, 0x46, 0x43, 0x8e, 0x1f, 0x76, 0x45, 0x5d, - 0xa5, 0x0b, 0x3e, 0xc1, 0xf8, 0x74, 0xbf, 0x09, 0xac, 0x94, 0xb6, 0x44, 0x9f, 0xa8, 0x77, 0xff, - 0xf1, 0xf3, 0xc3, 0xbd, 0x5e, 0x02, 0x7b, 0x43, 0x4f, 0xcc, 0x63, 0xa3, 0x70, 0xcc, 0x34, 0xf5, - 0xf6, 0x9b, 0x00, 0xb5, 0xc4, 0x6a, 0xd3, 0x1c, 0x0a, 0x85, 0x53, 0x0e, 0xa9, 0xd5, 0x12, 0x6b, - 0xf4, 0x7d, 0x42, 0x2f, 0xbf, 0x1c, 0x0e, 0xbc, 0xb3, 0xf7, 0xc9, 0xbe, 0x56, 0xec, 0x9a, 0x7a, - 0xb8, 0x6f, 0x0e, 0x35, 0x4e, 0xf5, 0xe5, 0x51, 0xb3, 0x88, 0xbe, 0x2a, 0x54, 0x67, 0x2a, 0x9d, - 0x99, 0x0a, 0x74, 0xc7, 0x27, 0xa1, 0x1b, 0xfb, 0xf2, 0x3f, 0x8f, 0x71, 0x3a, 0x6d, 0xa0, 0x35, - 0x1d, 0x77, 0x43, 0x37, 0x3e, 0x4f, 0x27, 0x17, 0x8e, 0x1c, 0x0d, 0xf6, 0x96, 0x52, 0xfb, 0x98, - 0xb7, 0x96, 0x00, 0x3f, 0x09, 0x49, 0x7c, 0xf6, 0xee, 0x32, 0x19, 0x61, 0x26, 0x47, 0x34, 0xd2, - 0x6f, 0x8e, 0x94, 0x6e, 0xa8, 0x5f, 0xe5, 0xab, 0x66, 0x5e, 0xe9, 0x25, 0xf0, 0x29, 0x36, 0x5c, - 0xbc, 0x34, 0xbc, 0x20, 0x90, 0x9e, 0xfd, 0x05, 0x61, 0x5c, 0x51, 0xb7, 0x86, 0x92, 0xcf, 0x42, - 0x12, 0x7b, 0x23, 0xb3, 0x1a, 0x4a, 0x69, 0x0b, 0x0b, 0xe9, 0x59, 0xa6, 0x35, 0x98, 0xc3, 0xe2, - 0xa7, 0xb8, 0xf8, 0xbf, 0x56, 0xfa, 0x61, 0xbd, 0x15, 0xce, 0xd3, 0x56, 0x38, 0xcf, 0x5b, 0x41, - 0xbe, 0x0d, 0x82, 0xfc, 0x1c, 0x04, 0xf9, 0x35, 0x08, 0xb2, 0x1e, 0x04, 0xf9, 0x3d, 0x08, 0xf2, - 0x67, 0x10, 0xce, 0xf3, 0x20, 0xc8, 0x8f, 0x9d, 0x70, 0xd6, 0x3b, 0xe1, 0x3c, 0xed, 0x84, 0xb3, - 0x98, 0x21, 0x9b, 0xf7, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xfa, 0xd0, 0x92, 0x85, 0x2a, 0x02, - 0x00, 0x00, +func (x *ProtoICMPInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *PortRange) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoICMPInfo) ProtoMessage() {} - that1, ok := that.(*PortRange) - if !ok { - that2, ok := that.(PortRange) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoICMPInfo) ProtoReflect() protoreflect.Message { + mi := &file_security_group_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Start != that1.Start { - return false - } - if this.End != that1.End { - return false - } - return true + return mi.MessageOf(x) } -func (this *ICMPInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ICMPInfo) - if !ok { - that2, ok := that.(ICMPInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Type != that1.Type { - return false - } - if this.Code != that1.Code { - return false - } - return true +// Deprecated: Use ProtoICMPInfo.ProtoReflect.Descriptor instead. +func (*ProtoICMPInfo) Descriptor() ([]byte, []int) { + return file_security_group_proto_rawDescGZIP(), []int{1} } -func (this *SecurityGroupRule) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*SecurityGroupRule) - if !ok { - that2, ok := that.(SecurityGroupRule) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Protocol != that1.Protocol { - return false - } - if len(this.Destinations) != len(that1.Destinations) { - return false - } - for i := range this.Destinations { - if this.Destinations[i] != that1.Destinations[i] { - return false - } - } - if len(this.Ports) != len(that1.Ports) { - return false - } - for i := range this.Ports { - if this.Ports[i] != that1.Ports[i] { - return false - } - } - if !this.PortRange.Equal(that1.PortRange) { - return false - } - if !this.IcmpInfo.Equal(that1.IcmpInfo) { - return false +func (x *ProtoICMPInfo) GetType() int32 { + if x != nil { + return x.Type } - if this.Log != that1.Log { - return false - } - if len(this.Annotations) != len(that1.Annotations) { - return false - } - for i := range this.Annotations { - if this.Annotations[i] != that1.Annotations[i] { - return false - } - } - return true -} -func (this *PortRange) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.PortRange{") - s = append(s, "Start: "+fmt.Sprintf("%#v", this.Start)+",\n") - s = append(s, "End: "+fmt.Sprintf("%#v", this.End)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ICMPInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.ICMPInfo{") - s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") - s = append(s, "Code: "+fmt.Sprintf("%#v", this.Code)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SecurityGroupRule) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&models.SecurityGroupRule{") - s = append(s, "Protocol: "+fmt.Sprintf("%#v", this.Protocol)+",\n") - s = append(s, "Destinations: "+fmt.Sprintf("%#v", this.Destinations)+",\n") - s = append(s, "Ports: "+fmt.Sprintf("%#v", this.Ports)+",\n") - if this.PortRange != nil { - s = append(s, "PortRange: "+fmt.Sprintf("%#v", this.PortRange)+",\n") - } - if this.IcmpInfo != nil { - s = append(s, "IcmpInfo: "+fmt.Sprintf("%#v", this.IcmpInfo)+",\n") - } - s = append(s, "Log: "+fmt.Sprintf("%#v", this.Log)+",\n") - s = append(s, "Annotations: "+fmt.Sprintf("%#v", this.Annotations)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringSecurityGroup(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *PortRange) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PortRange) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PortRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.End != 0 { - i = encodeVarintSecurityGroup(dAtA, i, uint64(m.End)) - i-- - dAtA[i] = 0x10 - } - if m.Start != 0 { - i = encodeVarintSecurityGroup(dAtA, i, uint64(m.Start)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil + return 0 } -func (m *ICMPInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoICMPInfo) GetCode() int32 { + if x != nil { + return x.Code } - return dAtA[:n], nil + return 0 } -func (m *ICMPInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type ProtoSecurityGroupRule struct { + state protoimpl.MessageState `protogen:"open.v1"` + Protocol string `protobuf:"bytes,1,opt,name=protocol,proto3" json:"protocol,omitempty"` + Destinations []string `protobuf:"bytes,2,rep,name=destinations,proto3" json:"destinations,omitempty"` + Ports []uint32 `protobuf:"varint,3,rep,name=ports,proto3" json:"ports,omitempty"` + PortRange *ProtoPortRange `protobuf:"bytes,4,opt,name=port_range,proto3" json:"port_range,omitempty"` + IcmpInfo *ProtoICMPInfo `protobuf:"bytes,5,opt,name=icmp_info,proto3" json:"icmp_info,omitempty"` + Log bool `protobuf:"varint,6,opt,name=log,proto3" json:"log,omitempty"` + Annotations []string `protobuf:"bytes,7,rep,name=annotations,proto3" json:"annotations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ICMPInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Code != 0 { - i = encodeVarintSecurityGroup(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x10 - } - if m.Type != 0 { - i = encodeVarintSecurityGroup(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil +func (x *ProtoSecurityGroupRule) Reset() { + *x = ProtoSecurityGroupRule{} + mi := &file_security_group_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *SecurityGroupRule) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *ProtoSecurityGroupRule) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SecurityGroupRule) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func (*ProtoSecurityGroupRule) ProtoMessage() {} -func (m *SecurityGroupRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Annotations) > 0 { - for iNdEx := len(m.Annotations) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Annotations[iNdEx]) - copy(dAtA[i:], m.Annotations[iNdEx]) - i = encodeVarintSecurityGroup(dAtA, i, uint64(len(m.Annotations[iNdEx]))) - i-- - dAtA[i] = 0x3a - } - } - if m.Log { - i-- - if m.Log { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if m.IcmpInfo != nil { - { - size, err := m.IcmpInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSecurityGroup(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.PortRange != nil { - { - size, err := m.PortRange.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSecurityGroup(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.Ports) > 0 { - for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintSecurityGroup(dAtA, i, uint64(m.Ports[iNdEx])) - i-- - dAtA[i] = 0x18 - } - } - if len(m.Destinations) > 0 { - for iNdEx := len(m.Destinations) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Destinations[iNdEx]) - copy(dAtA[i:], m.Destinations[iNdEx]) - i = encodeVarintSecurityGroup(dAtA, i, uint64(len(m.Destinations[iNdEx]))) - i-- - dAtA[i] = 0x12 +func (x *ProtoSecurityGroupRule) ProtoReflect() protoreflect.Message { + mi := &file_security_group_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if len(m.Protocol) > 0 { - i -= len(m.Protocol) - copy(dAtA[i:], m.Protocol) - i = encodeVarintSecurityGroup(dAtA, i, uint64(len(m.Protocol))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func encodeVarintSecurityGroup(dAtA []byte, offset int, v uint64) int { - offset -= sovSecurityGroup(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PortRange) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Start != 0 { - n += 1 + sovSecurityGroup(uint64(m.Start)) - } - if m.End != 0 { - n += 1 + sovSecurityGroup(uint64(m.End)) - } - return n +// Deprecated: Use ProtoSecurityGroupRule.ProtoReflect.Descriptor instead. +func (*ProtoSecurityGroupRule) Descriptor() ([]byte, []int) { + return file_security_group_proto_rawDescGZIP(), []int{2} } -func (m *ICMPInfo) Size() (n int) { - if m == nil { - return 0 +func (x *ProtoSecurityGroupRule) GetProtocol() string { + if x != nil { + return x.Protocol } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovSecurityGroup(uint64(m.Type)) - } - if m.Code != 0 { - n += 1 + sovSecurityGroup(uint64(m.Code)) - } - return n + return "" } -func (m *SecurityGroupRule) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Protocol) - if l > 0 { - n += 1 + l + sovSecurityGroup(uint64(l)) - } - if len(m.Destinations) > 0 { - for _, s := range m.Destinations { - l = len(s) - n += 1 + l + sovSecurityGroup(uint64(l)) - } - } - if len(m.Ports) > 0 { - for _, e := range m.Ports { - n += 1 + sovSecurityGroup(uint64(e)) - } - } - if m.PortRange != nil { - l = m.PortRange.Size() - n += 1 + l + sovSecurityGroup(uint64(l)) - } - if m.IcmpInfo != nil { - l = m.IcmpInfo.Size() - n += 1 + l + sovSecurityGroup(uint64(l)) - } - if m.Log { - n += 2 +func (x *ProtoSecurityGroupRule) GetDestinations() []string { + if x != nil { + return x.Destinations } - if len(m.Annotations) > 0 { - for _, s := range m.Annotations { - l = len(s) - n += 1 + l + sovSecurityGroup(uint64(l)) - } - } - return n + return nil } -func sovSecurityGroup(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSecurityGroup(x uint64) (n int) { - return sovSecurityGroup(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *PortRange) String() string { - if this == nil { - return "nil" +func (x *ProtoSecurityGroupRule) GetPorts() []uint32 { + if x != nil { + return x.Ports } - s := strings.Join([]string{`&PortRange{`, - `Start:` + fmt.Sprintf("%v", this.Start) + `,`, - `End:` + fmt.Sprintf("%v", this.End) + `,`, - `}`, - }, "") - return s -} -func (this *ICMPInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ICMPInfo{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Code:` + fmt.Sprintf("%v", this.Code) + `,`, - `}`, - }, "") - return s -} -func (this *SecurityGroupRule) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SecurityGroupRule{`, - `Protocol:` + fmt.Sprintf("%v", this.Protocol) + `,`, - `Destinations:` + fmt.Sprintf("%v", this.Destinations) + `,`, - `Ports:` + fmt.Sprintf("%v", this.Ports) + `,`, - `PortRange:` + strings.Replace(this.PortRange.String(), "PortRange", "PortRange", 1) + `,`, - `IcmpInfo:` + strings.Replace(this.IcmpInfo.String(), "ICMPInfo", "ICMPInfo", 1) + `,`, - `Log:` + fmt.Sprintf("%v", this.Log) + `,`, - `Annotations:` + fmt.Sprintf("%v", this.Annotations) + `,`, - `}`, - }, "") - return s -} -func valueToStringSecurityGroup(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) + return nil } -func (m *PortRange) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PortRange: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PortRange: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) - } - m.Start = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Start |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) - } - m.End = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.End |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSecurityGroup(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSecurityGroup - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoSecurityGroupRule) GetPortRange() *ProtoPortRange { + if x != nil { + return x.PortRange } return nil } -func (m *ICMPInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ICMPInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ICMPInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSecurityGroup(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSecurityGroup - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoSecurityGroupRule) GetIcmpInfo() *ProtoICMPInfo { + if x != nil { + return x.IcmpInfo } return nil } -func (m *SecurityGroupRule) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SecurityGroupRule: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SecurityGroupRule: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSecurityGroup - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSecurityGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Protocol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Destinations", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSecurityGroup - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSecurityGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Destinations = append(m.Destinations, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType == 0 { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Ports = append(m.Ports, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthSecurityGroup - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthSecurityGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Ports) == 0 { - m.Ports = make([]uint32, 0, elementCount) - } - for iNdEx < postIndex { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Ports = append(m.Ports, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortRange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSecurityGroup - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSecurityGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PortRange == nil { - m.PortRange = &PortRange{} - } - if err := m.PortRange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IcmpInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSecurityGroup - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSecurityGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.IcmpInfo == nil { - m.IcmpInfo = &ICMPInfo{} - } - if err := m.IcmpInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Log = bool(v != 0) - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSecurityGroup - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSecurityGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Annotations = append(m.Annotations, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSecurityGroup(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSecurityGroup - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoSecurityGroupRule) GetLog() bool { + if x != nil { + return x.Log } - return nil + return false } -func skipSecurityGroup(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSecurityGroup - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSecurityGroup - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSecurityGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSecurityGroup - } - if depth == 0 { - return iNdEx, nil - } + +func (x *ProtoSecurityGroupRule) GetAnnotations() []string { + if x != nil { + return x.Annotations } - return 0, io.ErrUnexpectedEOF + return nil } +var File_security_group_proto protoreflect.FileDescriptor + +const file_security_group_proto_rawDesc = "" + + "\n" + + "\x14security_group.proto\x12\x06models\x1a\tbbs.proto\"B\n" + + "\x0eProtoPortRange\x12\x19\n" + + "\x05start\x18\x01 \x01(\rB\x03\xc0>\x01R\x05start\x12\x15\n" + + "\x03end\x18\x02 \x01(\rB\x03\xc0>\x01R\x03end\"A\n" + + "\rProtoICMPInfo\x12\x17\n" + + "\x04type\x18\x01 \x01(\x05B\x03\xc0>\x01R\x04type\x12\x17\n" + + "\x04code\x18\x02 \x01(\x05B\x03\xc0>\x01R\x04code\"\x98\x02\n" + + "\x16ProtoSecurityGroupRule\x12\x1a\n" + + "\bprotocol\x18\x01 \x01(\tR\bprotocol\x12\"\n" + + "\fdestinations\x18\x02 \x03(\tR\fdestinations\x12\x18\n" + + "\x05ports\x18\x03 \x03(\rB\x02\x10\x00R\x05ports\x126\n" + + "\n" + + "port_range\x18\x04 \x01(\v2\x16.models.ProtoPortRangeR\n" + + "port_range\x123\n" + + "\ticmp_info\x18\x05 \x01(\v2\x15.models.ProtoICMPInfoR\ticmp_info\x12\x15\n" + + "\x03log\x18\x06 \x01(\bB\x03\xc0>\x01R\x03log\x12 \n" + + "\vannotations\x18\a \x03(\tR\vannotationsB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" + var ( - ErrInvalidLengthSecurityGroup = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSecurityGroup = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSecurityGroup = fmt.Errorf("proto: unexpected end of group") + file_security_group_proto_rawDescOnce sync.Once + file_security_group_proto_rawDescData []byte ) + +func file_security_group_proto_rawDescGZIP() []byte { + file_security_group_proto_rawDescOnce.Do(func() { + file_security_group_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_security_group_proto_rawDesc), len(file_security_group_proto_rawDesc))) + }) + return file_security_group_proto_rawDescData +} + +var file_security_group_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_security_group_proto_goTypes = []any{ + (*ProtoPortRange)(nil), // 0: models.ProtoPortRange + (*ProtoICMPInfo)(nil), // 1: models.ProtoICMPInfo + (*ProtoSecurityGroupRule)(nil), // 2: models.ProtoSecurityGroupRule +} +var file_security_group_proto_depIdxs = []int32{ + 0, // 0: models.ProtoSecurityGroupRule.port_range:type_name -> models.ProtoPortRange + 1, // 1: models.ProtoSecurityGroupRule.icmp_info:type_name -> models.ProtoICMPInfo + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_security_group_proto_init() } +func file_security_group_proto_init() { + if File_security_group_proto != nil { + return + } + file_bbs_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_security_group_proto_rawDesc), len(file_security_group_proto_rawDesc)), + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_security_group_proto_goTypes, + DependencyIndexes: file_security_group_proto_depIdxs, + MessageInfos: file_security_group_proto_msgTypes, + }.Build() + File_security_group_proto = out.File + file_security_group_proto_goTypes = nil + file_security_group_proto_depIdxs = nil +} diff --git a/models/security_group.proto b/models/security_group.proto index ad28c29c..79188c39 100644 --- a/models/security_group.proto +++ b/models/security_group.proto @@ -1,25 +1,26 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; -message PortRange { - uint32 start = 1 [(gogoproto.jsontag) = "start"]; - uint32 end = 2 [(gogoproto.jsontag) = "end"]; +message ProtoPortRange { + uint32 start = 1 [json_name = "start", (bbs.bbs_json_always_emit) = true]; + uint32 end = 2 [json_name = "end", (bbs.bbs_json_always_emit) = true]; } -message ICMPInfo { - int32 type = 1 [(gogoproto.jsontag) = "type"]; - int32 code = 2 [(gogoproto.jsontag) = "code"]; +message ProtoICMPInfo { + int32 type = 1 [json_name = "type", (bbs.bbs_json_always_emit) = true]; + int32 code = 2 [json_name = "code", (bbs.bbs_json_always_emit) = true]; } -message SecurityGroupRule { - string protocol = 1; - repeated string destinations = 2; - repeated uint32 ports = 3 [packed = false]; - PortRange port_range = 4; - ICMPInfo icmp_info = 5; - bool log = 6 [(gogoproto.jsontag) = "log"]; - repeated string annotations = 7; +message ProtoSecurityGroupRule { + string protocol = 1; + repeated string destinations = 2; + repeated uint32 ports = 3 [packed = false]; + ProtoPortRange port_range = 4 [json_name = "port_range"]; + ProtoICMPInfo icmp_info = 5 [json_name = "icmp_info"]; + bool log = 6 [json_name = "log", (bbs.bbs_json_always_emit) = true]; + repeated string annotations = 7; } diff --git a/models/security_group_bbs.pb.go b/models/security_group_bbs.pb.go new file mode 100644 index 00000000..608de7b7 --- /dev/null +++ b/models/security_group_bbs.pb.go @@ -0,0 +1,451 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: security_group.proto + +package models + +// Prevent copylock errors when using ProtoPortRange directly +type PortRange struct { + Start uint32 `json:"start"` + End uint32 `json:"end"` +} + +func (this *PortRange) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*PortRange) + if !ok { + that2, ok := that.(PortRange) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Start != that1.Start { + return false + } + if this.End != that1.End { + return false + } + return true +} +func (m *PortRange) GetStart() uint32 { + if m != nil { + return m.Start + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} +func (m *PortRange) SetStart(value uint32) { + if m != nil { + m.Start = value + } +} +func (m *PortRange) GetEnd() uint32 { + if m != nil { + return m.End + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} +func (m *PortRange) SetEnd(value uint32) { + if m != nil { + m.End = value + } +} +func (x *PortRange) ToProto() *ProtoPortRange { + if x == nil { + return nil + } + + proto := &ProtoPortRange{ + Start: x.Start, + End: x.End, + } + return proto +} + +func (x *ProtoPortRange) FromProto() *PortRange { + if x == nil { + return nil + } + + copysafe := &PortRange{ + Start: x.Start, + End: x.End, + } + return copysafe +} + +func PortRangeToProtoSlice(values []*PortRange) []*ProtoPortRange { + if values == nil { + return nil + } + result := make([]*ProtoPortRange, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func PortRangeFromProtoSlice(values []*ProtoPortRange) []*PortRange { + if values == nil { + return nil + } + result := make([]*PortRange, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoICMPInfo directly +type ICMPInfo struct { + Type int32 `json:"type"` + Code int32 `json:"code"` +} + +func (this *ICMPInfo) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*ICMPInfo) + if !ok { + that2, ok := that.(ICMPInfo) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Type != that1.Type { + return false + } + if this.Code != that1.Code { + return false + } + return true +} +func (m *ICMPInfo) GetType() int32 { + if m != nil { + return m.Type + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *ICMPInfo) SetType(value int32) { + if m != nil { + m.Type = value + } +} +func (m *ICMPInfo) GetCode() int32 { + if m != nil { + return m.Code + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *ICMPInfo) SetCode(value int32) { + if m != nil { + m.Code = value + } +} +func (x *ICMPInfo) ToProto() *ProtoICMPInfo { + if x == nil { + return nil + } + + proto := &ProtoICMPInfo{ + Type: x.Type, + Code: x.Code, + } + return proto +} + +func (x *ProtoICMPInfo) FromProto() *ICMPInfo { + if x == nil { + return nil + } + + copysafe := &ICMPInfo{ + Type: x.Type, + Code: x.Code, + } + return copysafe +} + +func ICMPInfoToProtoSlice(values []*ICMPInfo) []*ProtoICMPInfo { + if values == nil { + return nil + } + result := make([]*ProtoICMPInfo, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func ICMPInfoFromProtoSlice(values []*ProtoICMPInfo) []*ICMPInfo { + if values == nil { + return nil + } + result := make([]*ICMPInfo, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoSecurityGroupRule directly +type SecurityGroupRule struct { + Protocol string `json:"protocol,omitempty"` + Destinations []string `json:"destinations,omitempty"` + Ports []uint32 `json:"ports,omitempty"` + PortRange *PortRange `json:"port_range,omitempty"` + IcmpInfo *ICMPInfo `json:"icmp_info,omitempty"` + Log bool `json:"log"` + Annotations []string `json:"annotations,omitempty"` +} + +func (this *SecurityGroupRule) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*SecurityGroupRule) + if !ok { + that2, ok := that.(SecurityGroupRule) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Protocol != that1.Protocol { + return false + } + if this.Destinations == nil { + if that1.Destinations != nil { + return false + } + } else if len(this.Destinations) != len(that1.Destinations) { + return false + } + for i := range this.Destinations { + if this.Destinations[i] != that1.Destinations[i] { + return false + } + } + if this.Ports == nil { + if that1.Ports != nil { + return false + } + } else if len(this.Ports) != len(that1.Ports) { + return false + } + for i := range this.Ports { + if this.Ports[i] != that1.Ports[i] { + return false + } + } + if this.PortRange == nil { + if that1.PortRange != nil { + return false + } + } else if !this.PortRange.Equal(*that1.PortRange) { + return false + } + if this.IcmpInfo == nil { + if that1.IcmpInfo != nil { + return false + } + } else if !this.IcmpInfo.Equal(*that1.IcmpInfo) { + return false + } + if this.Log != that1.Log { + return false + } + if this.Annotations == nil { + if that1.Annotations != nil { + return false + } + } else if len(this.Annotations) != len(that1.Annotations) { + return false + } + for i := range this.Annotations { + if this.Annotations[i] != that1.Annotations[i] { + return false + } + } + return true +} +func (m *SecurityGroupRule) GetProtocol() string { + if m != nil { + return m.Protocol + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *SecurityGroupRule) SetProtocol(value string) { + if m != nil { + m.Protocol = value + } +} +func (m *SecurityGroupRule) GetDestinations() []string { + if m != nil { + return m.Destinations + } + return nil +} +func (m *SecurityGroupRule) SetDestinations(value []string) { + if m != nil { + m.Destinations = value + } +} +func (m *SecurityGroupRule) GetPorts() []uint32 { + if m != nil { + return m.Ports + } + return nil +} +func (m *SecurityGroupRule) SetPorts(value []uint32) { + if m != nil { + m.Ports = value + } +} +func (m *SecurityGroupRule) GetPortRange() *PortRange { + if m != nil { + return m.PortRange + } + return nil +} +func (m *SecurityGroupRule) SetPortRange(value *PortRange) { + if m != nil { + m.PortRange = value + } +} +func (m *SecurityGroupRule) GetIcmpInfo() *ICMPInfo { + if m != nil { + return m.IcmpInfo + } + return nil +} +func (m *SecurityGroupRule) SetIcmpInfo(value *ICMPInfo) { + if m != nil { + m.IcmpInfo = value + } +} +func (m *SecurityGroupRule) GetLog() bool { + if m != nil { + return m.Log + } + var defaultValue bool + defaultValue = false + return defaultValue +} +func (m *SecurityGroupRule) SetLog(value bool) { + if m != nil { + m.Log = value + } +} +func (m *SecurityGroupRule) GetAnnotations() []string { + if m != nil { + return m.Annotations + } + return nil +} +func (m *SecurityGroupRule) SetAnnotations(value []string) { + if m != nil { + m.Annotations = value + } +} +func (x *SecurityGroupRule) ToProto() *ProtoSecurityGroupRule { + if x == nil { + return nil + } + + proto := &ProtoSecurityGroupRule{ + Protocol: x.Protocol, + Destinations: x.Destinations, + Ports: x.Ports, + PortRange: x.PortRange.ToProto(), + IcmpInfo: x.IcmpInfo.ToProto(), + Log: x.Log, + Annotations: x.Annotations, + } + return proto +} + +func (x *ProtoSecurityGroupRule) FromProto() *SecurityGroupRule { + if x == nil { + return nil + } + + copysafe := &SecurityGroupRule{ + Protocol: x.Protocol, + Destinations: x.Destinations, + Ports: x.Ports, + PortRange: x.PortRange.FromProto(), + IcmpInfo: x.IcmpInfo.FromProto(), + Log: x.Log, + Annotations: x.Annotations, + } + return copysafe +} + +func SecurityGroupRuleToProtoSlice(values []*SecurityGroupRule) []*ProtoSecurityGroupRule { + if values == nil { + return nil + } + result := make([]*ProtoSecurityGroupRule, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func SecurityGroupRuleFromProtoSlice(values []*ProtoSecurityGroupRule) []*SecurityGroupRule { + if values == nil { + return nil + } + result := make([]*SecurityGroupRule, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/security_groups_test.go b/models/security_groups_test.go index 459493d6..4807c8d3 100644 --- a/models/security_groups_test.go +++ b/models/security_groups_test.go @@ -4,9 +4,9 @@ import ( "encoding/json" "code.cloudfoundry.org/bbs/models" - "github.com/gogo/protobuf/proto" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) var _ = Describe("SecurityGroupRule", func() { @@ -376,8 +376,7 @@ var _ = Describe("SecurityGroupRule", func() { "destinations": [ "0.0.0.0-9.255.255.255" ], - "log": false, - "annotations":["quack"] + "annotations":["quack"] }` securityGroup = models.SecurityGroupRule{ @@ -389,18 +388,18 @@ var _ = Describe("SecurityGroupRule", func() { }) It("successfully round trips through json and protobuf", func() { - jsonSerialization, err := json.Marshal(securityGroup) + jsonSerialization, err := json.Marshal(securityGroup.ToProto()) Expect(err).NotTo(HaveOccurred()) Expect(jsonSerialization).To(MatchJSON(securityGroupJson)) - protoSerialization, err := proto.Marshal(&securityGroup) + protoSerialization, err := proto.Marshal(securityGroup.ToProto()) Expect(err).NotTo(HaveOccurred()) - var protoDeserialization models.SecurityGroupRule + var protoDeserialization models.ProtoSecurityGroupRule err = proto.Unmarshal(protoSerialization, &protoDeserialization) Expect(err).NotTo(HaveOccurred()) - Expect(protoDeserialization).To(Equal(securityGroup)) + Expect(*protoDeserialization.FromProto()).To(Equal(securityGroup)) }) Context("when annotations are empty", func() { @@ -409,15 +408,14 @@ var _ = Describe("SecurityGroupRule", func() { "protocol": "all", "destinations": [ "0.0.0.0-9.255.255.255" - ], - "log": false + ] }` securityGroup.Annotations = []string{} }) It("successfully json serializes empty arrays to nil", func() { - jsonSerialization, err := json.Marshal(securityGroup) + jsonSerialization, err := json.Marshal(securityGroup.ToProto()) Expect(err).NotTo(HaveOccurred()) Expect(jsonSerialization).To(MatchJSON(securityGroupJson)) }) diff --git a/models/sidecar.pb.go b/models/sidecar.pb.go index 3a9f6ec1..f029c788 100644 --- a/models/sidecar.pb.go +++ b/models/sidecar.pb.go @@ -1,472 +1,144 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: sidecar.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Sidecar struct { - Action *Action `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` - DiskMb int32 `protobuf:"varint,2,opt,name=disk_mb,json=diskMb,proto3" json:"disk_mb"` - MemoryMb int32 `protobuf:"varint,3,opt,name=memory_mb,json=memoryMb,proto3" json:"memory_mb"` -} - -func (m *Sidecar) Reset() { *m = Sidecar{} } -func (*Sidecar) ProtoMessage() {} -func (*Sidecar) Descriptor() ([]byte, []int) { - return fileDescriptor_179ad3b13e6397ec, []int{0} -} -func (m *Sidecar) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Sidecar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Sidecar.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Sidecar) XXX_Merge(src proto.Message) { - xxx_messageInfo_Sidecar.Merge(m, src) -} -func (m *Sidecar) XXX_Size() int { - return m.Size() -} -func (m *Sidecar) XXX_DiscardUnknown() { - xxx_messageInfo_Sidecar.DiscardUnknown(m) -} - -var xxx_messageInfo_Sidecar proto.InternalMessageInfo - -func (m *Sidecar) GetAction() *Action { - if m != nil { - return m.Action - } - return nil -} - -func (m *Sidecar) GetDiskMb() int32 { - if m != nil { - return m.DiskMb - } - return 0 -} +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -func (m *Sidecar) GetMemoryMb() int32 { - if m != nil { - return m.MemoryMb - } - return 0 +type ProtoSidecar struct { + state protoimpl.MessageState `protogen:"open.v1"` + Action *ProtoAction `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` + DiskMb int32 `protobuf:"varint,2,opt,name=disk_mb,proto3" json:"disk_mb,omitempty"` + MemoryMb int32 `protobuf:"varint,3,opt,name=memory_mb,proto3" json:"memory_mb,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { - proto.RegisterType((*Sidecar)(nil), "models.Sidecar") +func (x *ProtoSidecar) Reset() { + *x = ProtoSidecar{} + mi := &file_sidecar_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func init() { proto.RegisterFile("sidecar.proto", fileDescriptor_179ad3b13e6397ec) } - -var fileDescriptor_179ad3b13e6397ec = []byte{ - // 239 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2d, 0xce, 0x4c, 0x49, - 0x4d, 0x4e, 0x2c, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xcb, 0xcd, 0x4f, 0x49, 0xcd, - 0x29, 0x96, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, - 0x4f, 0xcf, 0xd7, 0x07, 0x4b, 0x27, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0xd1, 0x26, - 0xc5, 0x9b, 0x98, 0x5c, 0x92, 0x99, 0x9f, 0x57, 0x0c, 0xe1, 0x2a, 0x35, 0x33, 0x72, 0xb1, 0x07, - 0x43, 0xcc, 0x15, 0x52, 0xe3, 0x62, 0x83, 0x48, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0xf1, - 0xe9, 0x41, 0xac, 0xd0, 0x73, 0x04, 0x8b, 0x06, 0x41, 0x65, 0x85, 0x54, 0xb8, 0xd8, 0x53, 0x32, - 0x8b, 0xb3, 0xe3, 0x73, 0x93, 0x24, 0x98, 0x14, 0x18, 0x35, 0x58, 0x9d, 0xb8, 0x5f, 0xdd, 0x93, - 0x87, 0x09, 0x05, 0xb1, 0x81, 0x18, 0xbe, 0x49, 0x42, 0x5a, 0x5c, 0x9c, 0xb9, 0xa9, 0xb9, 0xf9, - 0x45, 0x95, 0x20, 0x75, 0xcc, 0x60, 0x75, 0xbc, 0xaf, 0xee, 0xc9, 0x23, 0x04, 0x83, 0x38, 0x20, - 0x4c, 0xdf, 0x24, 0x27, 0x93, 0x0b, 0x0f, 0xe5, 0x18, 0x6e, 0x3c, 0x94, 0x63, 0xf8, 0xf0, 0x50, - 0x8e, 0xb1, 0xe1, 0x91, 0x1c, 0xe3, 0x8a, 0x47, 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, - 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x8b, 0x47, 0x72, 0x0c, 0x1f, 0x1e, 0xc9, 0x31, 0x4e, - 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x49, 0x6c, 0x60, 0x2f, - 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf3, 0x28, 0x34, 0x4f, 0x19, 0x01, 0x00, 0x00, +func (x *ProtoSidecar) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *Sidecar) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoSidecar) ProtoMessage() {} - that1, ok := that.(*Sidecar) - if !ok { - that2, ok := that.(Sidecar) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoSidecar) ProtoReflect() protoreflect.Message { + mi := &file_sidecar_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Action.Equal(that1.Action) { - return false - } - if this.DiskMb != that1.DiskMb { - return false - } - if this.MemoryMb != that1.MemoryMb { - return false - } - return true -} -func (this *Sidecar) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&models.Sidecar{") - if this.Action != nil { - s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") - } - s = append(s, "DiskMb: "+fmt.Sprintf("%#v", this.DiskMb)+",\n") - s = append(s, "MemoryMb: "+fmt.Sprintf("%#v", this.MemoryMb)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringSidecar(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *Sidecar) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *Sidecar) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoSidecar.ProtoReflect.Descriptor instead. +func (*ProtoSidecar) Descriptor() ([]byte, []int) { + return file_sidecar_proto_rawDescGZIP(), []int{0} } -func (m *Sidecar) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MemoryMb != 0 { - i = encodeVarintSidecar(dAtA, i, uint64(m.MemoryMb)) - i-- - dAtA[i] = 0x18 - } - if m.DiskMb != 0 { - i = encodeVarintSidecar(dAtA, i, uint64(m.DiskMb)) - i-- - dAtA[i] = 0x10 - } - if m.Action != nil { - { - size, err := m.Action.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSidecar(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func (x *ProtoSidecar) GetAction() *ProtoAction { + if x != nil { + return x.Action } - return len(dAtA) - i, nil + return nil } -func encodeVarintSidecar(dAtA []byte, offset int, v uint64) int { - offset -= sovSidecar(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Sidecar) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovSidecar(uint64(l)) +func (x *ProtoSidecar) GetDiskMb() int32 { + if x != nil { + return x.DiskMb } - if m.DiskMb != 0 { - n += 1 + sovSidecar(uint64(m.DiskMb)) - } - if m.MemoryMb != 0 { - n += 1 + sovSidecar(uint64(m.MemoryMb)) - } - return n + return 0 } -func sovSidecar(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSidecar(x uint64) (n int) { - return sovSidecar(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Sidecar) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Sidecar{`, - `Action:` + strings.Replace(fmt.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, - `DiskMb:` + fmt.Sprintf("%v", this.DiskMb) + `,`, - `MemoryMb:` + fmt.Sprintf("%v", this.MemoryMb) + `,`, - `}`, - }, "") - return s -} -func valueToStringSidecar(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" +func (x *ProtoSidecar) GetMemoryMb() int32 { + if x != nil { + return x.MemoryMb } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) + return 0 } -func (m *Sidecar) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSidecar - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Sidecar: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Sidecar: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSidecar - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSidecar - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSidecar - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskMb", wireType) - } - m.DiskMb = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSidecar - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DiskMb |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemoryMb", wireType) - } - m.MemoryMb = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSidecar - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MemoryMb |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSidecar(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSidecar - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSidecar(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSidecar - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSidecar - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSidecar - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSidecar - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSidecar - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSidecar - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +var File_sidecar_proto protoreflect.FileDescriptor + +const file_sidecar_proto_rawDesc = "" + + "\n" + + "\rsidecar.proto\x12\x06models\x1a\tbbs.proto\x1a\ractions.proto\"}\n" + + "\fProtoSidecar\x12+\n" + + "\x06action\x18\x01 \x01(\v2\x13.models.ProtoActionR\x06action\x12\x1d\n" + + "\adisk_mb\x18\x02 \x01(\x05B\x03\xc0>\x01R\adisk_mb\x12!\n" + + "\tmemory_mb\x18\x03 \x01(\x05B\x03\xc0>\x01R\tmemory_mbB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthSidecar = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSidecar = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSidecar = fmt.Errorf("proto: unexpected end of group") + file_sidecar_proto_rawDescOnce sync.Once + file_sidecar_proto_rawDescData []byte ) + +func file_sidecar_proto_rawDescGZIP() []byte { + file_sidecar_proto_rawDescOnce.Do(func() { + file_sidecar_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sidecar_proto_rawDesc), len(file_sidecar_proto_rawDesc))) + }) + return file_sidecar_proto_rawDescData +} + +var file_sidecar_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_sidecar_proto_goTypes = []any{ + (*ProtoSidecar)(nil), // 0: models.ProtoSidecar + (*ProtoAction)(nil), // 1: models.ProtoAction +} +var file_sidecar_proto_depIdxs = []int32{ + 1, // 0: models.ProtoSidecar.action:type_name -> models.ProtoAction + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_sidecar_proto_init() } +func file_sidecar_proto_init() { + if File_sidecar_proto != nil { + return + } + file_bbs_proto_init() + file_actions_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_sidecar_proto_rawDesc), len(file_sidecar_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sidecar_proto_goTypes, + DependencyIndexes: file_sidecar_proto_depIdxs, + MessageInfos: file_sidecar_proto_msgTypes, + }.Build() + File_sidecar_proto = out.File + file_sidecar_proto_goTypes = nil + file_sidecar_proto_depIdxs = nil +} diff --git a/models/sidecar.proto b/models/sidecar.proto index baa13bcb..8ed1abd0 100644 --- a/models/sidecar.proto +++ b/models/sidecar.proto @@ -1,13 +1,14 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; import "actions.proto"; -message Sidecar { - Action action = 1; +message ProtoSidecar { + ProtoAction action = 1; - int32 disk_mb = 2 [(gogoproto.jsontag) = "disk_mb"]; - int32 memory_mb = 3 [(gogoproto.jsontag) = "memory_mb"]; + int32 disk_mb = 2 [json_name = "disk_mb", (bbs.bbs_json_always_emit) = true]; + int32 memory_mb = 3 [json_name = "memory_mb", (bbs.bbs_json_always_emit) = true]; } diff --git a/models/sidecar_bbs.pb.go b/models/sidecar_bbs.pb.go new file mode 100644 index 00000000..61696e29 --- /dev/null +++ b/models/sidecar_bbs.pb.go @@ -0,0 +1,136 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: sidecar.proto + +package models + +// Prevent copylock errors when using ProtoSidecar directly +type Sidecar struct { + Action *Action `json:"action,omitempty"` + DiskMb int32 `json:"disk_mb"` + MemoryMb int32 `json:"memory_mb"` +} + +func (this *Sidecar) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*Sidecar) + if !ok { + that2, ok := that.(Sidecar) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Action == nil { + if that1.Action != nil { + return false + } + } else if !this.Action.Equal(*that1.Action) { + return false + } + if this.DiskMb != that1.DiskMb { + return false + } + if this.MemoryMb != that1.MemoryMb { + return false + } + return true +} +func (m *Sidecar) GetAction() *Action { + if m != nil { + return m.Action + } + return nil +} +func (m *Sidecar) SetAction(value *Action) { + if m != nil { + m.Action = value + } +} +func (m *Sidecar) GetDiskMb() int32 { + if m != nil { + return m.DiskMb + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *Sidecar) SetDiskMb(value int32) { + if m != nil { + m.DiskMb = value + } +} +func (m *Sidecar) GetMemoryMb() int32 { + if m != nil { + return m.MemoryMb + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *Sidecar) SetMemoryMb(value int32) { + if m != nil { + m.MemoryMb = value + } +} +func (x *Sidecar) ToProto() *ProtoSidecar { + if x == nil { + return nil + } + + proto := &ProtoSidecar{ + Action: x.Action.ToProto(), + DiskMb: x.DiskMb, + MemoryMb: x.MemoryMb, + } + return proto +} + +func (x *ProtoSidecar) FromProto() *Sidecar { + if x == nil { + return nil + } + + copysafe := &Sidecar{ + Action: x.Action.FromProto(), + DiskMb: x.DiskMb, + MemoryMb: x.MemoryMb, + } + return copysafe +} + +func SidecarToProtoSlice(values []*Sidecar) []*ProtoSidecar { + if values == nil { + return nil + } + result := make([]*ProtoSidecar, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func SidecarFromProtoSlice(values []*ProtoSidecar) []*Sidecar { + if values == nil { + return nil + } + result := make([]*Sidecar, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/task.pb.go b/models/task.pb.go index a7e40bd3..3c789021 100644 --- a/models/task.pb.go +++ b/models/task.pb.go @@ -1,3101 +1,643 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: task.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strconv "strconv" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -type Task_State int32 +type ProtoTask_State int32 const ( - Task_Invalid Task_State = 0 - Task_Pending Task_State = 1 - Task_Running Task_State = 2 - Task_Completed Task_State = 3 - Task_Resolving Task_State = 4 + ProtoTask_Invalid ProtoTask_State = 0 + ProtoTask_Pending ProtoTask_State = 1 + ProtoTask_Running ProtoTask_State = 2 + ProtoTask_Completed ProtoTask_State = 3 + ProtoTask_Resolving ProtoTask_State = 4 +) + +// Enum value maps for ProtoTask_State. +var ( + ProtoTask_State_name = map[int32]string{ + 0: "Invalid", + 1: "Pending", + 2: "Running", + 3: "Completed", + 4: "Resolving", + } + ProtoTask_State_value = map[string]int32{ + "Invalid": 0, + "Pending": 1, + "Running": 2, + "Completed": 3, + "Resolving": 4, + } ) -var Task_State_name = map[int32]string{ - 0: "Invalid", - 1: "Pending", - 2: "Running", - 3: "Completed", - 4: "Resolving", +func (x ProtoTask_State) Enum() *ProtoTask_State { + p := new(ProtoTask_State) + *p = x + return p } -var Task_State_value = map[string]int32{ - "Invalid": 0, - "Pending": 1, - "Running": 2, - "Completed": 3, - "Resolving": 4, +func (x ProtoTask_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (Task_State) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ce5d8dd45b4a91ff, []int{1, 0} +func (ProtoTask_State) Descriptor() protoreflect.EnumDescriptor { + return file_task_proto_enumTypes[0].Descriptor() } -type TaskDefinition struct { - RootFs string `protobuf:"bytes,1,opt,name=root_fs,json=rootFs,proto3" json:"rootfs"` - EnvironmentVariables []*EnvironmentVariable `protobuf:"bytes,2,rep,name=environment_variables,json=environmentVariables,proto3" json:"env,omitempty"` - Action *Action `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"` - DiskMb int32 `protobuf:"varint,4,opt,name=disk_mb,json=diskMb,proto3" json:"disk_mb"` - MemoryMb int32 `protobuf:"varint,5,opt,name=memory_mb,json=memoryMb,proto3" json:"memory_mb"` - CpuWeight uint32 `protobuf:"varint,6,opt,name=cpu_weight,json=cpuWeight,proto3" json:"cpu_weight"` - Privileged bool `protobuf:"varint,7,opt,name=privileged,proto3" json:"privileged"` - LogSource string `protobuf:"bytes,8,opt,name=log_source,json=logSource,proto3" json:"log_source"` - LogGuid string `protobuf:"bytes,9,opt,name=log_guid,json=logGuid,proto3" json:"log_guid"` - MetricsGuid string `protobuf:"bytes,10,opt,name=metrics_guid,json=metricsGuid,proto3" json:"metrics_guid"` - ResultFile string `protobuf:"bytes,11,opt,name=result_file,json=resultFile,proto3" json:"result_file"` - CompletionCallbackUrl string `protobuf:"bytes,12,opt,name=completion_callback_url,json=completionCallbackUrl,proto3" json:"completion_callback_url,omitempty"` - Annotation string `protobuf:"bytes,13,opt,name=annotation,proto3" json:"annotation,omitempty"` - EgressRules []*SecurityGroupRule `protobuf:"bytes,14,rep,name=egress_rules,json=egressRules,proto3" json:"egress_rules,omitempty"` - CachedDependencies []*CachedDependency `protobuf:"bytes,15,rep,name=cached_dependencies,json=cachedDependencies,proto3" json:"cached_dependencies,omitempty"` - LegacyDownloadUser string `protobuf:"bytes,16,opt,name=legacy_download_user,json=legacyDownloadUser,proto3" json:"legacy_download_user,omitempty"` // Deprecated: Do not use. - TrustedSystemCertificatesPath string `protobuf:"bytes,17,opt,name=trusted_system_certificates_path,json=trustedSystemCertificatesPath,proto3" json:"trusted_system_certificates_path,omitempty"` - VolumeMounts []*VolumeMount `protobuf:"bytes,18,rep,name=volume_mounts,json=volumeMounts,proto3" json:"volume_mounts,omitempty"` - Network *Network `protobuf:"bytes,19,opt,name=network,proto3" json:"network,omitempty"` - PlacementTags []string `protobuf:"bytes,20,rep,name=placement_tags,json=placementTags,proto3" json:"placement_tags,omitempty"` - MaxPids int32 `protobuf:"varint,21,opt,name=max_pids,json=maxPids,proto3" json:"max_pids"` - CertificateProperties *CertificateProperties `protobuf:"bytes,22,opt,name=certificate_properties,json=certificateProperties,proto3" json:"certificate_properties,omitempty"` - ImageUsername string `protobuf:"bytes,23,opt,name=image_username,json=imageUsername,proto3" json:"image_username"` - ImagePassword string `protobuf:"bytes,24,opt,name=image_password,json=imagePassword,proto3" json:"image_password"` - ImageLayers []*ImageLayer `protobuf:"bytes,25,rep,name=image_layers,json=imageLayers,proto3" json:"image_layers,omitempty"` - LogRateLimit *LogRateLimit `protobuf:"bytes,26,opt,name=log_rate_limit,json=logRateLimit,proto3" json:"log_rate_limit,omitempty"` - MetricTags map[string]*MetricTagValue `protobuf:"bytes,27,rep,name=metric_tags,json=metricTags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - VolumeMountedFiles []*File `protobuf:"bytes,28,rep,name=volume_mounted_files,json=volumeMountedFiles,proto3" json:"volume_mounted_files"` +func (ProtoTask_State) Type() protoreflect.EnumType { + return &file_task_proto_enumTypes[0] } -func (m *TaskDefinition) Reset() { *m = TaskDefinition{} } -func (*TaskDefinition) ProtoMessage() {} -func (*TaskDefinition) Descriptor() ([]byte, []int) { - return fileDescriptor_ce5d8dd45b4a91ff, []int{0} +func (x ProtoTask_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *TaskDefinition) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +// Deprecated: Use ProtoTask_State.Descriptor instead. +func (ProtoTask_State) EnumDescriptor() ([]byte, []int) { + return file_task_proto_rawDescGZIP(), []int{1, 0} } -func (m *TaskDefinition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskDefinition.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + +type ProtoTaskDefinition struct { + state protoimpl.MessageState `protogen:"open.v1"` + RootFs string `protobuf:"bytes,1,opt,name=root_fs,json=rootfs,proto3" json:"root_fs,omitempty"` + EnvironmentVariables []*ProtoEnvironmentVariable `protobuf:"bytes,2,rep,name=environment_variables,json=env,proto3" json:"environment_variables,omitempty"` + Action *ProtoAction `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"` + DiskMb int32 `protobuf:"varint,4,opt,name=disk_mb,proto3" json:"disk_mb,omitempty"` + MemoryMb int32 `protobuf:"varint,5,opt,name=memory_mb,proto3" json:"memory_mb,omitempty"` + CpuWeight uint32 `protobuf:"varint,6,opt,name=cpu_weight,proto3" json:"cpu_weight,omitempty"` + Privileged bool `protobuf:"varint,7,opt,name=privileged,proto3" json:"privileged,omitempty"` + LogSource string `protobuf:"bytes,8,opt,name=log_source,proto3" json:"log_source,omitempty"` + LogGuid string `protobuf:"bytes,9,opt,name=log_guid,proto3" json:"log_guid,omitempty"` + MetricsGuid string `protobuf:"bytes,10,opt,name=metrics_guid,proto3" json:"metrics_guid,omitempty"` + ResultFile string `protobuf:"bytes,11,opt,name=result_file,proto3" json:"result_file,omitempty"` + CompletionCallbackUrl string `protobuf:"bytes,12,opt,name=completion_callback_url,proto3" json:"completion_callback_url,omitempty"` + Annotation string `protobuf:"bytes,13,opt,name=annotation,proto3" json:"annotation,omitempty"` + EgressRules []*ProtoSecurityGroupRule `protobuf:"bytes,14,rep,name=egress_rules,proto3" json:"egress_rules,omitempty"` + CachedDependencies []*ProtoCachedDependency `protobuf:"bytes,15,rep,name=cached_dependencies,proto3" json:"cached_dependencies,omitempty"` + // Deprecated: Marked as deprecated in task.proto. + LegacyDownloadUser string `protobuf:"bytes,16,opt,name=legacy_download_user,proto3" json:"legacy_download_user,omitempty"` + TrustedSystemCertificatesPath string `protobuf:"bytes,17,opt,name=trusted_system_certificates_path,proto3" json:"trusted_system_certificates_path,omitempty"` + VolumeMounts []*ProtoVolumeMount `protobuf:"bytes,18,rep,name=volume_mounts,proto3" json:"volume_mounts,omitempty"` + Network *ProtoNetwork `protobuf:"bytes,19,opt,name=network,proto3" json:"network,omitempty"` + PlacementTags []string `protobuf:"bytes,20,rep,name=placement_tags,proto3" json:"placement_tags,omitempty"` + MaxPids int32 `protobuf:"varint,21,opt,name=max_pids,proto3" json:"max_pids,omitempty"` + CertificateProperties *ProtoCertificateProperties `protobuf:"bytes,22,opt,name=certificate_properties,proto3" json:"certificate_properties,omitempty"` + ImageUsername string `protobuf:"bytes,23,opt,name=image_username,proto3" json:"image_username,omitempty"` + ImagePassword string `protobuf:"bytes,24,opt,name=image_password,proto3" json:"image_password,omitempty"` + ImageLayers []*ProtoImageLayer `protobuf:"bytes,25,rep,name=image_layers,proto3" json:"image_layers,omitempty"` + LogRateLimit *ProtoLogRateLimit `protobuf:"bytes,26,opt,name=log_rate_limit,proto3" json:"log_rate_limit,omitempty"` + MetricTags map[string]*ProtoMetricTagValue `protobuf:"bytes,27,rep,name=metric_tags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + VolumeMountedFiles []*ProtoFile `protobuf:"bytes,28,rep,name=volume_mounted_files,proto3" json:"volume_mounted_files,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *TaskDefinition) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskDefinition.Merge(m, src) + +func (x *ProtoTaskDefinition) Reset() { + *x = ProtoTaskDefinition{} + mi := &file_task_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TaskDefinition) XXX_Size() int { - return m.Size() + +func (x *ProtoTaskDefinition) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TaskDefinition) XXX_DiscardUnknown() { - xxx_messageInfo_TaskDefinition.DiscardUnknown(m) + +func (*ProtoTaskDefinition) ProtoMessage() {} + +func (x *ProtoTaskDefinition) ProtoReflect() protoreflect.Message { + mi := &file_task_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_TaskDefinition proto.InternalMessageInfo +// Deprecated: Use ProtoTaskDefinition.ProtoReflect.Descriptor instead. +func (*ProtoTaskDefinition) Descriptor() ([]byte, []int) { + return file_task_proto_rawDescGZIP(), []int{0} +} -func (m *TaskDefinition) GetRootFs() string { - if m != nil { - return m.RootFs +func (x *ProtoTaskDefinition) GetRootFs() string { + if x != nil { + return x.RootFs } return "" } -func (m *TaskDefinition) GetEnvironmentVariables() []*EnvironmentVariable { - if m != nil { - return m.EnvironmentVariables +func (x *ProtoTaskDefinition) GetEnvironmentVariables() []*ProtoEnvironmentVariable { + if x != nil { + return x.EnvironmentVariables } return nil } -func (m *TaskDefinition) GetAction() *Action { - if m != nil { - return m.Action +func (x *ProtoTaskDefinition) GetAction() *ProtoAction { + if x != nil { + return x.Action } return nil } -func (m *TaskDefinition) GetDiskMb() int32 { - if m != nil { - return m.DiskMb +func (x *ProtoTaskDefinition) GetDiskMb() int32 { + if x != nil { + return x.DiskMb } return 0 } -func (m *TaskDefinition) GetMemoryMb() int32 { - if m != nil { - return m.MemoryMb +func (x *ProtoTaskDefinition) GetMemoryMb() int32 { + if x != nil { + return x.MemoryMb } return 0 } -func (m *TaskDefinition) GetCpuWeight() uint32 { - if m != nil { - return m.CpuWeight +func (x *ProtoTaskDefinition) GetCpuWeight() uint32 { + if x != nil { + return x.CpuWeight } return 0 } -func (m *TaskDefinition) GetPrivileged() bool { - if m != nil { - return m.Privileged +func (x *ProtoTaskDefinition) GetPrivileged() bool { + if x != nil { + return x.Privileged } return false } -func (m *TaskDefinition) GetLogSource() string { - if m != nil { - return m.LogSource +func (x *ProtoTaskDefinition) GetLogSource() string { + if x != nil { + return x.LogSource } return "" } -func (m *TaskDefinition) GetLogGuid() string { - if m != nil { - return m.LogGuid +func (x *ProtoTaskDefinition) GetLogGuid() string { + if x != nil { + return x.LogGuid } return "" } -func (m *TaskDefinition) GetMetricsGuid() string { - if m != nil { - return m.MetricsGuid +func (x *ProtoTaskDefinition) GetMetricsGuid() string { + if x != nil { + return x.MetricsGuid } return "" } -func (m *TaskDefinition) GetResultFile() string { - if m != nil { - return m.ResultFile +func (x *ProtoTaskDefinition) GetResultFile() string { + if x != nil { + return x.ResultFile } return "" } -func (m *TaskDefinition) GetCompletionCallbackUrl() string { - if m != nil { - return m.CompletionCallbackUrl +func (x *ProtoTaskDefinition) GetCompletionCallbackUrl() string { + if x != nil { + return x.CompletionCallbackUrl } return "" } -func (m *TaskDefinition) GetAnnotation() string { - if m != nil { - return m.Annotation +func (x *ProtoTaskDefinition) GetAnnotation() string { + if x != nil { + return x.Annotation } return "" } -func (m *TaskDefinition) GetEgressRules() []*SecurityGroupRule { - if m != nil { - return m.EgressRules +func (x *ProtoTaskDefinition) GetEgressRules() []*ProtoSecurityGroupRule { + if x != nil { + return x.EgressRules } return nil } -func (m *TaskDefinition) GetCachedDependencies() []*CachedDependency { - if m != nil { - return m.CachedDependencies +func (x *ProtoTaskDefinition) GetCachedDependencies() []*ProtoCachedDependency { + if x != nil { + return x.CachedDependencies } return nil } -// Deprecated: Do not use. -func (m *TaskDefinition) GetLegacyDownloadUser() string { - if m != nil { - return m.LegacyDownloadUser +// Deprecated: Marked as deprecated in task.proto. +func (x *ProtoTaskDefinition) GetLegacyDownloadUser() string { + if x != nil { + return x.LegacyDownloadUser } return "" } -func (m *TaskDefinition) GetTrustedSystemCertificatesPath() string { - if m != nil { - return m.TrustedSystemCertificatesPath +func (x *ProtoTaskDefinition) GetTrustedSystemCertificatesPath() string { + if x != nil { + return x.TrustedSystemCertificatesPath } return "" } -func (m *TaskDefinition) GetVolumeMounts() []*VolumeMount { - if m != nil { - return m.VolumeMounts +func (x *ProtoTaskDefinition) GetVolumeMounts() []*ProtoVolumeMount { + if x != nil { + return x.VolumeMounts } return nil } -func (m *TaskDefinition) GetNetwork() *Network { - if m != nil { - return m.Network +func (x *ProtoTaskDefinition) GetNetwork() *ProtoNetwork { + if x != nil { + return x.Network } return nil } -func (m *TaskDefinition) GetPlacementTags() []string { - if m != nil { - return m.PlacementTags +func (x *ProtoTaskDefinition) GetPlacementTags() []string { + if x != nil { + return x.PlacementTags } return nil } -func (m *TaskDefinition) GetMaxPids() int32 { - if m != nil { - return m.MaxPids +func (x *ProtoTaskDefinition) GetMaxPids() int32 { + if x != nil { + return x.MaxPids } return 0 } -func (m *TaskDefinition) GetCertificateProperties() *CertificateProperties { - if m != nil { - return m.CertificateProperties +func (x *ProtoTaskDefinition) GetCertificateProperties() *ProtoCertificateProperties { + if x != nil { + return x.CertificateProperties } return nil } -func (m *TaskDefinition) GetImageUsername() string { - if m != nil { - return m.ImageUsername +func (x *ProtoTaskDefinition) GetImageUsername() string { + if x != nil { + return x.ImageUsername } return "" } -func (m *TaskDefinition) GetImagePassword() string { - if m != nil { - return m.ImagePassword +func (x *ProtoTaskDefinition) GetImagePassword() string { + if x != nil { + return x.ImagePassword } return "" } -func (m *TaskDefinition) GetImageLayers() []*ImageLayer { - if m != nil { - return m.ImageLayers +func (x *ProtoTaskDefinition) GetImageLayers() []*ProtoImageLayer { + if x != nil { + return x.ImageLayers } return nil } -func (m *TaskDefinition) GetLogRateLimit() *LogRateLimit { - if m != nil { - return m.LogRateLimit +func (x *ProtoTaskDefinition) GetLogRateLimit() *ProtoLogRateLimit { + if x != nil { + return x.LogRateLimit } return nil } -func (m *TaskDefinition) GetMetricTags() map[string]*MetricTagValue { - if m != nil { - return m.MetricTags +func (x *ProtoTaskDefinition) GetMetricTags() map[string]*ProtoMetricTagValue { + if x != nil { + return x.MetricTags } return nil } -func (m *TaskDefinition) GetVolumeMountedFiles() []*File { - if m != nil { - return m.VolumeMountedFiles +func (x *ProtoTaskDefinition) GetVolumeMountedFiles() []*ProtoFile { + if x != nil { + return x.VolumeMountedFiles } return nil } -type Task struct { - *TaskDefinition `protobuf:"bytes,1,opt,name=task_definition,json=taskDefinition,proto3,embedded=task_definition" json:""` - TaskGuid string `protobuf:"bytes,2,opt,name=task_guid,json=taskGuid,proto3" json:"task_guid"` - Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain"` - CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at"` - UpdatedAt int64 `protobuf:"varint,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at"` - FirstCompletedAt int64 `protobuf:"varint,6,opt,name=first_completed_at,json=firstCompletedAt,proto3" json:"first_completed_at"` - State Task_State `protobuf:"varint,7,opt,name=state,proto3,enum=models.Task_State" json:"state"` - CellId string `protobuf:"bytes,8,opt,name=cell_id,json=cellId,proto3" json:"cell_id"` - Result string `protobuf:"bytes,9,opt,name=result,proto3" json:"result"` - Failed bool `protobuf:"varint,10,opt,name=failed,proto3" json:"failed"` - FailureReason string `protobuf:"bytes,11,opt,name=failure_reason,json=failureReason,proto3" json:"failure_reason"` - RejectionCount int32 `protobuf:"varint,12,opt,name=rejection_count,json=rejectionCount,proto3" json:"rejection_count"` - RejectionReason string `protobuf:"bytes,13,opt,name=rejection_reason,json=rejectionReason,proto3" json:"rejection_reason"` +type ProtoTask struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskDefinition *ProtoTaskDefinition `protobuf:"bytes,1,opt,name=task_definition,proto3" json:"task_definition,omitempty"` + TaskGuid string `protobuf:"bytes,2,opt,name=task_guid,proto3" json:"task_guid,omitempty"` + Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain,omitempty"` + CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,proto3" json:"created_at,omitempty"` + UpdatedAt int64 `protobuf:"varint,5,opt,name=updated_at,proto3" json:"updated_at,omitempty"` + FirstCompletedAt int64 `protobuf:"varint,6,opt,name=first_completed_at,proto3" json:"first_completed_at,omitempty"` + State ProtoTask_State `protobuf:"varint,7,opt,name=state,proto3,enum=models.ProtoTask_State" json:"state,omitempty"` + CellId string `protobuf:"bytes,8,opt,name=cell_id,proto3" json:"cell_id,omitempty"` + Result string `protobuf:"bytes,9,opt,name=result,proto3" json:"result,omitempty"` + Failed bool `protobuf:"varint,10,opt,name=failed,proto3" json:"failed,omitempty"` + FailureReason string `protobuf:"bytes,11,opt,name=failure_reason,proto3" json:"failure_reason,omitempty"` + RejectionCount int32 `protobuf:"varint,12,opt,name=rejection_count,proto3" json:"rejection_count,omitempty"` + RejectionReason string `protobuf:"bytes,13,opt,name=rejection_reason,proto3" json:"rejection_reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *Task) Reset() { *m = Task{} } -func (*Task) ProtoMessage() {} -func (*Task) Descriptor() ([]byte, []int) { - return fileDescriptor_ce5d8dd45b4a91ff, []int{1} +func (x *ProtoTask) Reset() { + *x = ProtoTask{} + mi := &file_task_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Task) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ProtoTask) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Task) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Task.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ProtoTask) ProtoMessage() {} + +func (x *ProtoTask) ProtoReflect() protoreflect.Message { + mi := &file_task_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *Task) XXX_Merge(src proto.Message) { - xxx_messageInfo_Task.Merge(m, src) -} -func (m *Task) XXX_Size() int { - return m.Size() -} -func (m *Task) XXX_DiscardUnknown() { - xxx_messageInfo_Task.DiscardUnknown(m) + +// Deprecated: Use ProtoTask.ProtoReflect.Descriptor instead. +func (*ProtoTask) Descriptor() ([]byte, []int) { + return file_task_proto_rawDescGZIP(), []int{1} } -var xxx_messageInfo_Task proto.InternalMessageInfo +func (x *ProtoTask) GetTaskDefinition() *ProtoTaskDefinition { + if x != nil { + return x.TaskDefinition + } + return nil +} -func (m *Task) GetTaskGuid() string { - if m != nil { - return m.TaskGuid +func (x *ProtoTask) GetTaskGuid() string { + if x != nil { + return x.TaskGuid } return "" } -func (m *Task) GetDomain() string { - if m != nil { - return m.Domain +func (x *ProtoTask) GetDomain() string { + if x != nil { + return x.Domain } return "" } -func (m *Task) GetCreatedAt() int64 { - if m != nil { - return m.CreatedAt +func (x *ProtoTask) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt } return 0 } -func (m *Task) GetUpdatedAt() int64 { - if m != nil { - return m.UpdatedAt +func (x *ProtoTask) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt } return 0 } -func (m *Task) GetFirstCompletedAt() int64 { - if m != nil { - return m.FirstCompletedAt +func (x *ProtoTask) GetFirstCompletedAt() int64 { + if x != nil { + return x.FirstCompletedAt } return 0 } -func (m *Task) GetState() Task_State { - if m != nil { - return m.State +func (x *ProtoTask) GetState() ProtoTask_State { + if x != nil { + return x.State } - return Task_Invalid + return ProtoTask_Invalid } -func (m *Task) GetCellId() string { - if m != nil { - return m.CellId +func (x *ProtoTask) GetCellId() string { + if x != nil { + return x.CellId } return "" } -func (m *Task) GetResult() string { - if m != nil { - return m.Result +func (x *ProtoTask) GetResult() string { + if x != nil { + return x.Result } return "" } -func (m *Task) GetFailed() bool { - if m != nil { - return m.Failed +func (x *ProtoTask) GetFailed() bool { + if x != nil { + return x.Failed } return false } -func (m *Task) GetFailureReason() string { - if m != nil { - return m.FailureReason +func (x *ProtoTask) GetFailureReason() string { + if x != nil { + return x.FailureReason } return "" } -func (m *Task) GetRejectionCount() int32 { - if m != nil { - return m.RejectionCount +func (x *ProtoTask) GetRejectionCount() int32 { + if x != nil { + return x.RejectionCount } return 0 } -func (m *Task) GetRejectionReason() string { - if m != nil { - return m.RejectionReason +func (x *ProtoTask) GetRejectionReason() string { + if x != nil { + return x.RejectionReason } return "" } -func init() { - proto.RegisterEnum("models.Task_State", Task_State_name, Task_State_value) - proto.RegisterType((*TaskDefinition)(nil), "models.TaskDefinition") - proto.RegisterMapType((map[string]*MetricTagValue)(nil), "models.TaskDefinition.MetricTagsEntry") - proto.RegisterType((*Task)(nil), "models.Task") -} - -func init() { proto.RegisterFile("task.proto", fileDescriptor_ce5d8dd45b4a91ff) } - -var fileDescriptor_ce5d8dd45b4a91ff = []byte{ - // 1386 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x56, 0xdd, 0x6e, 0xdb, 0x36, - 0x14, 0x8e, 0x92, 0xda, 0x89, 0xe9, 0x9f, 0x38, 0xcc, 0x4f, 0xd5, 0xb4, 0xb5, 0x8c, 0x6c, 0xeb, - 0xb2, 0xa2, 0x4d, 0x87, 0xb6, 0x1b, 0xba, 0xa2, 0xc0, 0x10, 0x27, 0x6d, 0x10, 0x20, 0x19, 0x02, - 0xa6, 0xe9, 0x76, 0x27, 0xd0, 0x12, 0xad, 0x70, 0x91, 0x44, 0x83, 0xa4, 0x9c, 0xfa, 0xae, 0x8f, - 0xb0, 0xc7, 0xd8, 0xa3, 0xec, 0x32, 0x97, 0xbd, 0x12, 0xd6, 0xf4, 0x66, 0xf0, 0x55, 0x1f, 0x61, - 0xe0, 0x91, 0x64, 0x3b, 0x69, 0xae, 0x74, 0xce, 0xf7, 0x7d, 0x87, 0x34, 0x0f, 0x79, 0xce, 0x31, - 0x42, 0x9a, 0xaa, 0xb3, 0xad, 0xbe, 0x14, 0x5a, 0xe0, 0x72, 0x24, 0x7c, 0x16, 0xaa, 0xf5, 0xc7, - 0x01, 0xd7, 0xa7, 0x49, 0x77, 0xcb, 0x13, 0xd1, 0x93, 0x40, 0x04, 0xe2, 0x09, 0xd0, 0xdd, 0xa4, - 0x07, 0x1e, 0x38, 0x60, 0x65, 0x61, 0xeb, 0x75, 0xea, 0x69, 0x2e, 0x62, 0x95, 0xbb, 0x77, 0x59, - 0x3c, 0xe0, 0x52, 0xc4, 0x11, 0x8b, 0xb5, 0x3b, 0xa0, 0x92, 0xd3, 0x6e, 0xc8, 0x0a, 0x72, 0x45, - 0x31, 0x2f, 0x91, 0x5c, 0x0f, 0xdd, 0x40, 0x8a, 0xa4, 0x9f, 0xa3, 0xb7, 0x3d, 0xea, 0x9d, 0x32, - 0xdf, 0xf5, 0x59, 0x9f, 0xc5, 0x3e, 0x8b, 0xbd, 0x61, 0x4e, 0xe0, 0x81, 0x08, 0x93, 0x88, 0xb9, - 0x91, 0x48, 0x62, 0x5d, 0x6c, 0x17, 0x33, 0x7d, 0x2e, 0x64, 0xfe, 0xa3, 0xd7, 0xef, 0x79, 0x4c, - 0x6a, 0xde, 0xe3, 0x1e, 0xd5, 0xcc, 0xed, 0x4b, 0xd1, 0x37, 0xee, 0x78, 0xbf, 0x25, 0x1e, 0xd1, - 0x80, 0xb9, 0x21, 0x1d, 0x32, 0x59, 0xfc, 0x84, 0x50, 0x04, 0xae, 0x34, 0xea, 0x90, 0x47, 0xbc, - 0x58, 0x75, 0x29, 0x62, 0x5a, 0x72, 0xcf, 0xd5, 0x34, 0x28, 0x62, 0x51, 0x8f, 0x87, 0x2c, 0xb3, - 0x37, 0x3e, 0xd4, 0x51, 0xe3, 0x2d, 0x55, 0x67, 0xbb, 0xac, 0xc7, 0x63, 0x6e, 0x8e, 0x8b, 0xbf, - 0x41, 0xf3, 0x52, 0x08, 0xed, 0xf6, 0x94, 0x6d, 0xb5, 0xad, 0xcd, 0x4a, 0x07, 0x8d, 0x52, 0xa7, - 0x6c, 0xa0, 0x9e, 0x22, 0xf0, 0x7d, 0xa3, 0xb0, 0x87, 0x56, 0x6f, 0x4c, 0x87, 0x3d, 0xdb, 0x9e, - 0xdb, 0xac, 0x3e, 0xbd, 0xbb, 0x95, 0xa5, 0x7c, 0xeb, 0xf5, 0x44, 0xf4, 0x2e, 0xd7, 0x74, 0x96, - 0x46, 0xa9, 0x53, 0x67, 0xf1, 0xe0, 0x91, 0x88, 0xb8, 0x66, 0x51, 0x5f, 0x0f, 0xc9, 0x0a, 0xfb, - 0x5a, 0xa7, 0xf0, 0x03, 0x54, 0xce, 0xae, 0xc0, 0x9e, 0x6b, 0x5b, 0x9b, 0xd5, 0xa7, 0x8d, 0x62, - 0xd5, 0x6d, 0x40, 0x49, 0xce, 0xe2, 0x6f, 0xd1, 0xbc, 0xcf, 0xd5, 0x99, 0x1b, 0x75, 0xed, 0x5b, - 0x6d, 0x6b, 0xb3, 0xd4, 0xa9, 0x8e, 0x52, 0xa7, 0x80, 0x48, 0xd9, 0x18, 0x87, 0x5d, 0xfc, 0x10, - 0x55, 0x22, 0x16, 0x09, 0x39, 0x34, 0xba, 0x12, 0xe8, 0xea, 0xa3, 0xd4, 0x99, 0x80, 0x64, 0x21, - 0x33, 0x0f, 0xbb, 0xf8, 0x31, 0x42, 0x5e, 0x3f, 0x71, 0xcf, 0x19, 0x0f, 0x4e, 0xb5, 0x5d, 0x6e, - 0x5b, 0x9b, 0xf5, 0x4e, 0x63, 0x94, 0x3a, 0x53, 0x28, 0xa9, 0x78, 0xfd, 0xe4, 0x77, 0x30, 0xf1, - 0x16, 0x42, 0x7d, 0xc9, 0x07, 0x3c, 0x64, 0x01, 0xf3, 0xed, 0xf9, 0xb6, 0xb5, 0xb9, 0x90, 0xc9, - 0x27, 0x28, 0x99, 0xb2, 0xcd, 0xf2, 0xe6, 0xb2, 0x94, 0x48, 0xa4, 0xc7, 0xec, 0x05, 0xc8, 0x32, - 0xe8, 0x27, 0x28, 0xa9, 0x84, 0x22, 0x38, 0x06, 0x13, 0x7f, 0x8f, 0x16, 0x0c, 0x11, 0x24, 0xdc, - 0xb7, 0x2b, 0x20, 0xae, 0x8d, 0x52, 0x67, 0x8c, 0x91, 0xf9, 0x50, 0x04, 0x7b, 0x09, 0xf7, 0xf1, - 0x33, 0x54, 0xcb, 0xae, 0x5b, 0x65, 0x62, 0x04, 0xe2, 0xe6, 0x28, 0x75, 0xae, 0xe0, 0xa4, 0x9a, - 0x7b, 0x10, 0xf4, 0x23, 0xaa, 0x4a, 0xa6, 0x92, 0x50, 0xbb, 0xe6, 0x5d, 0xd8, 0x55, 0x88, 0x59, - 0x1c, 0xa5, 0xce, 0x34, 0x4c, 0x50, 0xe6, 0xbc, 0xe1, 0x21, 0xc3, 0x3f, 0xa3, 0xdb, 0x9e, 0x88, - 0xfa, 0x21, 0x33, 0xd9, 0x77, 0x3d, 0x1a, 0x86, 0x5d, 0xea, 0x9d, 0xb9, 0x89, 0x0c, 0xed, 0x9a, - 0x89, 0x26, 0xab, 0x13, 0x7a, 0x27, 0x67, 0x4f, 0x64, 0x88, 0x5b, 0x08, 0xd1, 0x38, 0x16, 0x9a, - 0xc2, 0x9d, 0xd6, 0x41, 0x3a, 0x85, 0xe0, 0x57, 0xa8, 0xc6, 0x02, 0xc9, 0x94, 0x72, 0x65, 0x62, - 0xde, 0x52, 0x03, 0xde, 0xd2, 0x9d, 0xe2, 0xd6, 0x8f, 0xf3, 0x12, 0xdb, 0x33, 0x15, 0x46, 0x92, - 0x90, 0x91, 0x6a, 0x26, 0x37, 0xb6, 0xc2, 0xfb, 0x68, 0xf9, 0x7a, 0xb9, 0x71, 0xa6, 0xec, 0x45, - 0x58, 0xc4, 0x2e, 0x16, 0xd9, 0x01, 0xc9, 0xee, 0xb8, 0x20, 0x09, 0xf6, 0xae, 0x22, 0x9c, 0x29, - 0xfc, 0x1c, 0xad, 0x84, 0x2c, 0xa0, 0xde, 0xd0, 0xf5, 0xc5, 0x79, 0x1c, 0x0a, 0xea, 0xbb, 0x89, - 0x62, 0xd2, 0x6e, 0x42, 0x6e, 0x66, 0x6d, 0x8b, 0xe0, 0x8c, 0xdf, 0xcd, 0xe9, 0x13, 0xc5, 0x24, - 0xde, 0x43, 0x6d, 0x2d, 0x13, 0xa5, 0x99, 0xef, 0xaa, 0xa1, 0xd2, 0x2c, 0x72, 0xa7, 0x4a, 0x58, - 0xb9, 0x7d, 0xaa, 0x4f, 0xed, 0x25, 0x38, 0xf4, 0xfd, 0x5c, 0x77, 0x0c, 0xb2, 0x9d, 0x29, 0xd5, - 0x11, 0xd5, 0xa7, 0xf8, 0x05, 0xaa, 0x4f, 0xf7, 0x07, 0x65, 0x63, 0x38, 0xc3, 0x72, 0x71, 0x86, - 0x77, 0x40, 0x1e, 0x1a, 0x8e, 0xd4, 0x06, 0x13, 0x47, 0xe1, 0x1f, 0xd0, 0x7c, 0xde, 0x45, 0xec, - 0x65, 0x28, 0x99, 0xc5, 0x22, 0xe6, 0xb7, 0x0c, 0x26, 0x05, 0x8f, 0xbf, 0x43, 0x8d, 0x7e, 0x48, - 0x3d, 0x06, 0xf5, 0x6b, 0xba, 0x83, 0xbd, 0xd2, 0x9e, 0xdb, 0xac, 0x90, 0xfa, 0x18, 0x7d, 0x4b, - 0x03, 0x65, 0xde, 0x5e, 0x44, 0xdf, 0xbb, 0x7d, 0xee, 0x2b, 0x7b, 0x15, 0x8a, 0x06, 0xde, 0x5e, - 0x81, 0x91, 0xf9, 0x88, 0xbe, 0x3f, 0xe2, 0xbe, 0xc2, 0x6f, 0xd1, 0xda, 0xcd, 0x1d, 0xcb, 0x5e, - 0x83, 0x5f, 0x72, 0x7f, 0x7c, 0x03, 0x13, 0xd5, 0xd1, 0x58, 0x44, 0x56, 0xbd, 0x9b, 0x60, 0xfc, - 0x0b, 0x6a, 0x64, 0x9d, 0xce, 0xe4, 0x3f, 0xa6, 0x11, 0xb3, 0x6f, 0xc3, 0x1d, 0xe0, 0x51, 0xea, - 0x5c, 0x63, 0x48, 0x1d, 0xfc, 0x93, 0xdc, 0x9d, 0x84, 0xf6, 0xa9, 0x52, 0xe7, 0x42, 0xfa, 0xb6, - 0x7d, 0x3d, 0xb4, 0x60, 0xf2, 0xd0, 0xa3, 0xdc, 0xc5, 0x3f, 0xa1, 0xda, 0x54, 0x7f, 0x55, 0xf6, - 0x1d, 0xc8, 0x3f, 0x2e, 0x4e, 0xb0, 0x6f, 0xb8, 0x03, 0x43, 0x91, 0x2a, 0x1f, 0xdb, 0x0a, 0xbf, - 0x44, 0x8d, 0xab, 0x3d, 0xd8, 0x5e, 0x87, 0xa3, 0xaf, 0x14, 0x81, 0x07, 0x22, 0x20, 0x54, 0xb3, - 0x03, 0xc3, 0x91, 0x5a, 0x38, 0xe5, 0xe1, 0x3d, 0x54, 0x9d, 0xea, 0xd4, 0xf6, 0x5d, 0xd8, 0xf1, - 0x41, 0x11, 0x78, 0xb5, 0x45, 0x6f, 0x1d, 0x82, 0xd2, 0xdc, 0xcf, 0xeb, 0x58, 0xcb, 0x21, 0x41, - 0xd1, 0x18, 0xc0, 0x7f, 0xa0, 0x95, 0xe9, 0xc7, 0xc3, 0x7c, 0xa8, 0x5f, 0x65, 0xdf, 0x83, 0x15, - 0x6b, 0xc5, 0x8a, 0xa6, 0x90, 0x3b, 0xf6, 0x28, 0x75, 0x6e, 0x54, 0x13, 0x3c, 0xf5, 0xac, 0x98, - 0x6f, 0xc4, 0x6a, 0xfd, 0x04, 0x2d, 0x5e, 0xdb, 0x18, 0x37, 0xd1, 0xdc, 0x19, 0x1b, 0x66, 0x73, - 0x82, 0x18, 0x13, 0x3f, 0x42, 0xa5, 0x01, 0x0d, 0x13, 0x66, 0xcf, 0xc2, 0xd1, 0xd7, 0x8a, 0xfd, - 0xc6, 0x91, 0xef, 0x0c, 0x4b, 0x32, 0xd1, 0xcb, 0xd9, 0x17, 0xd6, 0xc6, 0x97, 0x12, 0xba, 0x65, - 0xce, 0x87, 0xf7, 0xd1, 0xa2, 0x19, 0xda, 0xae, 0x3f, 0x3e, 0x28, 0x2c, 0x3c, 0xb5, 0xc8, 0xd5, - 0x34, 0x74, 0x16, 0x2e, 0x52, 0xc7, 0x1a, 0xa5, 0xce, 0x0c, 0x69, 0xe8, 0xab, 0x33, 0xec, 0x21, - 0xaa, 0xc0, 0x52, 0xd0, 0x05, 0x67, 0xe1, 0xda, 0xa1, 0xd7, 0x8f, 0x41, 0xb2, 0x60, 0x4c, 0xe8, - 0x7f, 0x1b, 0xa8, 0xec, 0x8b, 0x88, 0xf2, 0x6c, 0xca, 0xe4, 0xe3, 0x2e, 0x43, 0x48, 0xfe, 0x85, - 0x79, 0x20, 0x19, 0x35, 0xf9, 0xa1, 0x1a, 0x86, 0xcc, 0x5c, 0x3e, 0x0f, 0xc6, 0x28, 0xa9, 0xe4, - 0xf6, 0xb6, 0x36, 0xf2, 0xa4, 0xef, 0x17, 0xf2, 0xd2, 0x44, 0x3e, 0x41, 0x49, 0x25, 0xb7, 0xb7, - 0x35, 0xde, 0x45, 0xb8, 0xc7, 0xa5, 0xd2, 0x6e, 0xde, 0x36, 0xb3, 0xb0, 0x32, 0x84, 0xad, 0x8d, - 0x52, 0xe7, 0x06, 0x96, 0x34, 0x01, 0xdb, 0x29, 0xa0, 0x6d, 0x8d, 0x9f, 0xa1, 0x92, 0xd2, 0x54, - 0x33, 0x98, 0x3f, 0x8d, 0xc9, 0x6b, 0x35, 0x49, 0xdb, 0x3a, 0x36, 0x4c, 0xa7, 0x32, 0x4a, 0x9d, - 0x4c, 0x44, 0xb2, 0x8f, 0x19, 0x9d, 0x1e, 0x0b, 0x43, 0x97, 0xfb, 0xf9, 0x18, 0x82, 0xd1, 0x99, - 0x43, 0xa4, 0x6c, 0x8c, 0x7d, 0x48, 0x51, 0xd6, 0xfe, 0xf3, 0xf1, 0x93, 0xfd, 0x23, 0x00, 0x84, - 0xe4, 0x5f, 0xa3, 0xe9, 0x51, 0x1e, 0xb2, 0x6c, 0xea, 0x2c, 0x64, 0x9a, 0x0c, 0x21, 0xf9, 0xd7, - 0x94, 0xa4, 0xb1, 0x12, 0xc9, 0x5c, 0xc9, 0xa8, 0x12, 0x71, 0x3e, 0x6d, 0xa0, 0x24, 0xaf, 0x32, - 0xa4, 0x9e, 0xfb, 0x04, 0x5c, 0xfc, 0x0a, 0x2d, 0x4a, 0xf6, 0x27, 0xf3, 0xb2, 0x91, 0x63, 0x9e, - 0x25, 0xcc, 0x9a, 0x52, 0x67, 0x79, 0x94, 0x3a, 0xd7, 0x29, 0xd2, 0x18, 0x03, 0x3b, 0xc6, 0xc7, - 0xbf, 0xa2, 0xe6, 0x44, 0x92, 0x6f, 0x0d, 0xf3, 0xa7, 0xb3, 0x32, 0x4a, 0x9d, 0xaf, 0x38, 0x32, - 0x59, 0x30, 0xdb, 0x7e, 0xe3, 0x00, 0x95, 0x20, 0x85, 0xb8, 0x8a, 0xe6, 0xf7, 0xe3, 0x01, 0x0d, - 0xb9, 0xdf, 0x9c, 0x31, 0xce, 0x11, 0x8b, 0x7d, 0x1e, 0x07, 0x4d, 0xcb, 0x38, 0x24, 0x89, 0x63, - 0xe3, 0xcc, 0xe2, 0x3a, 0xaa, 0x8c, 0xef, 0xa6, 0x39, 0x67, 0x5c, 0xc2, 0x94, 0x08, 0x07, 0x86, - 0xbd, 0xd5, 0x79, 0x7e, 0xf1, 0xa9, 0x65, 0x7d, 0xfc, 0xd4, 0x9a, 0xf9, 0xf2, 0xa9, 0x65, 0x7d, - 0xb8, 0x6c, 0x59, 0x7f, 0x5f, 0xb6, 0xac, 0x7f, 0x2e, 0x5b, 0xd6, 0xc5, 0x65, 0xcb, 0xfa, 0xf7, - 0xb2, 0x65, 0xfd, 0x77, 0xd9, 0x9a, 0xf9, 0x72, 0xd9, 0xb2, 0xfe, 0xfa, 0xdc, 0x9a, 0xb9, 0xf8, - 0xdc, 0x9a, 0xf9, 0xf8, 0xb9, 0x35, 0xd3, 0x2d, 0xc3, 0x5f, 0xb6, 0x67, 0xff, 0x07, 0x00, 0x00, - 0xff, 0xff, 0x19, 0x37, 0xa2, 0x26, 0xdb, 0x0a, 0x00, 0x00, -} - -func (x Task_State) String() string { - s, ok := Task_State_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} -func (this *TaskDefinition) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*TaskDefinition) - if !ok { - that2, ok := that.(TaskDefinition) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.RootFs != that1.RootFs { - return false - } - if len(this.EnvironmentVariables) != len(that1.EnvironmentVariables) { - return false - } - for i := range this.EnvironmentVariables { - if !this.EnvironmentVariables[i].Equal(that1.EnvironmentVariables[i]) { - return false - } - } - if !this.Action.Equal(that1.Action) { - return false - } - if this.DiskMb != that1.DiskMb { - return false - } - if this.MemoryMb != that1.MemoryMb { - return false - } - if this.CpuWeight != that1.CpuWeight { - return false - } - if this.Privileged != that1.Privileged { - return false - } - if this.LogSource != that1.LogSource { - return false - } - if this.LogGuid != that1.LogGuid { - return false - } - if this.MetricsGuid != that1.MetricsGuid { - return false - } - if this.ResultFile != that1.ResultFile { - return false - } - if this.CompletionCallbackUrl != that1.CompletionCallbackUrl { - return false - } - if this.Annotation != that1.Annotation { - return false - } - if len(this.EgressRules) != len(that1.EgressRules) { - return false - } - for i := range this.EgressRules { - if !this.EgressRules[i].Equal(that1.EgressRules[i]) { - return false - } - } - if len(this.CachedDependencies) != len(that1.CachedDependencies) { - return false - } - for i := range this.CachedDependencies { - if !this.CachedDependencies[i].Equal(that1.CachedDependencies[i]) { - return false - } - } - if this.LegacyDownloadUser != that1.LegacyDownloadUser { - return false - } - if this.TrustedSystemCertificatesPath != that1.TrustedSystemCertificatesPath { - return false - } - if len(this.VolumeMounts) != len(that1.VolumeMounts) { - return false - } - for i := range this.VolumeMounts { - if !this.VolumeMounts[i].Equal(that1.VolumeMounts[i]) { - return false - } - } - if !this.Network.Equal(that1.Network) { - return false - } - if len(this.PlacementTags) != len(that1.PlacementTags) { - return false - } - for i := range this.PlacementTags { - if this.PlacementTags[i] != that1.PlacementTags[i] { - return false - } - } - if this.MaxPids != that1.MaxPids { - return false - } - if !this.CertificateProperties.Equal(that1.CertificateProperties) { - return false - } - if this.ImageUsername != that1.ImageUsername { - return false - } - if this.ImagePassword != that1.ImagePassword { - return false - } - if len(this.ImageLayers) != len(that1.ImageLayers) { - return false - } - for i := range this.ImageLayers { - if !this.ImageLayers[i].Equal(that1.ImageLayers[i]) { - return false - } - } - if !this.LogRateLimit.Equal(that1.LogRateLimit) { - return false - } - if len(this.MetricTags) != len(that1.MetricTags) { - return false - } - for i := range this.MetricTags { - if !this.MetricTags[i].Equal(that1.MetricTags[i]) { - return false - } - } - if len(this.VolumeMountedFiles) != len(that1.VolumeMountedFiles) { - return false - } - for i := range this.VolumeMountedFiles { - if !this.VolumeMountedFiles[i].Equal(that1.VolumeMountedFiles[i]) { - return false - } - } - return true -} -func (this *Task) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Task) - if !ok { - that2, ok := that.(Task) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.TaskDefinition.Equal(that1.TaskDefinition) { - return false - } - if this.TaskGuid != that1.TaskGuid { - return false - } - if this.Domain != that1.Domain { - return false - } - if this.CreatedAt != that1.CreatedAt { - return false - } - if this.UpdatedAt != that1.UpdatedAt { - return false - } - if this.FirstCompletedAt != that1.FirstCompletedAt { - return false - } - if this.State != that1.State { - return false - } - if this.CellId != that1.CellId { - return false - } - if this.Result != that1.Result { - return false - } - if this.Failed != that1.Failed { - return false - } - if this.FailureReason != that1.FailureReason { - return false - } - if this.RejectionCount != that1.RejectionCount { - return false - } - if this.RejectionReason != that1.RejectionReason { - return false - } - return true -} -func (this *TaskDefinition) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 32) - s = append(s, "&models.TaskDefinition{") - s = append(s, "RootFs: "+fmt.Sprintf("%#v", this.RootFs)+",\n") - if this.EnvironmentVariables != nil { - s = append(s, "EnvironmentVariables: "+fmt.Sprintf("%#v", this.EnvironmentVariables)+",\n") - } - if this.Action != nil { - s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") - } - s = append(s, "DiskMb: "+fmt.Sprintf("%#v", this.DiskMb)+",\n") - s = append(s, "MemoryMb: "+fmt.Sprintf("%#v", this.MemoryMb)+",\n") - s = append(s, "CpuWeight: "+fmt.Sprintf("%#v", this.CpuWeight)+",\n") - s = append(s, "Privileged: "+fmt.Sprintf("%#v", this.Privileged)+",\n") - s = append(s, "LogSource: "+fmt.Sprintf("%#v", this.LogSource)+",\n") - s = append(s, "LogGuid: "+fmt.Sprintf("%#v", this.LogGuid)+",\n") - s = append(s, "MetricsGuid: "+fmt.Sprintf("%#v", this.MetricsGuid)+",\n") - s = append(s, "ResultFile: "+fmt.Sprintf("%#v", this.ResultFile)+",\n") - s = append(s, "CompletionCallbackUrl: "+fmt.Sprintf("%#v", this.CompletionCallbackUrl)+",\n") - s = append(s, "Annotation: "+fmt.Sprintf("%#v", this.Annotation)+",\n") - if this.EgressRules != nil { - s = append(s, "EgressRules: "+fmt.Sprintf("%#v", this.EgressRules)+",\n") - } - if this.CachedDependencies != nil { - s = append(s, "CachedDependencies: "+fmt.Sprintf("%#v", this.CachedDependencies)+",\n") - } - s = append(s, "LegacyDownloadUser: "+fmt.Sprintf("%#v", this.LegacyDownloadUser)+",\n") - s = append(s, "TrustedSystemCertificatesPath: "+fmt.Sprintf("%#v", this.TrustedSystemCertificatesPath)+",\n") - if this.VolumeMounts != nil { - s = append(s, "VolumeMounts: "+fmt.Sprintf("%#v", this.VolumeMounts)+",\n") - } - if this.Network != nil { - s = append(s, "Network: "+fmt.Sprintf("%#v", this.Network)+",\n") - } - s = append(s, "PlacementTags: "+fmt.Sprintf("%#v", this.PlacementTags)+",\n") - s = append(s, "MaxPids: "+fmt.Sprintf("%#v", this.MaxPids)+",\n") - if this.CertificateProperties != nil { - s = append(s, "CertificateProperties: "+fmt.Sprintf("%#v", this.CertificateProperties)+",\n") - } - s = append(s, "ImageUsername: "+fmt.Sprintf("%#v", this.ImageUsername)+",\n") - s = append(s, "ImagePassword: "+fmt.Sprintf("%#v", this.ImagePassword)+",\n") - if this.ImageLayers != nil { - s = append(s, "ImageLayers: "+fmt.Sprintf("%#v", this.ImageLayers)+",\n") - } - if this.LogRateLimit != nil { - s = append(s, "LogRateLimit: "+fmt.Sprintf("%#v", this.LogRateLimit)+",\n") - } - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]*MetricTagValue{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%#v: %#v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - if this.MetricTags != nil { - s = append(s, "MetricTags: "+mapStringForMetricTags+",\n") - } - if this.VolumeMountedFiles != nil { - s = append(s, "VolumeMountedFiles: "+fmt.Sprintf("%#v", this.VolumeMountedFiles)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Task) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 17) - s = append(s, "&models.Task{") - if this.TaskDefinition != nil { - s = append(s, "TaskDefinition: "+fmt.Sprintf("%#v", this.TaskDefinition)+",\n") - } - s = append(s, "TaskGuid: "+fmt.Sprintf("%#v", this.TaskGuid)+",\n") - s = append(s, "Domain: "+fmt.Sprintf("%#v", this.Domain)+",\n") - s = append(s, "CreatedAt: "+fmt.Sprintf("%#v", this.CreatedAt)+",\n") - s = append(s, "UpdatedAt: "+fmt.Sprintf("%#v", this.UpdatedAt)+",\n") - s = append(s, "FirstCompletedAt: "+fmt.Sprintf("%#v", this.FirstCompletedAt)+",\n") - s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") - s = append(s, "CellId: "+fmt.Sprintf("%#v", this.CellId)+",\n") - s = append(s, "Result: "+fmt.Sprintf("%#v", this.Result)+",\n") - s = append(s, "Failed: "+fmt.Sprintf("%#v", this.Failed)+",\n") - s = append(s, "FailureReason: "+fmt.Sprintf("%#v", this.FailureReason)+",\n") - s = append(s, "RejectionCount: "+fmt.Sprintf("%#v", this.RejectionCount)+",\n") - s = append(s, "RejectionReason: "+fmt.Sprintf("%#v", this.RejectionReason)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringTask(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *TaskDefinition) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TaskDefinition) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskDefinition) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.VolumeMountedFiles) > 0 { - for iNdEx := len(m.VolumeMountedFiles) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.VolumeMountedFiles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTask(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xe2 - } - } - if len(m.MetricTags) > 0 { - for k := range m.MetricTags { - v := m.MetricTags[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTask(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTask(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTask(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xda - } - } - if m.LogRateLimit != nil { - { - size, err := m.LogRateLimit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTask(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xd2 - } - if len(m.ImageLayers) > 0 { - for iNdEx := len(m.ImageLayers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ImageLayers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTask(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xca - } - } - if len(m.ImagePassword) > 0 { - i -= len(m.ImagePassword) - copy(dAtA[i:], m.ImagePassword) - i = encodeVarintTask(dAtA, i, uint64(len(m.ImagePassword))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xc2 - } - if len(m.ImageUsername) > 0 { - i -= len(m.ImageUsername) - copy(dAtA[i:], m.ImageUsername) - i = encodeVarintTask(dAtA, i, uint64(len(m.ImageUsername))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xba - } - if m.CertificateProperties != nil { - { - size, err := m.CertificateProperties.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTask(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xb2 - } - if m.MaxPids != 0 { - i = encodeVarintTask(dAtA, i, uint64(m.MaxPids)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa8 - } - if len(m.PlacementTags) > 0 { - for iNdEx := len(m.PlacementTags) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PlacementTags[iNdEx]) - copy(dAtA[i:], m.PlacementTags[iNdEx]) - i = encodeVarintTask(dAtA, i, uint64(len(m.PlacementTags[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa2 - } - } - if m.Network != nil { - { - size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTask(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x9a - } - if len(m.VolumeMounts) > 0 { - for iNdEx := len(m.VolumeMounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.VolumeMounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTask(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - } - } - if len(m.TrustedSystemCertificatesPath) > 0 { - i -= len(m.TrustedSystemCertificatesPath) - copy(dAtA[i:], m.TrustedSystemCertificatesPath) - i = encodeVarintTask(dAtA, i, uint64(len(m.TrustedSystemCertificatesPath))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - if len(m.LegacyDownloadUser) > 0 { - i -= len(m.LegacyDownloadUser) - copy(dAtA[i:], m.LegacyDownloadUser) - i = encodeVarintTask(dAtA, i, uint64(len(m.LegacyDownloadUser))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if len(m.CachedDependencies) > 0 { - for iNdEx := len(m.CachedDependencies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.CachedDependencies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTask(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x7a - } - } - if len(m.EgressRules) > 0 { - for iNdEx := len(m.EgressRules) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.EgressRules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTask(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - } - } - if len(m.Annotation) > 0 { - i -= len(m.Annotation) - copy(dAtA[i:], m.Annotation) - i = encodeVarintTask(dAtA, i, uint64(len(m.Annotation))) - i-- - dAtA[i] = 0x6a - } - if len(m.CompletionCallbackUrl) > 0 { - i -= len(m.CompletionCallbackUrl) - copy(dAtA[i:], m.CompletionCallbackUrl) - i = encodeVarintTask(dAtA, i, uint64(len(m.CompletionCallbackUrl))) - i-- - dAtA[i] = 0x62 - } - if len(m.ResultFile) > 0 { - i -= len(m.ResultFile) - copy(dAtA[i:], m.ResultFile) - i = encodeVarintTask(dAtA, i, uint64(len(m.ResultFile))) - i-- - dAtA[i] = 0x5a - } - if len(m.MetricsGuid) > 0 { - i -= len(m.MetricsGuid) - copy(dAtA[i:], m.MetricsGuid) - i = encodeVarintTask(dAtA, i, uint64(len(m.MetricsGuid))) - i-- - dAtA[i] = 0x52 - } - if len(m.LogGuid) > 0 { - i -= len(m.LogGuid) - copy(dAtA[i:], m.LogGuid) - i = encodeVarintTask(dAtA, i, uint64(len(m.LogGuid))) - i-- - dAtA[i] = 0x4a - } - if len(m.LogSource) > 0 { - i -= len(m.LogSource) - copy(dAtA[i:], m.LogSource) - i = encodeVarintTask(dAtA, i, uint64(len(m.LogSource))) - i-- - dAtA[i] = 0x42 - } - if m.Privileged { - i-- - if m.Privileged { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if m.CpuWeight != 0 { - i = encodeVarintTask(dAtA, i, uint64(m.CpuWeight)) - i-- - dAtA[i] = 0x30 - } - if m.MemoryMb != 0 { - i = encodeVarintTask(dAtA, i, uint64(m.MemoryMb)) - i-- - dAtA[i] = 0x28 - } - if m.DiskMb != 0 { - i = encodeVarintTask(dAtA, i, uint64(m.DiskMb)) - i-- - dAtA[i] = 0x20 - } - if m.Action != nil { - { - size, err := m.Action.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTask(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.EnvironmentVariables) > 0 { - for iNdEx := len(m.EnvironmentVariables) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.EnvironmentVariables[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTask(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.RootFs) > 0 { - i -= len(m.RootFs) - copy(dAtA[i:], m.RootFs) - i = encodeVarintTask(dAtA, i, uint64(len(m.RootFs))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Task) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Task) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Task) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RejectionReason) > 0 { - i -= len(m.RejectionReason) - copy(dAtA[i:], m.RejectionReason) - i = encodeVarintTask(dAtA, i, uint64(len(m.RejectionReason))) - i-- - dAtA[i] = 0x6a - } - if m.RejectionCount != 0 { - i = encodeVarintTask(dAtA, i, uint64(m.RejectionCount)) - i-- - dAtA[i] = 0x60 - } - if len(m.FailureReason) > 0 { - i -= len(m.FailureReason) - copy(dAtA[i:], m.FailureReason) - i = encodeVarintTask(dAtA, i, uint64(len(m.FailureReason))) - i-- - dAtA[i] = 0x5a - } - if m.Failed { - i-- - if m.Failed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x50 - } - if len(m.Result) > 0 { - i -= len(m.Result) - copy(dAtA[i:], m.Result) - i = encodeVarintTask(dAtA, i, uint64(len(m.Result))) - i-- - dAtA[i] = 0x4a - } - if len(m.CellId) > 0 { - i -= len(m.CellId) - copy(dAtA[i:], m.CellId) - i = encodeVarintTask(dAtA, i, uint64(len(m.CellId))) - i-- - dAtA[i] = 0x42 - } - if m.State != 0 { - i = encodeVarintTask(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x38 - } - if m.FirstCompletedAt != 0 { - i = encodeVarintTask(dAtA, i, uint64(m.FirstCompletedAt)) - i-- - dAtA[i] = 0x30 - } - if m.UpdatedAt != 0 { - i = encodeVarintTask(dAtA, i, uint64(m.UpdatedAt)) - i-- - dAtA[i] = 0x28 - } - if m.CreatedAt != 0 { - i = encodeVarintTask(dAtA, i, uint64(m.CreatedAt)) - i-- - dAtA[i] = 0x20 - } - if len(m.Domain) > 0 { - i -= len(m.Domain) - copy(dAtA[i:], m.Domain) - i = encodeVarintTask(dAtA, i, uint64(len(m.Domain))) - i-- - dAtA[i] = 0x1a - } - if len(m.TaskGuid) > 0 { - i -= len(m.TaskGuid) - copy(dAtA[i:], m.TaskGuid) - i = encodeVarintTask(dAtA, i, uint64(len(m.TaskGuid))) - i-- - dAtA[i] = 0x12 - } - if m.TaskDefinition != nil { - { - size, err := m.TaskDefinition.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTask(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTask(dAtA []byte, offset int, v uint64) int { - offset -= sovTask(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *TaskDefinition) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.RootFs) - if l > 0 { - n += 1 + l + sovTask(uint64(l)) - } - if len(m.EnvironmentVariables) > 0 { - for _, e := range m.EnvironmentVariables { - l = e.Size() - n += 1 + l + sovTask(uint64(l)) - } - } - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovTask(uint64(l)) - } - if m.DiskMb != 0 { - n += 1 + sovTask(uint64(m.DiskMb)) - } - if m.MemoryMb != 0 { - n += 1 + sovTask(uint64(m.MemoryMb)) - } - if m.CpuWeight != 0 { - n += 1 + sovTask(uint64(m.CpuWeight)) - } - if m.Privileged { - n += 2 - } - l = len(m.LogSource) - if l > 0 { - n += 1 + l + sovTask(uint64(l)) - } - l = len(m.LogGuid) - if l > 0 { - n += 1 + l + sovTask(uint64(l)) - } - l = len(m.MetricsGuid) - if l > 0 { - n += 1 + l + sovTask(uint64(l)) - } - l = len(m.ResultFile) - if l > 0 { - n += 1 + l + sovTask(uint64(l)) - } - l = len(m.CompletionCallbackUrl) - if l > 0 { - n += 1 + l + sovTask(uint64(l)) - } - l = len(m.Annotation) - if l > 0 { - n += 1 + l + sovTask(uint64(l)) - } - if len(m.EgressRules) > 0 { - for _, e := range m.EgressRules { - l = e.Size() - n += 1 + l + sovTask(uint64(l)) - } - } - if len(m.CachedDependencies) > 0 { - for _, e := range m.CachedDependencies { - l = e.Size() - n += 1 + l + sovTask(uint64(l)) - } - } - l = len(m.LegacyDownloadUser) - if l > 0 { - n += 2 + l + sovTask(uint64(l)) - } - l = len(m.TrustedSystemCertificatesPath) - if l > 0 { - n += 2 + l + sovTask(uint64(l)) - } - if len(m.VolumeMounts) > 0 { - for _, e := range m.VolumeMounts { - l = e.Size() - n += 2 + l + sovTask(uint64(l)) - } - } - if m.Network != nil { - l = m.Network.Size() - n += 2 + l + sovTask(uint64(l)) - } - if len(m.PlacementTags) > 0 { - for _, s := range m.PlacementTags { - l = len(s) - n += 2 + l + sovTask(uint64(l)) - } - } - if m.MaxPids != 0 { - n += 2 + sovTask(uint64(m.MaxPids)) - } - if m.CertificateProperties != nil { - l = m.CertificateProperties.Size() - n += 2 + l + sovTask(uint64(l)) - } - l = len(m.ImageUsername) - if l > 0 { - n += 2 + l + sovTask(uint64(l)) - } - l = len(m.ImagePassword) - if l > 0 { - n += 2 + l + sovTask(uint64(l)) - } - if len(m.ImageLayers) > 0 { - for _, e := range m.ImageLayers { - l = e.Size() - n += 2 + l + sovTask(uint64(l)) - } - } - if m.LogRateLimit != nil { - l = m.LogRateLimit.Size() - n += 2 + l + sovTask(uint64(l)) - } - if len(m.MetricTags) > 0 { - for k, v := range m.MetricTags { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovTask(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovTask(uint64(len(k))) + l - n += mapEntrySize + 2 + sovTask(uint64(mapEntrySize)) - } - } - if len(m.VolumeMountedFiles) > 0 { - for _, e := range m.VolumeMountedFiles { - l = e.Size() - n += 2 + l + sovTask(uint64(l)) - } - } - return n -} - -func (m *Task) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TaskDefinition != nil { - l = m.TaskDefinition.Size() - n += 1 + l + sovTask(uint64(l)) - } - l = len(m.TaskGuid) - if l > 0 { - n += 1 + l + sovTask(uint64(l)) - } - l = len(m.Domain) - if l > 0 { - n += 1 + l + sovTask(uint64(l)) - } - if m.CreatedAt != 0 { - n += 1 + sovTask(uint64(m.CreatedAt)) - } - if m.UpdatedAt != 0 { - n += 1 + sovTask(uint64(m.UpdatedAt)) - } - if m.FirstCompletedAt != 0 { - n += 1 + sovTask(uint64(m.FirstCompletedAt)) - } - if m.State != 0 { - n += 1 + sovTask(uint64(m.State)) - } - l = len(m.CellId) - if l > 0 { - n += 1 + l + sovTask(uint64(l)) - } - l = len(m.Result) - if l > 0 { - n += 1 + l + sovTask(uint64(l)) - } - if m.Failed { - n += 2 - } - l = len(m.FailureReason) - if l > 0 { - n += 1 + l + sovTask(uint64(l)) - } - if m.RejectionCount != 0 { - n += 1 + sovTask(uint64(m.RejectionCount)) - } - l = len(m.RejectionReason) - if l > 0 { - n += 1 + l + sovTask(uint64(l)) - } - return n -} - -func sovTask(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTask(x uint64) (n int) { - return sovTask(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *TaskDefinition) String() string { - if this == nil { - return "nil" - } - repeatedStringForEnvironmentVariables := "[]*EnvironmentVariable{" - for _, f := range this.EnvironmentVariables { - repeatedStringForEnvironmentVariables += strings.Replace(fmt.Sprintf("%v", f), "EnvironmentVariable", "EnvironmentVariable", 1) + "," - } - repeatedStringForEnvironmentVariables += "}" - repeatedStringForEgressRules := "[]*SecurityGroupRule{" - for _, f := range this.EgressRules { - repeatedStringForEgressRules += strings.Replace(fmt.Sprintf("%v", f), "SecurityGroupRule", "SecurityGroupRule", 1) + "," - } - repeatedStringForEgressRules += "}" - repeatedStringForCachedDependencies := "[]*CachedDependency{" - for _, f := range this.CachedDependencies { - repeatedStringForCachedDependencies += strings.Replace(fmt.Sprintf("%v", f), "CachedDependency", "CachedDependency", 1) + "," - } - repeatedStringForCachedDependencies += "}" - repeatedStringForVolumeMounts := "[]*VolumeMount{" - for _, f := range this.VolumeMounts { - repeatedStringForVolumeMounts += strings.Replace(fmt.Sprintf("%v", f), "VolumeMount", "VolumeMount", 1) + "," - } - repeatedStringForVolumeMounts += "}" - repeatedStringForImageLayers := "[]*ImageLayer{" - for _, f := range this.ImageLayers { - repeatedStringForImageLayers += strings.Replace(fmt.Sprintf("%v", f), "ImageLayer", "ImageLayer", 1) + "," - } - repeatedStringForImageLayers += "}" - repeatedStringForVolumeMountedFiles := "[]*File{" - for _, f := range this.VolumeMountedFiles { - repeatedStringForVolumeMountedFiles += strings.Replace(fmt.Sprintf("%v", f), "File", "File", 1) + "," - } - repeatedStringForVolumeMountedFiles += "}" - keysForMetricTags := make([]string, 0, len(this.MetricTags)) - for k, _ := range this.MetricTags { - keysForMetricTags = append(keysForMetricTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetricTags) - mapStringForMetricTags := "map[string]*MetricTagValue{" - for _, k := range keysForMetricTags { - mapStringForMetricTags += fmt.Sprintf("%v: %v,", k, this.MetricTags[k]) - } - mapStringForMetricTags += "}" - s := strings.Join([]string{`&TaskDefinition{`, - `RootFs:` + fmt.Sprintf("%v", this.RootFs) + `,`, - `EnvironmentVariables:` + repeatedStringForEnvironmentVariables + `,`, - `Action:` + strings.Replace(fmt.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, - `DiskMb:` + fmt.Sprintf("%v", this.DiskMb) + `,`, - `MemoryMb:` + fmt.Sprintf("%v", this.MemoryMb) + `,`, - `CpuWeight:` + fmt.Sprintf("%v", this.CpuWeight) + `,`, - `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, - `LogSource:` + fmt.Sprintf("%v", this.LogSource) + `,`, - `LogGuid:` + fmt.Sprintf("%v", this.LogGuid) + `,`, - `MetricsGuid:` + fmt.Sprintf("%v", this.MetricsGuid) + `,`, - `ResultFile:` + fmt.Sprintf("%v", this.ResultFile) + `,`, - `CompletionCallbackUrl:` + fmt.Sprintf("%v", this.CompletionCallbackUrl) + `,`, - `Annotation:` + fmt.Sprintf("%v", this.Annotation) + `,`, - `EgressRules:` + repeatedStringForEgressRules + `,`, - `CachedDependencies:` + repeatedStringForCachedDependencies + `,`, - `LegacyDownloadUser:` + fmt.Sprintf("%v", this.LegacyDownloadUser) + `,`, - `TrustedSystemCertificatesPath:` + fmt.Sprintf("%v", this.TrustedSystemCertificatesPath) + `,`, - `VolumeMounts:` + repeatedStringForVolumeMounts + `,`, - `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, - `PlacementTags:` + fmt.Sprintf("%v", this.PlacementTags) + `,`, - `MaxPids:` + fmt.Sprintf("%v", this.MaxPids) + `,`, - `CertificateProperties:` + strings.Replace(fmt.Sprintf("%v", this.CertificateProperties), "CertificateProperties", "CertificateProperties", 1) + `,`, - `ImageUsername:` + fmt.Sprintf("%v", this.ImageUsername) + `,`, - `ImagePassword:` + fmt.Sprintf("%v", this.ImagePassword) + `,`, - `ImageLayers:` + repeatedStringForImageLayers + `,`, - `LogRateLimit:` + strings.Replace(fmt.Sprintf("%v", this.LogRateLimit), "LogRateLimit", "LogRateLimit", 1) + `,`, - `MetricTags:` + mapStringForMetricTags + `,`, - `VolumeMountedFiles:` + repeatedStringForVolumeMountedFiles + `,`, - `}`, - }, "") - return s -} -func (this *Task) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Task{`, - `TaskDefinition:` + strings.Replace(this.TaskDefinition.String(), "TaskDefinition", "TaskDefinition", 1) + `,`, - `TaskGuid:` + fmt.Sprintf("%v", this.TaskGuid) + `,`, - `Domain:` + fmt.Sprintf("%v", this.Domain) + `,`, - `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, - `UpdatedAt:` + fmt.Sprintf("%v", this.UpdatedAt) + `,`, - `FirstCompletedAt:` + fmt.Sprintf("%v", this.FirstCompletedAt) + `,`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `CellId:` + fmt.Sprintf("%v", this.CellId) + `,`, - `Result:` + fmt.Sprintf("%v", this.Result) + `,`, - `Failed:` + fmt.Sprintf("%v", this.Failed) + `,`, - `FailureReason:` + fmt.Sprintf("%v", this.FailureReason) + `,`, - `RejectionCount:` + fmt.Sprintf("%v", this.RejectionCount) + `,`, - `RejectionReason:` + fmt.Sprintf("%v", this.RejectionReason) + `,`, - `}`, - }, "") - return s -} -func valueToStringTask(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *TaskDefinition) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TaskDefinition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskDefinition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RootFs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RootFs = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EnvironmentVariables", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EnvironmentVariables = append(m.EnvironmentVariables, &EnvironmentVariable{}) - if err := m.EnvironmentVariables[len(m.EnvironmentVariables)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskMb", wireType) - } - m.DiskMb = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DiskMb |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemoryMb", wireType) - } - m.MemoryMb = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MemoryMb |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CpuWeight", wireType) - } - m.CpuWeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CpuWeight |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Privileged = bool(v != 0) - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricsGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MetricsGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResultFile", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResultFile = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CompletionCallbackUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CompletionCallbackUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotation", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Annotation = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EgressRules", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EgressRules = append(m.EgressRules, &SecurityGroupRule{}) - if err := m.EgressRules[len(m.EgressRules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CachedDependencies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CachedDependencies = append(m.CachedDependencies, &CachedDependency{}) - if err := m.CachedDependencies[len(m.CachedDependencies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LegacyDownloadUser", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LegacyDownloadUser = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TrustedSystemCertificatesPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TrustedSystemCertificatesPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeMounts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VolumeMounts = append(m.VolumeMounts, &VolumeMount{}) - if err := m.VolumeMounts[len(m.VolumeMounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 19: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Network == nil { - m.Network = &Network{} - } - if err := m.Network.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 20: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlacementTags", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PlacementTags = append(m.PlacementTags, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 21: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxPids", wireType) - } - m.MaxPids = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxPids |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 22: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CertificateProperties", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CertificateProperties == nil { - m.CertificateProperties = &CertificateProperties{} - } - if err := m.CertificateProperties.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 23: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImageUsername", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImageUsername = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 24: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImagePassword", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImagePassword = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 25: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImageLayers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImageLayers = append(m.ImageLayers, &ImageLayer{}) - if err := m.ImageLayers[len(m.ImageLayers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 26: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogRateLimit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LogRateLimit == nil { - m.LogRateLimit = &LogRateLimit{} - } - if err := m.LogRateLimit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 27: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricTags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MetricTags == nil { - m.MetricTags = make(map[string]*MetricTagValue) - } - var mapkey string - var mapvalue *MetricTagValue - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthTask - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTask - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthTask - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthTask - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &MetricTagValue{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipTask(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTask - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.MetricTags[mapkey] = mapvalue - iNdEx = postIndex - case 28: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeMountedFiles", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VolumeMountedFiles = append(m.VolumeMountedFiles, &File{}) - if err := m.VolumeMountedFiles[len(m.VolumeMountedFiles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTask(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTask - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Task) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Task: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Task: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskDefinition", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskDefinition == nil { - m.TaskDefinition = &TaskDefinition{} - } - if err := m.TaskDefinition.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - m.CreatedAt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreatedAt |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType) - } - m.UpdatedAt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UpdatedAt |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FirstCompletedAt", wireType) - } - m.FirstCompletedAt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FirstCompletedAt |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - m.State = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= Task_State(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CellId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CellId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Result = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Failed = bool(v != 0) - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FailureReason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FailureReason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RejectionCount", wireType) - } - m.RejectionCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RejectionCount |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RejectionReason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RejectionReason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTask(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTask - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTask(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTask - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTask - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTask - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTask - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTask - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTask - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +var File_task_proto protoreflect.FileDescriptor + +const file_task_proto_rawDesc = "" + + "\n" + + "\n" + + "task.proto\x12\x06models\x1a\tbbs.proto\x1a\ractions.proto\x1a\x1benvironment_variables.proto\x1a\x14security_group.proto\x1a\x17cached_dependency.proto\x1a\x12volume_mount.proto\x1a\rnetwork.proto\x1a\x1ccertificate_properties.proto\x1a\x11image_layer.proto\x1a\x14log_rate_limit.proto\x1a\x11metric_tags.proto\x1a\n" + + "file.proto\"\xa1\f\n" + + "\x13ProtoTaskDefinition\x12\x1c\n" + + "\aroot_fs\x18\x01 \x01(\tB\x03\xc0>\x01R\x06rootfs\x12D\n" + + "\x15environment_variables\x18\x02 \x03(\v2 .models.ProtoEnvironmentVariableR\x03env\x12+\n" + + "\x06action\x18\x03 \x01(\v2\x13.models.ProtoActionR\x06action\x12\x1d\n" + + "\adisk_mb\x18\x04 \x01(\x05B\x03\xc0>\x01R\adisk_mb\x12!\n" + + "\tmemory_mb\x18\x05 \x01(\x05B\x03\xc0>\x01R\tmemory_mb\x12#\n" + + "\n" + + "cpu_weight\x18\x06 \x01(\rB\x03\xc0>\x01R\n" + + "cpu_weight\x12#\n" + + "\n" + + "privileged\x18\a \x01(\bB\x03\xc0>\x01R\n" + + "privileged\x12#\n" + + "\n" + + "log_source\x18\b \x01(\tB\x03\xc0>\x01R\n" + + "log_source\x12\x1f\n" + + "\blog_guid\x18\t \x01(\tB\x03\xc0>\x01R\blog_guid\x12'\n" + + "\fmetrics_guid\x18\n" + + " \x01(\tB\x03\xc0>\x01R\fmetrics_guid\x12%\n" + + "\vresult_file\x18\v \x01(\tB\x03\xc0>\x01R\vresult_file\x128\n" + + "\x17completion_callback_url\x18\f \x01(\tR\x17completion_callback_url\x12\x1e\n" + + "\n" + + "annotation\x18\r \x01(\tR\n" + + "annotation\x12B\n" + + "\fegress_rules\x18\x0e \x03(\v2\x1e.models.ProtoSecurityGroupRuleR\fegress_rules\x12O\n" + + "\x13cached_dependencies\x18\x0f \x03(\v2\x1d.models.ProtoCachedDependencyR\x13cached_dependencies\x126\n" + + "\x14legacy_download_user\x18\x10 \x01(\tB\x02\x18\x01R\x14legacy_download_user\x12J\n" + + " trusted_system_certificates_path\x18\x11 \x01(\tR trusted_system_certificates_path\x12>\n" + + "\rvolume_mounts\x18\x12 \x03(\v2\x18.models.ProtoVolumeMountR\rvolume_mounts\x12.\n" + + "\anetwork\x18\x13 \x01(\v2\x14.models.ProtoNetworkR\anetwork\x12&\n" + + "\x0eplacement_tags\x18\x14 \x03(\tR\x0eplacement_tags\x12\x1f\n" + + "\bmax_pids\x18\x15 \x01(\x05B\x03\xc0>\x01R\bmax_pids\x12Z\n" + + "\x16certificate_properties\x18\x16 \x01(\v2\".models.ProtoCertificatePropertiesR\x16certificate_properties\x12+\n" + + "\x0eimage_username\x18\x17 \x01(\tB\x03\xc0>\x01R\x0eimage_username\x12+\n" + + "\x0eimage_password\x18\x18 \x01(\tB\x03\xc0>\x01R\x0eimage_password\x12;\n" + + "\fimage_layers\x18\x19 \x03(\v2\x17.models.ProtoImageLayerR\fimage_layers\x12A\n" + + "\x0elog_rate_limit\x18\x1a \x01(\v2\x19.models.ProtoLogRateLimitR\x0elog_rate_limit\x12M\n" + + "\vmetric_tags\x18\x1b \x03(\v2+.models.ProtoTaskDefinition.MetricTagsEntryR\vmetric_tags\x12J\n" + + "\x14volume_mounted_files\x18\x1c \x03(\v2\x11.models.ProtoFileB\x03\xc0>\x01R\x14volume_mounted_files\x1aZ\n" + + "\x0fMetricTagsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x121\n" + + "\x05value\x18\x02 \x01(\v2\x1b.models.ProtoMetricTagValueR\x05value:\x028\x01\"\xfe\x04\n" + + "\tProtoTask\x12J\n" + + "\x0ftask_definition\x18\x01 \x01(\v2\x1b.models.ProtoTaskDefinitionB\x03\xc0>\x01R\x0ftask_definition\x12!\n" + + "\ttask_guid\x18\x02 \x01(\tB\x03\xc0>\x01R\ttask_guid\x12\x1b\n" + + "\x06domain\x18\x03 \x01(\tB\x03\xc0>\x01R\x06domain\x12#\n" + + "\n" + + "created_at\x18\x04 \x01(\x03B\x03\xc0>\x01R\n" + + "created_at\x12#\n" + + "\n" + + "updated_at\x18\x05 \x01(\x03B\x03\xc0>\x01R\n" + + "updated_at\x123\n" + + "\x12first_completed_at\x18\x06 \x01(\x03B\x03\xc0>\x01R\x12first_completed_at\x122\n" + + "\x05state\x18\a \x01(\x0e2\x17.models.ProtoTask.StateB\x03\xc0>\x01R\x05state\x12\x1d\n" + + "\acell_id\x18\b \x01(\tB\x03\xc0>\x01R\acell_id\x12\x1b\n" + + "\x06result\x18\t \x01(\tB\x03\xc0>\x01R\x06result\x12\x1b\n" + + "\x06failed\x18\n" + + " \x01(\bB\x03\xc0>\x01R\x06failed\x12+\n" + + "\x0efailure_reason\x18\v \x01(\tB\x03\xc0>\x01R\x0efailure_reason\x12-\n" + + "\x0frejection_count\x18\f \x01(\x05B\x03\xc0>\x01R\x0frejection_count\x12/\n" + + "\x10rejection_reason\x18\r \x01(\tB\x03\xc0>\x01R\x10rejection_reason\"L\n" + + "\x05State\x12\v\n" + + "\aInvalid\x10\x00\x12\v\n" + + "\aPending\x10\x01\x12\v\n" + + "\aRunning\x10\x02\x12\r\n" + + "\tCompleted\x10\x03\x12\r\n" + + "\tResolving\x10\x04B\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthTask = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTask = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTask = fmt.Errorf("proto: unexpected end of group") + file_task_proto_rawDescOnce sync.Once + file_task_proto_rawDescData []byte ) + +func file_task_proto_rawDescGZIP() []byte { + file_task_proto_rawDescOnce.Do(func() { + file_task_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_task_proto_rawDesc), len(file_task_proto_rawDesc))) + }) + return file_task_proto_rawDescData +} + +var file_task_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_task_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_task_proto_goTypes = []any{ + (ProtoTask_State)(0), // 0: models.ProtoTask.State + (*ProtoTaskDefinition)(nil), // 1: models.ProtoTaskDefinition + (*ProtoTask)(nil), // 2: models.ProtoTask + nil, // 3: models.ProtoTaskDefinition.MetricTagsEntry + (*ProtoEnvironmentVariable)(nil), // 4: models.ProtoEnvironmentVariable + (*ProtoAction)(nil), // 5: models.ProtoAction + (*ProtoSecurityGroupRule)(nil), // 6: models.ProtoSecurityGroupRule + (*ProtoCachedDependency)(nil), // 7: models.ProtoCachedDependency + (*ProtoVolumeMount)(nil), // 8: models.ProtoVolumeMount + (*ProtoNetwork)(nil), // 9: models.ProtoNetwork + (*ProtoCertificateProperties)(nil), // 10: models.ProtoCertificateProperties + (*ProtoImageLayer)(nil), // 11: models.ProtoImageLayer + (*ProtoLogRateLimit)(nil), // 12: models.ProtoLogRateLimit + (*ProtoFile)(nil), // 13: models.ProtoFile + (*ProtoMetricTagValue)(nil), // 14: models.ProtoMetricTagValue +} +var file_task_proto_depIdxs = []int32{ + 4, // 0: models.ProtoTaskDefinition.environment_variables:type_name -> models.ProtoEnvironmentVariable + 5, // 1: models.ProtoTaskDefinition.action:type_name -> models.ProtoAction + 6, // 2: models.ProtoTaskDefinition.egress_rules:type_name -> models.ProtoSecurityGroupRule + 7, // 3: models.ProtoTaskDefinition.cached_dependencies:type_name -> models.ProtoCachedDependency + 8, // 4: models.ProtoTaskDefinition.volume_mounts:type_name -> models.ProtoVolumeMount + 9, // 5: models.ProtoTaskDefinition.network:type_name -> models.ProtoNetwork + 10, // 6: models.ProtoTaskDefinition.certificate_properties:type_name -> models.ProtoCertificateProperties + 11, // 7: models.ProtoTaskDefinition.image_layers:type_name -> models.ProtoImageLayer + 12, // 8: models.ProtoTaskDefinition.log_rate_limit:type_name -> models.ProtoLogRateLimit + 3, // 9: models.ProtoTaskDefinition.metric_tags:type_name -> models.ProtoTaskDefinition.MetricTagsEntry + 13, // 10: models.ProtoTaskDefinition.volume_mounted_files:type_name -> models.ProtoFile + 1, // 11: models.ProtoTask.task_definition:type_name -> models.ProtoTaskDefinition + 0, // 12: models.ProtoTask.state:type_name -> models.ProtoTask.State + 14, // 13: models.ProtoTaskDefinition.MetricTagsEntry.value:type_name -> models.ProtoMetricTagValue + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_task_proto_init() } +func file_task_proto_init() { + if File_task_proto != nil { + return + } + file_bbs_proto_init() + file_actions_proto_init() + file_environment_variables_proto_init() + file_security_group_proto_init() + file_cached_dependency_proto_init() + file_volume_mount_proto_init() + file_network_proto_init() + file_certificate_properties_proto_init() + file_image_layer_proto_init() + file_log_rate_limit_proto_init() + file_metric_tags_proto_init() + file_file_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_task_proto_rawDesc), len(file_task_proto_rawDesc)), + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_task_proto_goTypes, + DependencyIndexes: file_task_proto_depIdxs, + EnumInfos: file_task_proto_enumTypes, + MessageInfos: file_task_proto_msgTypes, + }.Build() + File_task_proto = out.File + file_task_proto_goTypes = nil + file_task_proto_depIdxs = nil +} diff --git a/models/task.proto b/models/task.proto index 697e33c7..32c7d9c3 100644 --- a/models/task.proto +++ b/models/task.proto @@ -1,8 +1,9 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; import "actions.proto"; import "environment_variables.proto"; import "security_group.proto"; @@ -15,40 +16,38 @@ import "log_rate_limit.proto"; import "metric_tags.proto"; import "file.proto"; -option (gogoproto.goproto_enum_prefix_all) = true; - -message TaskDefinition { - string root_fs = 1 [(gogoproto.jsontag) = "rootfs"]; - repeated EnvironmentVariable environment_variables = 2 [(gogoproto.jsontag) = "env,omitempty"]; - Action action = 3; - int32 disk_mb = 4 [(gogoproto.jsontag) = "disk_mb"]; - int32 memory_mb = 5 [(gogoproto.jsontag) = "memory_mb"]; - uint32 cpu_weight = 6 [(gogoproto.jsontag) = "cpu_weight"]; - bool privileged = 7 [(gogoproto.jsontag) = "privileged"]; - string log_source = 8 [(gogoproto.jsontag) = "log_source"]; - string log_guid = 9 [(gogoproto.jsontag) = "log_guid"]; - string metrics_guid = 10 [(gogoproto.jsontag) = "metrics_guid"]; - string result_file = 11 [(gogoproto.jsontag) = "result_file"]; - string completion_callback_url = 12; +message ProtoTaskDefinition { + string root_fs = 1 [json_name = "rootfs", (bbs.bbs_json_always_emit) = true]; + repeated ProtoEnvironmentVariable environment_variables = 2 [json_name = "env"]; + ProtoAction action = 3; + int32 disk_mb = 4 [json_name = "disk_mb", (bbs.bbs_json_always_emit) = true]; + int32 memory_mb = 5 [json_name = "memory_mb", (bbs.bbs_json_always_emit) = true]; + uint32 cpu_weight = 6 [json_name = "cpu_weight", (bbs.bbs_json_always_emit) = true]; + bool privileged = 7 [json_name = "privileged", (bbs.bbs_json_always_emit) = true]; + string log_source = 8 [json_name = "log_source", (bbs.bbs_json_always_emit) = true]; + string log_guid = 9 [json_name = "log_guid", (bbs.bbs_json_always_emit) = true]; + string metrics_guid = 10 [json_name = "metrics_guid", (bbs.bbs_json_always_emit) = true]; + string result_file = 11 [json_name = "result_file", (bbs.bbs_json_always_emit) = true]; + string completion_callback_url = 12 [json_name = "completion_callback_url"]; string annotation = 13; - repeated SecurityGroupRule egress_rules = 14; - repeated CachedDependency cached_dependencies = 15; - string legacy_download_user = 16 [deprecated=true]; - string trusted_system_certificates_path = 17; - repeated VolumeMount volume_mounts = 18; - Network network = 19; - repeated string placement_tags = 20; - int32 max_pids = 21 [(gogoproto.jsontag) = "max_pids"]; - CertificateProperties certificate_properties = 22; - string image_username = 23 [(gogoproto.jsontag) = "image_username"]; - string image_password = 24 [(gogoproto.jsontag) = "image_password"]; - repeated ImageLayer image_layers = 25; - LogRateLimit log_rate_limit = 26; - map metric_tags = 27; - repeated File volume_mounted_files = 28 [(gogoproto.jsontag) = "volume_mounted_files"]; + repeated ProtoSecurityGroupRule egress_rules = 14 [json_name = "egress_rules"]; + repeated ProtoCachedDependency cached_dependencies = 15 [json_name = "cached_dependencies"]; + string legacy_download_user = 16 [deprecated=true, json_name = "legacy_download_user"]; + string trusted_system_certificates_path = 17 [json_name = "trusted_system_certificates_path"]; + repeated ProtoVolumeMount volume_mounts = 18 [json_name = "volume_mounts"]; + ProtoNetwork network = 19; + repeated string placement_tags = 20 [json_name = "placement_tags"]; + int32 max_pids = 21 [json_name = "max_pids", (bbs.bbs_json_always_emit) = true]; + ProtoCertificateProperties certificate_properties = 22 [json_name = "certificate_properties"]; + string image_username = 23 [json_name = "image_username", (bbs.bbs_json_always_emit) = true]; + string image_password = 24 [json_name = "image_password", (bbs.bbs_json_always_emit) = true]; + repeated ProtoImageLayer image_layers = 25 [json_name = "image_layers"]; + ProtoLogRateLimit log_rate_limit = 26 [json_name = "log_rate_limit"]; + map metric_tags = 27 [json_name = "metric_tags"]; + repeated ProtoFile volume_mounted_files = 28 [json_name = "volume_mounted_files", (bbs.bbs_json_always_emit) = true]; } -message Task { +message ProtoTask { enum State { Invalid = 0; Pending = 1; @@ -57,22 +56,22 @@ message Task { Resolving = 4; } - TaskDefinition task_definition = 1 [(gogoproto.jsontag) = "", (gogoproto.embed) = true]; + ProtoTaskDefinition task_definition = 1 [json_name = "task_definition", (bbs.bbs_json_always_emit) = true]; - string task_guid = 2 [(gogoproto.jsontag) = "task_guid"]; - string domain = 3 [(gogoproto.jsontag) = "domain"]; - int64 created_at = 4 [(gogoproto.jsontag) = "created_at"]; - int64 updated_at = 5 [(gogoproto.jsontag) = "updated_at"]; - int64 first_completed_at = 6 [(gogoproto.jsontag) = "first_completed_at"]; + string task_guid = 2 [json_name = "task_guid", (bbs.bbs_json_always_emit) = true]; + string domain = 3 [json_name = "domain", (bbs.bbs_json_always_emit) = true]; + int64 created_at = 4 [json_name = "created_at", (bbs.bbs_json_always_emit) = true]; + int64 updated_at = 5 [json_name = "updated_at", (bbs.bbs_json_always_emit) = true]; + int64 first_completed_at = 6 [json_name = "first_completed_at", (bbs.bbs_json_always_emit) = true]; - State state = 7 [(gogoproto.jsontag) = "state"]; + State state = 7 [json_name = "state", (bbs.bbs_json_always_emit) = true]; - string cell_id = 8 [(gogoproto.jsontag) = "cell_id"]; + string cell_id = 8 [json_name = "cell_id", (bbs.bbs_json_always_emit) = true]; - string result = 9 [(gogoproto.jsontag) = "result"]; - bool failed = 10 [(gogoproto.jsontag) = "failed"]; - string failure_reason = 11 [(gogoproto.jsontag) = "failure_reason"]; - int32 rejection_count = 12 [(gogoproto.jsontag) = "rejection_count"]; - string rejection_reason = 13 [(gogoproto.jsontag) = "rejection_reason"]; + string result = 9 [json_name = "result", (bbs.bbs_json_always_emit) = true]; + bool failed = 10 [json_name = "failed", (bbs.bbs_json_always_emit) = true]; + string failure_reason = 11 [json_name = "failure_reason", (bbs.bbs_json_always_emit) = true]; + int32 rejection_count = 12 [json_name = "rejection_count", (bbs.bbs_json_always_emit) = true]; + string rejection_reason = 13 [json_name = "rejection_reason", (bbs.bbs_json_always_emit) = true]; } diff --git a/models/task_bbs.pb.go b/models/task_bbs.pb.go new file mode 100644 index 00000000..37a5da11 --- /dev/null +++ b/models/task_bbs.pb.go @@ -0,0 +1,1059 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: task.proto + +package models + +import ( + strconv "strconv" +) + +// Prevent copylock errors when using ProtoTaskDefinition directly +type TaskDefinition struct { + RootFs string `json:"rootfs"` + EnvironmentVariables []*EnvironmentVariable `json:"env,omitempty"` + Action *Action `json:"action,omitempty"` + DiskMb int32 `json:"disk_mb"` + MemoryMb int32 `json:"memory_mb"` + CpuWeight uint32 `json:"cpu_weight"` + Privileged bool `json:"privileged"` + LogSource string `json:"log_source"` + LogGuid string `json:"log_guid"` + MetricsGuid string `json:"metrics_guid"` + ResultFile string `json:"result_file"` + CompletionCallbackUrl string `json:"completion_callback_url,omitempty"` + Annotation string `json:"annotation,omitempty"` + EgressRules []*SecurityGroupRule `json:"egress_rules,omitempty"` + CachedDependencies []*CachedDependency `json:"cached_dependencies,omitempty"` + // Deprecated: marked deprecated in task.proto + LegacyDownloadUser string `json:"legacy_download_user,omitempty"` + TrustedSystemCertificatesPath string `json:"trusted_system_certificates_path,omitempty"` + VolumeMounts []*VolumeMount `json:"volume_mounts,omitempty"` + Network *Network `json:"network,omitempty"` + PlacementTags []string `json:"placement_tags,omitempty"` + MaxPids int32 `json:"max_pids"` + CertificateProperties *CertificateProperties `json:"certificate_properties,omitempty"` + ImageUsername string `json:"image_username"` + ImagePassword string `json:"image_password"` + ImageLayers []*ImageLayer `json:"image_layers,omitempty"` + LogRateLimit *LogRateLimit `json:"log_rate_limit,omitempty"` + MetricTags map[string]*MetricTagValue `json:"metric_tags,omitempty"` + VolumeMountedFiles []*File `json:"volume_mounted_files"` +} + +func (this *TaskDefinition) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TaskDefinition) + if !ok { + that2, ok := that.(TaskDefinition) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.RootFs != that1.RootFs { + return false + } + if this.EnvironmentVariables == nil { + if that1.EnvironmentVariables != nil { + return false + } + } else if len(this.EnvironmentVariables) != len(that1.EnvironmentVariables) { + return false + } + for i := range this.EnvironmentVariables { + if !this.EnvironmentVariables[i].Equal(that1.EnvironmentVariables[i]) { + return false + } + } + if this.Action == nil { + if that1.Action != nil { + return false + } + } else if !this.Action.Equal(*that1.Action) { + return false + } + if this.DiskMb != that1.DiskMb { + return false + } + if this.MemoryMb != that1.MemoryMb { + return false + } + if this.CpuWeight != that1.CpuWeight { + return false + } + if this.Privileged != that1.Privileged { + return false + } + if this.LogSource != that1.LogSource { + return false + } + if this.LogGuid != that1.LogGuid { + return false + } + if this.MetricsGuid != that1.MetricsGuid { + return false + } + if this.ResultFile != that1.ResultFile { + return false + } + if this.CompletionCallbackUrl != that1.CompletionCallbackUrl { + return false + } + if this.Annotation != that1.Annotation { + return false + } + if this.EgressRules == nil { + if that1.EgressRules != nil { + return false + } + } else if len(this.EgressRules) != len(that1.EgressRules) { + return false + } + for i := range this.EgressRules { + if !this.EgressRules[i].Equal(that1.EgressRules[i]) { + return false + } + } + if this.CachedDependencies == nil { + if that1.CachedDependencies != nil { + return false + } + } else if len(this.CachedDependencies) != len(that1.CachedDependencies) { + return false + } + for i := range this.CachedDependencies { + if !this.CachedDependencies[i].Equal(that1.CachedDependencies[i]) { + return false + } + } + if this.LegacyDownloadUser != that1.LegacyDownloadUser { + return false + } + if this.TrustedSystemCertificatesPath != that1.TrustedSystemCertificatesPath { + return false + } + if this.VolumeMounts == nil { + if that1.VolumeMounts != nil { + return false + } + } else if len(this.VolumeMounts) != len(that1.VolumeMounts) { + return false + } + for i := range this.VolumeMounts { + if !this.VolumeMounts[i].Equal(that1.VolumeMounts[i]) { + return false + } + } + if this.Network == nil { + if that1.Network != nil { + return false + } + } else if !this.Network.Equal(*that1.Network) { + return false + } + if this.PlacementTags == nil { + if that1.PlacementTags != nil { + return false + } + } else if len(this.PlacementTags) != len(that1.PlacementTags) { + return false + } + for i := range this.PlacementTags { + if this.PlacementTags[i] != that1.PlacementTags[i] { + return false + } + } + if this.MaxPids != that1.MaxPids { + return false + } + if this.CertificateProperties == nil { + if that1.CertificateProperties != nil { + return false + } + } else if !this.CertificateProperties.Equal(*that1.CertificateProperties) { + return false + } + if this.ImageUsername != that1.ImageUsername { + return false + } + if this.ImagePassword != that1.ImagePassword { + return false + } + if this.ImageLayers == nil { + if that1.ImageLayers != nil { + return false + } + } else if len(this.ImageLayers) != len(that1.ImageLayers) { + return false + } + for i := range this.ImageLayers { + if !this.ImageLayers[i].Equal(that1.ImageLayers[i]) { + return false + } + } + if this.LogRateLimit == nil { + if that1.LogRateLimit != nil { + return false + } + } else if !this.LogRateLimit.Equal(*that1.LogRateLimit) { + return false + } + if this.MetricTags == nil { + if that1.MetricTags != nil { + return false + } + } else if len(this.MetricTags) != len(that1.MetricTags) { + return false + } + for i := range this.MetricTags { + if !this.MetricTags[i].Equal(that1.MetricTags[i]) { + return false + } + } + if this.VolumeMountedFiles == nil { + if that1.VolumeMountedFiles != nil { + return false + } + } else if len(this.VolumeMountedFiles) != len(that1.VolumeMountedFiles) { + return false + } + for i := range this.VolumeMountedFiles { + if !this.VolumeMountedFiles[i].Equal(that1.VolumeMountedFiles[i]) { + return false + } + } + return true +} +func (m *TaskDefinition) GetRootFs() string { + if m != nil { + return m.RootFs + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskDefinition) SetRootFs(value string) { + if m != nil { + m.RootFs = value + } +} +func (m *TaskDefinition) GetEnvironmentVariables() []*EnvironmentVariable { + if m != nil { + return m.EnvironmentVariables + } + return nil +} +func (m *TaskDefinition) SetEnvironmentVariables(value []*EnvironmentVariable) { + if m != nil { + m.EnvironmentVariables = value + } +} +func (m *TaskDefinition) GetAction() *Action { + if m != nil { + return m.Action + } + return nil +} +func (m *TaskDefinition) SetAction(value *Action) { + if m != nil { + m.Action = value + } +} +func (m *TaskDefinition) GetDiskMb() int32 { + if m != nil { + return m.DiskMb + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *TaskDefinition) SetDiskMb(value int32) { + if m != nil { + m.DiskMb = value + } +} +func (m *TaskDefinition) GetMemoryMb() int32 { + if m != nil { + return m.MemoryMb + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *TaskDefinition) SetMemoryMb(value int32) { + if m != nil { + m.MemoryMb = value + } +} +func (m *TaskDefinition) GetCpuWeight() uint32 { + if m != nil { + return m.CpuWeight + } + var defaultValue uint32 + defaultValue = 0 + return defaultValue +} +func (m *TaskDefinition) SetCpuWeight(value uint32) { + if m != nil { + m.CpuWeight = value + } +} +func (m *TaskDefinition) GetPrivileged() bool { + if m != nil { + return m.Privileged + } + var defaultValue bool + defaultValue = false + return defaultValue +} +func (m *TaskDefinition) SetPrivileged(value bool) { + if m != nil { + m.Privileged = value + } +} +func (m *TaskDefinition) GetLogSource() string { + if m != nil { + return m.LogSource + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskDefinition) SetLogSource(value string) { + if m != nil { + m.LogSource = value + } +} +func (m *TaskDefinition) GetLogGuid() string { + if m != nil { + return m.LogGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskDefinition) SetLogGuid(value string) { + if m != nil { + m.LogGuid = value + } +} +func (m *TaskDefinition) GetMetricsGuid() string { + if m != nil { + return m.MetricsGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskDefinition) SetMetricsGuid(value string) { + if m != nil { + m.MetricsGuid = value + } +} +func (m *TaskDefinition) GetResultFile() string { + if m != nil { + return m.ResultFile + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskDefinition) SetResultFile(value string) { + if m != nil { + m.ResultFile = value + } +} +func (m *TaskDefinition) GetCompletionCallbackUrl() string { + if m != nil { + return m.CompletionCallbackUrl + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskDefinition) SetCompletionCallbackUrl(value string) { + if m != nil { + m.CompletionCallbackUrl = value + } +} +func (m *TaskDefinition) GetAnnotation() string { + if m != nil { + return m.Annotation + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskDefinition) SetAnnotation(value string) { + if m != nil { + m.Annotation = value + } +} +func (m *TaskDefinition) GetEgressRules() []*SecurityGroupRule { + if m != nil { + return m.EgressRules + } + return nil +} +func (m *TaskDefinition) SetEgressRules(value []*SecurityGroupRule) { + if m != nil { + m.EgressRules = value + } +} +func (m *TaskDefinition) GetCachedDependencies() []*CachedDependency { + if m != nil { + return m.CachedDependencies + } + return nil +} +func (m *TaskDefinition) SetCachedDependencies(value []*CachedDependency) { + if m != nil { + m.CachedDependencies = value + } +} + +// Deprecated: marked deprecated in task.proto +func (m *TaskDefinition) GetLegacyDownloadUser() string { + if m != nil { + return m.LegacyDownloadUser + } + var defaultValue string + defaultValue = "" + return defaultValue +} + +// Deprecated: marked deprecated in task.proto +func (m *TaskDefinition) SetLegacyDownloadUser(value string) { + if m != nil { + m.LegacyDownloadUser = value + } +} +func (m *TaskDefinition) GetTrustedSystemCertificatesPath() string { + if m != nil { + return m.TrustedSystemCertificatesPath + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskDefinition) SetTrustedSystemCertificatesPath(value string) { + if m != nil { + m.TrustedSystemCertificatesPath = value + } +} +func (m *TaskDefinition) GetVolumeMounts() []*VolumeMount { + if m != nil { + return m.VolumeMounts + } + return nil +} +func (m *TaskDefinition) SetVolumeMounts(value []*VolumeMount) { + if m != nil { + m.VolumeMounts = value + } +} +func (m *TaskDefinition) GetNetwork() *Network { + if m != nil { + return m.Network + } + return nil +} +func (m *TaskDefinition) SetNetwork(value *Network) { + if m != nil { + m.Network = value + } +} +func (m *TaskDefinition) GetPlacementTags() []string { + if m != nil { + return m.PlacementTags + } + return nil +} +func (m *TaskDefinition) SetPlacementTags(value []string) { + if m != nil { + m.PlacementTags = value + } +} +func (m *TaskDefinition) GetMaxPids() int32 { + if m != nil { + return m.MaxPids + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *TaskDefinition) SetMaxPids(value int32) { + if m != nil { + m.MaxPids = value + } +} +func (m *TaskDefinition) GetCertificateProperties() *CertificateProperties { + if m != nil { + return m.CertificateProperties + } + return nil +} +func (m *TaskDefinition) SetCertificateProperties(value *CertificateProperties) { + if m != nil { + m.CertificateProperties = value + } +} +func (m *TaskDefinition) GetImageUsername() string { + if m != nil { + return m.ImageUsername + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskDefinition) SetImageUsername(value string) { + if m != nil { + m.ImageUsername = value + } +} +func (m *TaskDefinition) GetImagePassword() string { + if m != nil { + return m.ImagePassword + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskDefinition) SetImagePassword(value string) { + if m != nil { + m.ImagePassword = value + } +} +func (m *TaskDefinition) GetImageLayers() []*ImageLayer { + if m != nil { + return m.ImageLayers + } + return nil +} +func (m *TaskDefinition) SetImageLayers(value []*ImageLayer) { + if m != nil { + m.ImageLayers = value + } +} +func (m *TaskDefinition) GetLogRateLimit() *LogRateLimit { + if m != nil { + return m.LogRateLimit + } + return nil +} +func (m *TaskDefinition) SetLogRateLimit(value *LogRateLimit) { + if m != nil { + m.LogRateLimit = value + } +} +func (m *TaskDefinition) GetMetricTags() map[string]*MetricTagValue { + if m != nil { + return m.MetricTags + } + return nil +} +func (m *TaskDefinition) SetMetricTags(value map[string]*MetricTagValue) { + if m != nil { + m.MetricTags = value + } +} +func (m *TaskDefinition) GetVolumeMountedFiles() []*File { + if m != nil { + return m.VolumeMountedFiles + } + return nil +} +func (m *TaskDefinition) SetVolumeMountedFiles(value []*File) { + if m != nil { + m.VolumeMountedFiles = value + } +} +func (x *TaskDefinition) ToProto() *ProtoTaskDefinition { + if x == nil { + return nil + } + + proto := &ProtoTaskDefinition{ + RootFs: x.RootFs, + EnvironmentVariables: EnvironmentVariableToProtoSlice(x.EnvironmentVariables), + Action: x.Action.ToProto(), + DiskMb: x.DiskMb, + MemoryMb: x.MemoryMb, + CpuWeight: x.CpuWeight, + Privileged: x.Privileged, + LogSource: x.LogSource, + LogGuid: x.LogGuid, + MetricsGuid: x.MetricsGuid, + ResultFile: x.ResultFile, + CompletionCallbackUrl: x.CompletionCallbackUrl, + Annotation: x.Annotation, + EgressRules: SecurityGroupRuleToProtoSlice(x.EgressRules), + CachedDependencies: CachedDependencyToProtoSlice(x.CachedDependencies), + LegacyDownloadUser: x.LegacyDownloadUser, + TrustedSystemCertificatesPath: x.TrustedSystemCertificatesPath, + VolumeMounts: VolumeMountToProtoSlice(x.VolumeMounts), + Network: x.Network.ToProto(), + PlacementTags: x.PlacementTags, + MaxPids: x.MaxPids, + CertificateProperties: x.CertificateProperties.ToProto(), + ImageUsername: x.ImageUsername, + ImagePassword: x.ImagePassword, + ImageLayers: ImageLayerToProtoSlice(x.ImageLayers), + LogRateLimit: x.LogRateLimit.ToProto(), + MetricTags: TaskDefinitionMetricTagsToProtoMap(x.MetricTags), + VolumeMountedFiles: FileToProtoSlice(x.VolumeMountedFiles), + } + return proto +} + +func (x *ProtoTaskDefinition) FromProto() *TaskDefinition { + if x == nil { + return nil + } + + copysafe := &TaskDefinition{ + RootFs: x.RootFs, + EnvironmentVariables: EnvironmentVariableFromProtoSlice(x.EnvironmentVariables), + Action: x.Action.FromProto(), + DiskMb: x.DiskMb, + MemoryMb: x.MemoryMb, + CpuWeight: x.CpuWeight, + Privileged: x.Privileged, + LogSource: x.LogSource, + LogGuid: x.LogGuid, + MetricsGuid: x.MetricsGuid, + ResultFile: x.ResultFile, + CompletionCallbackUrl: x.CompletionCallbackUrl, + Annotation: x.Annotation, + EgressRules: SecurityGroupRuleFromProtoSlice(x.EgressRules), + CachedDependencies: CachedDependencyFromProtoSlice(x.CachedDependencies), + LegacyDownloadUser: x.LegacyDownloadUser, + TrustedSystemCertificatesPath: x.TrustedSystemCertificatesPath, + VolumeMounts: VolumeMountFromProtoSlice(x.VolumeMounts), + Network: x.Network.FromProto(), + PlacementTags: x.PlacementTags, + MaxPids: x.MaxPids, + CertificateProperties: x.CertificateProperties.FromProto(), + ImageUsername: x.ImageUsername, + ImagePassword: x.ImagePassword, + ImageLayers: ImageLayerFromProtoSlice(x.ImageLayers), + LogRateLimit: x.LogRateLimit.FromProto(), + MetricTags: TaskDefinitionMetricTagsFromProtoMap(x.MetricTags), + VolumeMountedFiles: FileFromProtoSlice(x.VolumeMountedFiles), + } + return copysafe +} + +func TaskDefinitionToProtoSlice(values []*TaskDefinition) []*ProtoTaskDefinition { + if values == nil { + return nil + } + result := make([]*ProtoTaskDefinition, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TaskDefinitionMetricTagsToProtoMap(values map[string]*MetricTagValue) map[string]*ProtoMetricTagValue { + if values == nil { + return nil + } + result := make(map[string]*ProtoMetricTagValue, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TaskDefinitionFromProtoSlice(values []*ProtoTaskDefinition) []*TaskDefinition { + if values == nil { + return nil + } + result := make([]*TaskDefinition, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +func TaskDefinitionMetricTagsFromProtoMap(values map[string]*ProtoMetricTagValue) map[string]*MetricTagValue { + if values == nil { + return nil + } + result := make(map[string]*MetricTagValue, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +type Task_State int32 + +const ( + Task_Invalid Task_State = 0 + Task_Pending Task_State = 1 + Task_Running Task_State = 2 + Task_Completed Task_State = 3 + Task_Resolving Task_State = 4 +) + +// Enum value maps for Task_State +var ( + Task_State_name = map[int32]string{ + 0: "Invalid", + 1: "Pending", + 2: "Running", + 3: "Completed", + 4: "Resolving", + } + Task_State_value = map[string]int32{ + "Invalid": 0, + "Pending": 1, + "Running": 2, + "Completed": 3, + "Resolving": 4, + } +) + +func (m Task_State) String() string { + s, ok := Task_State_name[int32(m)] + if ok { + return s + } + return strconv.Itoa(int(m)) +} + +// Prevent copylock errors when using ProtoTask directly +type Task struct { + TaskDefinition *TaskDefinition `json:"task_definition"` + TaskGuid string `json:"task_guid"` + Domain string `json:"domain"` + CreatedAt int64 `json:"created_at"` + UpdatedAt int64 `json:"updated_at"` + FirstCompletedAt int64 `json:"first_completed_at"` + State Task_State `json:"state"` + CellId string `json:"cell_id"` + Result string `json:"result"` + Failed bool `json:"failed"` + FailureReason string `json:"failure_reason"` + RejectionCount int32 `json:"rejection_count"` + RejectionReason string `json:"rejection_reason"` +} + +func (this *Task) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*Task) + if !ok { + that2, ok := that.(Task) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.TaskDefinition == nil { + if that1.TaskDefinition != nil { + return false + } + } else if !this.TaskDefinition.Equal(*that1.TaskDefinition) { + return false + } + if this.TaskGuid != that1.TaskGuid { + return false + } + if this.Domain != that1.Domain { + return false + } + if this.CreatedAt != that1.CreatedAt { + return false + } + if this.UpdatedAt != that1.UpdatedAt { + return false + } + if this.FirstCompletedAt != that1.FirstCompletedAt { + return false + } + if this.State != that1.State { + return false + } + if this.CellId != that1.CellId { + return false + } + if this.Result != that1.Result { + return false + } + if this.Failed != that1.Failed { + return false + } + if this.FailureReason != that1.FailureReason { + return false + } + if this.RejectionCount != that1.RejectionCount { + return false + } + if this.RejectionReason != that1.RejectionReason { + return false + } + return true +} +func (m *Task) GetTaskDefinition() *TaskDefinition { + if m != nil { + return m.TaskDefinition + } + return nil +} +func (m *Task) SetTaskDefinition(value *TaskDefinition) { + if m != nil { + m.TaskDefinition = value + } +} +func (m *Task) GetTaskGuid() string { + if m != nil { + return m.TaskGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *Task) SetTaskGuid(value string) { + if m != nil { + m.TaskGuid = value + } +} +func (m *Task) GetDomain() string { + if m != nil { + return m.Domain + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *Task) SetDomain(value string) { + if m != nil { + m.Domain = value + } +} +func (m *Task) GetCreatedAt() int64 { + if m != nil { + return m.CreatedAt + } + var defaultValue int64 + defaultValue = 0 + return defaultValue +} +func (m *Task) SetCreatedAt(value int64) { + if m != nil { + m.CreatedAt = value + } +} +func (m *Task) GetUpdatedAt() int64 { + if m != nil { + return m.UpdatedAt + } + var defaultValue int64 + defaultValue = 0 + return defaultValue +} +func (m *Task) SetUpdatedAt(value int64) { + if m != nil { + m.UpdatedAt = value + } +} +func (m *Task) GetFirstCompletedAt() int64 { + if m != nil { + return m.FirstCompletedAt + } + var defaultValue int64 + defaultValue = 0 + return defaultValue +} +func (m *Task) SetFirstCompletedAt(value int64) { + if m != nil { + m.FirstCompletedAt = value + } +} +func (m *Task) GetState() Task_State { + if m != nil { + return m.State + } + var defaultValue Task_State + defaultValue = 0 + return defaultValue +} +func (m *Task) SetState(value Task_State) { + if m != nil { + m.State = value + } +} +func (m *Task) GetCellId() string { + if m != nil { + return m.CellId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *Task) SetCellId(value string) { + if m != nil { + m.CellId = value + } +} +func (m *Task) GetResult() string { + if m != nil { + return m.Result + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *Task) SetResult(value string) { + if m != nil { + m.Result = value + } +} +func (m *Task) GetFailed() bool { + if m != nil { + return m.Failed + } + var defaultValue bool + defaultValue = false + return defaultValue +} +func (m *Task) SetFailed(value bool) { + if m != nil { + m.Failed = value + } +} +func (m *Task) GetFailureReason() string { + if m != nil { + return m.FailureReason + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *Task) SetFailureReason(value string) { + if m != nil { + m.FailureReason = value + } +} +func (m *Task) GetRejectionCount() int32 { + if m != nil { + return m.RejectionCount + } + var defaultValue int32 + defaultValue = 0 + return defaultValue +} +func (m *Task) SetRejectionCount(value int32) { + if m != nil { + m.RejectionCount = value + } +} +func (m *Task) GetRejectionReason() string { + if m != nil { + return m.RejectionReason + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *Task) SetRejectionReason(value string) { + if m != nil { + m.RejectionReason = value + } +} +func (x *Task) ToProto() *ProtoTask { + if x == nil { + return nil + } + + proto := &ProtoTask{ + TaskDefinition: x.TaskDefinition.ToProto(), + TaskGuid: x.TaskGuid, + Domain: x.Domain, + CreatedAt: x.CreatedAt, + UpdatedAt: x.UpdatedAt, + FirstCompletedAt: x.FirstCompletedAt, + State: ProtoTask_State(x.State), + CellId: x.CellId, + Result: x.Result, + Failed: x.Failed, + FailureReason: x.FailureReason, + RejectionCount: x.RejectionCount, + RejectionReason: x.RejectionReason, + } + return proto +} + +func (x *ProtoTask) FromProto() *Task { + if x == nil { + return nil + } + + copysafe := &Task{ + TaskDefinition: x.TaskDefinition.FromProto(), + TaskGuid: x.TaskGuid, + Domain: x.Domain, + CreatedAt: x.CreatedAt, + UpdatedAt: x.UpdatedAt, + FirstCompletedAt: x.FirstCompletedAt, + State: Task_State(x.State), + CellId: x.CellId, + Result: x.Result, + Failed: x.Failed, + FailureReason: x.FailureReason, + RejectionCount: x.RejectionCount, + RejectionReason: x.RejectionReason, + } + return copysafe +} + +func TaskToProtoSlice(values []*Task) []*ProtoTask { + if values == nil { + return nil + } + result := make([]*ProtoTask, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TaskFromProtoSlice(values []*ProtoTask) []*Task { + if values == nil { + return nil + } + result := make([]*Task, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/task_requests.go b/models/task_requests.go index a3fa65aa..844edf5a 100644 --- a/models/task_requests.go +++ b/models/task_requests.go @@ -1,5 +1,9 @@ package models +func (request *ProtoDesireTaskRequest) Validate() error { + return request.FromProto().Validate() +} + func (req *DesireTaskRequest) Validate() error { var validationError ValidationError @@ -24,6 +28,10 @@ func (req *DesireTaskRequest) Validate() error { return nil } +func (request *ProtoStartTaskRequest) Validate() error { + return request.FromProto().Validate() +} + func (req *StartTaskRequest) Validate() error { var validationError ValidationError @@ -41,6 +49,10 @@ func (req *StartTaskRequest) Validate() error { return nil } +func (request *ProtoCompleteTaskRequest) Validate() error { + return request.FromProto().Validate() +} + func (req *CompleteTaskRequest) Validate() error { var validationError ValidationError @@ -58,6 +70,10 @@ func (req *CompleteTaskRequest) Validate() error { return nil } +func (request *ProtoFailTaskRequest) Validate() error { + return request.FromProto().Validate() +} + func (req *FailTaskRequest) Validate() error { var validationError ValidationError @@ -75,6 +91,10 @@ func (req *FailTaskRequest) Validate() error { return nil } +func (request *ProtoRejectTaskRequest) Validate() error { + return request.FromProto().Validate() +} + func (req *RejectTaskRequest) Validate() error { var validationError ValidationError @@ -92,10 +112,18 @@ func (req *RejectTaskRequest) Validate() error { return nil } +func (request *ProtoTasksRequest) Validate() error { + return request.FromProto().Validate() +} + func (req *TasksRequest) Validate() error { return nil } +func (request *ProtoTaskByGuidRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *TaskByGuidRequest) Validate() error { var validationError ValidationError @@ -110,6 +138,10 @@ func (request *TaskByGuidRequest) Validate() error { return nil } +func (request *ProtoTaskGuidRequest) Validate() error { + return request.FromProto().Validate() +} + func (request *TaskGuidRequest) Validate() error { var validationError ValidationError diff --git a/models/task_requests.pb.go b/models/task_requests.pb.go index 0e1b642c..83037e98 100644 --- a/models/task_requests.pb.go +++ b/models/task_requests.pb.go @@ -1,4016 +1,867 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: task_requests.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type TaskLifecycleResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *TaskLifecycleResponse) Reset() { *m = TaskLifecycleResponse{} } -func (*TaskLifecycleResponse) ProtoMessage() {} -func (*TaskLifecycleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_13f778b8a0251259, []int{0} -} -func (m *TaskLifecycleResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TaskLifecycleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskLifecycleResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TaskLifecycleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskLifecycleResponse.Merge(m, src) -} -func (m *TaskLifecycleResponse) XXX_Size() int { - return m.Size() -} -func (m *TaskLifecycleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TaskLifecycleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TaskLifecycleResponse proto.InternalMessageInfo - -func (m *TaskLifecycleResponse) GetError() *Error { - if m != nil { - return m.Error - } - return nil -} - -type DesireTaskRequest struct { - TaskDefinition *TaskDefinition `protobuf:"bytes,1,opt,name=task_definition,json=taskDefinition,proto3" json:"task_definition"` - TaskGuid string `protobuf:"bytes,2,opt,name=task_guid,json=taskGuid,proto3" json:"task_guid"` - Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain"` -} - -func (m *DesireTaskRequest) Reset() { *m = DesireTaskRequest{} } -func (*DesireTaskRequest) ProtoMessage() {} -func (*DesireTaskRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_13f778b8a0251259, []int{1} -} -func (m *DesireTaskRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DesireTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DesireTaskRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DesireTaskRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DesireTaskRequest.Merge(m, src) -} -func (m *DesireTaskRequest) XXX_Size() int { - return m.Size() -} -func (m *DesireTaskRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DesireTaskRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DesireTaskRequest proto.InternalMessageInfo +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -func (m *DesireTaskRequest) GetTaskDefinition() *TaskDefinition { - if m != nil { - return m.TaskDefinition - } - return nil +type ProtoTaskLifecycleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *DesireTaskRequest) GetTaskGuid() string { - if m != nil { - return m.TaskGuid - } - return "" +func (x *ProtoTaskLifecycleResponse) Reset() { + *x = ProtoTaskLifecycleResponse{} + mi := &file_task_requests_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *DesireTaskRequest) GetDomain() string { - if m != nil { - return m.Domain - } - return "" +func (x *ProtoTaskLifecycleResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -type StartTaskRequest struct { - TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,json=taskGuid,proto3" json:"task_guid"` - CellId string `protobuf:"bytes,2,opt,name=cell_id,json=cellId,proto3" json:"cell_id"` -} +func (*ProtoTaskLifecycleResponse) ProtoMessage() {} -func (m *StartTaskRequest) Reset() { *m = StartTaskRequest{} } -func (*StartTaskRequest) ProtoMessage() {} -func (*StartTaskRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_13f778b8a0251259, []int{2} -} -func (m *StartTaskRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StartTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StartTaskRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoTaskLifecycleResponse) ProtoReflect() protoreflect.Message { + mi := &file_task_requests_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil - } -} -func (m *StartTaskRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StartTaskRequest.Merge(m, src) -} -func (m *StartTaskRequest) XXX_Size() int { - return m.Size() -} -func (m *StartTaskRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StartTaskRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StartTaskRequest proto.InternalMessageInfo - -func (m *StartTaskRequest) GetTaskGuid() string { - if m != nil { - return m.TaskGuid + return ms } - return "" -} - -func (m *StartTaskRequest) GetCellId() string { - if m != nil { - return m.CellId - } - return "" -} - -type StartTaskResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - ShouldStart bool `protobuf:"varint,2,opt,name=should_start,json=shouldStart,proto3" json:"should_start"` + return mi.MessageOf(x) } -func (m *StartTaskResponse) Reset() { *m = StartTaskResponse{} } -func (*StartTaskResponse) ProtoMessage() {} -func (*StartTaskResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_13f778b8a0251259, []int{3} -} -func (m *StartTaskResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StartTaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StartTaskResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StartTaskResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StartTaskResponse.Merge(m, src) -} -func (m *StartTaskResponse) XXX_Size() int { - return m.Size() -} -func (m *StartTaskResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StartTaskResponse.DiscardUnknown(m) +// Deprecated: Use ProtoTaskLifecycleResponse.ProtoReflect.Descriptor instead. +func (*ProtoTaskLifecycleResponse) Descriptor() ([]byte, []int) { + return file_task_requests_proto_rawDescGZIP(), []int{0} } -var xxx_messageInfo_StartTaskResponse proto.InternalMessageInfo - -func (m *StartTaskResponse) GetError() *Error { - if m != nil { - return m.Error +func (x *ProtoTaskLifecycleResponse) GetError() *ProtoError { + if x != nil { + return x.Error } return nil } -func (m *StartTaskResponse) GetShouldStart() bool { - if m != nil { - return m.ShouldStart - } - return false +type ProtoDesireTaskRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskDefinition *ProtoTaskDefinition `protobuf:"bytes,1,opt,name=task_definition,proto3" json:"task_definition,omitempty"` + TaskGuid string `protobuf:"bytes,2,opt,name=task_guid,proto3" json:"task_guid,omitempty"` + Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -// Deprecated: Do not use. -type FailTaskRequest struct { - TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,json=taskGuid,proto3" json:"task_guid"` - FailureReason string `protobuf:"bytes,2,opt,name=failure_reason,json=failureReason,proto3" json:"failure_reason"` +func (x *ProtoDesireTaskRequest) Reset() { + *x = ProtoDesireTaskRequest{} + mi := &file_task_requests_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *FailTaskRequest) Reset() { *m = FailTaskRequest{} } -func (*FailTaskRequest) ProtoMessage() {} -func (*FailTaskRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_13f778b8a0251259, []int{4} -} -func (m *FailTaskRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FailTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FailTaskRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *FailTaskRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FailTaskRequest.Merge(m, src) -} -func (m *FailTaskRequest) XXX_Size() int { - return m.Size() -} -func (m *FailTaskRequest) XXX_DiscardUnknown() { - xxx_messageInfo_FailTaskRequest.DiscardUnknown(m) +func (x *ProtoDesireTaskRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_FailTaskRequest proto.InternalMessageInfo +func (*ProtoDesireTaskRequest) ProtoMessage() {} -func (m *FailTaskRequest) GetTaskGuid() string { - if m != nil { - return m.TaskGuid - } - return "" -} - -func (m *FailTaskRequest) GetFailureReason() string { - if m != nil { - return m.FailureReason +func (x *ProtoDesireTaskRequest) ProtoReflect() protoreflect.Message { + mi := &file_task_requests_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -type RejectTaskRequest struct { - TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,json=taskGuid,proto3" json:"task_guid"` - RejectionReason string `protobuf:"bytes,2,opt,name=rejection_reason,json=rejectionReason,proto3" json:"rejection_reason"` +// Deprecated: Use ProtoDesireTaskRequest.ProtoReflect.Descriptor instead. +func (*ProtoDesireTaskRequest) Descriptor() ([]byte, []int) { + return file_task_requests_proto_rawDescGZIP(), []int{1} } -func (m *RejectTaskRequest) Reset() { *m = RejectTaskRequest{} } -func (*RejectTaskRequest) ProtoMessage() {} -func (*RejectTaskRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_13f778b8a0251259, []int{5} -} -func (m *RejectTaskRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RejectTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RejectTaskRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ProtoDesireTaskRequest) GetTaskDefinition() *ProtoTaskDefinition { + if x != nil { + return x.TaskDefinition } + return nil } -func (m *RejectTaskRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RejectTaskRequest.Merge(m, src) -} -func (m *RejectTaskRequest) XXX_Size() int { - return m.Size() -} -func (m *RejectTaskRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RejectTaskRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RejectTaskRequest proto.InternalMessageInfo -func (m *RejectTaskRequest) GetTaskGuid() string { - if m != nil { - return m.TaskGuid +func (x *ProtoDesireTaskRequest) GetTaskGuid() string { + if x != nil { + return x.TaskGuid } return "" } -func (m *RejectTaskRequest) GetRejectionReason() string { - if m != nil { - return m.RejectionReason +func (x *ProtoDesireTaskRequest) GetDomain() string { + if x != nil { + return x.Domain } return "" } -type TaskGuidRequest struct { - TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,json=taskGuid,proto3" json:"task_guid"` +type ProtoStartTaskRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,proto3" json:"task_guid,omitempty"` + CellId string `protobuf:"bytes,2,opt,name=cell_id,proto3" json:"cell_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *TaskGuidRequest) Reset() { *m = TaskGuidRequest{} } -func (*TaskGuidRequest) ProtoMessage() {} -func (*TaskGuidRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_13f778b8a0251259, []int{6} -} -func (m *TaskGuidRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TaskGuidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskGuidRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TaskGuidRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskGuidRequest.Merge(m, src) -} -func (m *TaskGuidRequest) XXX_Size() int { - return m.Size() +func (x *ProtoStartTaskRequest) Reset() { + *x = ProtoStartTaskRequest{} + mi := &file_task_requests_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TaskGuidRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TaskGuidRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TaskGuidRequest proto.InternalMessageInfo -func (m *TaskGuidRequest) GetTaskGuid() string { - if m != nil { - return m.TaskGuid - } - return "" +func (x *ProtoStartTaskRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -type CompleteTaskRequest struct { - TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,json=taskGuid,proto3" json:"task_guid"` - CellId string `protobuf:"bytes,2,opt,name=cell_id,json=cellId,proto3" json:"cell_id"` - Failed bool `protobuf:"varint,3,opt,name=failed,proto3" json:"failed"` - FailureReason string `protobuf:"bytes,4,opt,name=failure_reason,json=failureReason,proto3" json:"failure_reason"` - Result string `protobuf:"bytes,5,opt,name=result,proto3" json:"result"` -} +func (*ProtoStartTaskRequest) ProtoMessage() {} -func (m *CompleteTaskRequest) Reset() { *m = CompleteTaskRequest{} } -func (*CompleteTaskRequest) ProtoMessage() {} -func (*CompleteTaskRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_13f778b8a0251259, []int{7} -} -func (m *CompleteTaskRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CompleteTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CompleteTaskRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoStartTaskRequest) ProtoReflect() protoreflect.Message { + mi := &file_task_requests_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *CompleteTaskRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CompleteTaskRequest.Merge(m, src) -} -func (m *CompleteTaskRequest) XXX_Size() int { - return m.Size() -} -func (m *CompleteTaskRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CompleteTaskRequest.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_CompleteTaskRequest proto.InternalMessageInfo +// Deprecated: Use ProtoStartTaskRequest.ProtoReflect.Descriptor instead. +func (*ProtoStartTaskRequest) Descriptor() ([]byte, []int) { + return file_task_requests_proto_rawDescGZIP(), []int{2} +} -func (m *CompleteTaskRequest) GetTaskGuid() string { - if m != nil { - return m.TaskGuid +func (x *ProtoStartTaskRequest) GetTaskGuid() string { + if x != nil { + return x.TaskGuid } return "" } -func (m *CompleteTaskRequest) GetCellId() string { - if m != nil { - return m.CellId +func (x *ProtoStartTaskRequest) GetCellId() string { + if x != nil { + return x.CellId } return "" } -func (m *CompleteTaskRequest) GetFailed() bool { - if m != nil { - return m.Failed - } - return false +type ProtoStartTaskResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + ShouldStart bool `protobuf:"varint,2,opt,name=should_start,proto3" json:"should_start,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CompleteTaskRequest) GetFailureReason() string { - if m != nil { - return m.FailureReason - } - return "" +func (x *ProtoStartTaskResponse) Reset() { + *x = ProtoStartTaskResponse{} + mi := &file_task_requests_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CompleteTaskRequest) GetResult() string { - if m != nil { - return m.Result - } - return "" +func (x *ProtoStartTaskResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -type TaskCallbackResponse struct { - TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,json=taskGuid,proto3" json:"task_guid"` - Failed bool `protobuf:"varint,2,opt,name=failed,proto3" json:"failed"` - FailureReason string `protobuf:"bytes,3,opt,name=failure_reason,json=failureReason,proto3" json:"failure_reason"` - Result string `protobuf:"bytes,4,opt,name=result,proto3" json:"result"` - Annotation string `protobuf:"bytes,5,opt,name=annotation,proto3" json:"annotation,omitempty"` - CreatedAt int64 `protobuf:"varint,6,opt,name=created_at,json=createdAt,proto3" json:"created_at"` -} +func (*ProtoStartTaskResponse) ProtoMessage() {} -func (m *TaskCallbackResponse) Reset() { *m = TaskCallbackResponse{} } -func (*TaskCallbackResponse) ProtoMessage() {} -func (*TaskCallbackResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_13f778b8a0251259, []int{8} -} -func (m *TaskCallbackResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TaskCallbackResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskCallbackResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoStartTaskResponse) ProtoReflect() protoreflect.Message { + mi := &file_task_requests_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *TaskCallbackResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskCallbackResponse.Merge(m, src) -} -func (m *TaskCallbackResponse) XXX_Size() int { - return m.Size() -} -func (m *TaskCallbackResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TaskCallbackResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TaskCallbackResponse proto.InternalMessageInfo -func (m *TaskCallbackResponse) GetTaskGuid() string { - if m != nil { - return m.TaskGuid - } - return "" +// Deprecated: Use ProtoStartTaskResponse.ProtoReflect.Descriptor instead. +func (*ProtoStartTaskResponse) Descriptor() ([]byte, []int) { + return file_task_requests_proto_rawDescGZIP(), []int{3} } -func (m *TaskCallbackResponse) GetFailed() bool { - if m != nil { - return m.Failed +func (x *ProtoStartTaskResponse) GetError() *ProtoError { + if x != nil { + return x.Error } - return false + return nil } -func (m *TaskCallbackResponse) GetFailureReason() string { - if m != nil { - return m.FailureReason +func (x *ProtoStartTaskResponse) GetShouldStart() bool { + if x != nil { + return x.ShouldStart } - return "" + return false } -func (m *TaskCallbackResponse) GetResult() string { - if m != nil { - return m.Result - } - return "" +// Deprecated: Marked as deprecated in task_requests.proto. +type ProtoFailTaskRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,proto3" json:"task_guid,omitempty"` + FailureReason string `protobuf:"bytes,2,opt,name=failure_reason,proto3" json:"failure_reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *TaskCallbackResponse) GetAnnotation() string { - if m != nil { - return m.Annotation - } - return "" +func (x *ProtoFailTaskRequest) Reset() { + *x = ProtoFailTaskRequest{} + mi := &file_task_requests_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TaskCallbackResponse) GetCreatedAt() int64 { - if m != nil { - return m.CreatedAt - } - return 0 +func (x *ProtoFailTaskRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -type TasksRequest struct { - Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain"` - CellId string `protobuf:"bytes,2,opt,name=cell_id,json=cellId,proto3" json:"cell_id"` -} +func (*ProtoFailTaskRequest) ProtoMessage() {} -func (m *TasksRequest) Reset() { *m = TasksRequest{} } -func (*TasksRequest) ProtoMessage() {} -func (*TasksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_13f778b8a0251259, []int{9} -} -func (m *TasksRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TasksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TasksRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoFailTaskRequest) ProtoReflect() protoreflect.Message { + mi := &file_task_requests_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *TasksRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TasksRequest.Merge(m, src) -} -func (m *TasksRequest) XXX_Size() int { - return m.Size() -} -func (m *TasksRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TasksRequest.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_TasksRequest proto.InternalMessageInfo +// Deprecated: Use ProtoFailTaskRequest.ProtoReflect.Descriptor instead. +func (*ProtoFailTaskRequest) Descriptor() ([]byte, []int) { + return file_task_requests_proto_rawDescGZIP(), []int{4} +} -func (m *TasksRequest) GetDomain() string { - if m != nil { - return m.Domain +func (x *ProtoFailTaskRequest) GetTaskGuid() string { + if x != nil { + return x.TaskGuid } return "" } -func (m *TasksRequest) GetCellId() string { - if m != nil { - return m.CellId +func (x *ProtoFailTaskRequest) GetFailureReason() string { + if x != nil { + return x.FailureReason } return "" } -type TasksResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - Tasks []*Task `protobuf:"bytes,2,rep,name=tasks,proto3" json:"tasks,omitempty"` +type ProtoRejectTaskRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,proto3" json:"task_guid,omitempty"` + RejectionReason string `protobuf:"bytes,2,opt,name=rejection_reason,proto3" json:"rejection_reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *TasksResponse) Reset() { *m = TasksResponse{} } -func (*TasksResponse) ProtoMessage() {} -func (*TasksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_13f778b8a0251259, []int{10} +func (x *ProtoRejectTaskRequest) Reset() { + *x = ProtoRejectTaskRequest{} + mi := &file_task_requests_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TasksResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TasksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TasksResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TasksResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TasksResponse.Merge(m, src) -} -func (m *TasksResponse) XXX_Size() int { - return m.Size() -} -func (m *TasksResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TasksResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TasksResponse proto.InternalMessageInfo -func (m *TasksResponse) GetError() *Error { - if m != nil { - return m.Error - } - return nil -} - -func (m *TasksResponse) GetTasks() []*Task { - if m != nil { - return m.Tasks - } - return nil +func (x *ProtoRejectTaskRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -type TaskByGuidRequest struct { - TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,json=taskGuid,proto3" json:"task_guid"` -} +func (*ProtoRejectTaskRequest) ProtoMessage() {} -func (m *TaskByGuidRequest) Reset() { *m = TaskByGuidRequest{} } -func (*TaskByGuidRequest) ProtoMessage() {} -func (*TaskByGuidRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_13f778b8a0251259, []int{11} -} -func (m *TaskByGuidRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TaskByGuidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskByGuidRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoRejectTaskRequest) ProtoReflect() protoreflect.Message { + mi := &file_task_requests_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *TaskByGuidRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskByGuidRequest.Merge(m, src) -} -func (m *TaskByGuidRequest) XXX_Size() int { - return m.Size() -} -func (m *TaskByGuidRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TaskByGuidRequest.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_TaskByGuidRequest proto.InternalMessageInfo +// Deprecated: Use ProtoRejectTaskRequest.ProtoReflect.Descriptor instead. +func (*ProtoRejectTaskRequest) Descriptor() ([]byte, []int) { + return file_task_requests_proto_rawDescGZIP(), []int{5} +} -func (m *TaskByGuidRequest) GetTaskGuid() string { - if m != nil { - return m.TaskGuid +func (x *ProtoRejectTaskRequest) GetTaskGuid() string { + if x != nil { + return x.TaskGuid } return "" } -type TaskResponse struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - Task *Task `protobuf:"bytes,2,opt,name=task,proto3" json:"task,omitempty"` -} - -func (m *TaskResponse) Reset() { *m = TaskResponse{} } -func (*TaskResponse) ProtoMessage() {} -func (*TaskResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_13f778b8a0251259, []int{12} -} -func (m *TaskResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ProtoRejectTaskRequest) GetRejectionReason() string { + if x != nil { + return x.RejectionReason } -} -func (m *TaskResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskResponse.Merge(m, src) -} -func (m *TaskResponse) XXX_Size() int { - return m.Size() -} -func (m *TaskResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TaskResponse.DiscardUnknown(m) + return "" } -var xxx_messageInfo_TaskResponse proto.InternalMessageInfo - -func (m *TaskResponse) GetError() *Error { - if m != nil { - return m.Error - } - return nil +type ProtoTaskGuidRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,proto3" json:"task_guid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *TaskResponse) GetTask() *Task { - if m != nil { - return m.Task - } - return nil +func (x *ProtoTaskGuidRequest) Reset() { + *x = ProtoTaskGuidRequest{} + mi := &file_task_requests_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func init() { - proto.RegisterType((*TaskLifecycleResponse)(nil), "models.TaskLifecycleResponse") - proto.RegisterType((*DesireTaskRequest)(nil), "models.DesireTaskRequest") - proto.RegisterType((*StartTaskRequest)(nil), "models.StartTaskRequest") - proto.RegisterType((*StartTaskResponse)(nil), "models.StartTaskResponse") - proto.RegisterType((*FailTaskRequest)(nil), "models.FailTaskRequest") - proto.RegisterType((*RejectTaskRequest)(nil), "models.RejectTaskRequest") - proto.RegisterType((*TaskGuidRequest)(nil), "models.TaskGuidRequest") - proto.RegisterType((*CompleteTaskRequest)(nil), "models.CompleteTaskRequest") - proto.RegisterType((*TaskCallbackResponse)(nil), "models.TaskCallbackResponse") - proto.RegisterType((*TasksRequest)(nil), "models.TasksRequest") - proto.RegisterType((*TasksResponse)(nil), "models.TasksResponse") - proto.RegisterType((*TaskByGuidRequest)(nil), "models.TaskByGuidRequest") - proto.RegisterType((*TaskResponse)(nil), "models.TaskResponse") -} - -func init() { proto.RegisterFile("task_requests.proto", fileDescriptor_13f778b8a0251259) } - -var fileDescriptor_13f778b8a0251259 = []byte{ - // 663 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xce, 0x26, 0x6d, 0x68, 0x27, 0x4d, 0xd3, 0xb8, 0x05, 0x59, 0x3d, 0xac, 0x23, 0xc3, 0x21, - 0x42, 0x6a, 0x2a, 0xb5, 0x5c, 0x40, 0xa0, 0x8a, 0xb4, 0x80, 0x90, 0x38, 0x2d, 0x45, 0xea, 0x2d, - 0xda, 0xd8, 0x9b, 0xd4, 0xd4, 0xf1, 0x16, 0xef, 0xfa, 0x50, 0x89, 0x43, 0x1f, 0x81, 0x03, 0x0f, - 0xc1, 0x2b, 0xf0, 0x06, 0x1c, 0x7b, 0xec, 0xc9, 0xa2, 0xee, 0x05, 0xf9, 0xd4, 0x47, 0x40, 0xbb, - 0x76, 0x9b, 0x1f, 0x28, 0x6a, 0x22, 0x71, 0xda, 0x9d, 0x6f, 0xc6, 0xdf, 0xcc, 0x37, 0x3b, 0x99, - 0xc0, 0xaa, 0xa4, 0xe2, 0xa8, 0x13, 0xb2, 0x4f, 0x11, 0x13, 0x52, 0xb4, 0x8e, 0x43, 0x2e, 0xb9, - 0x51, 0x1e, 0x70, 0x97, 0xf9, 0x62, 0x7d, 0xa3, 0xef, 0xc9, 0xc3, 0xa8, 0xdb, 0x72, 0xf8, 0x60, - 0xb3, 0xcf, 0xfb, 0x7c, 0x53, 0xbb, 0xbb, 0x51, 0x4f, 0x5b, 0xda, 0xd0, 0xb7, 0xec, 0xb3, 0x75, - 0x50, 0x5c, 0xf9, 0xbd, 0xc2, 0xc2, 0x90, 0x87, 0x99, 0x61, 0x3f, 0x87, 0xfb, 0xfb, 0x54, 0x1c, - 0xbd, 0xf3, 0x7a, 0xcc, 0x39, 0x71, 0x7c, 0x46, 0x98, 0x38, 0xe6, 0x81, 0x60, 0xc6, 0x43, 0x98, - 0xd7, 0x71, 0x26, 0x6a, 0xa0, 0x66, 0x65, 0xab, 0xda, 0xca, 0x12, 0xb7, 0x5e, 0x29, 0x90, 0x64, - 0x3e, 0xfb, 0x3b, 0x82, 0xfa, 0x1e, 0x13, 0x5e, 0xc8, 0x14, 0x09, 0xc9, 0x4a, 0x35, 0xf6, 0xa1, - 0xa6, 0x4b, 0x77, 0x59, 0xcf, 0x0b, 0x3c, 0xe9, 0xf1, 0x20, 0x27, 0x79, 0x70, 0x4d, 0xa2, 0xa2, - 0xf7, 0x6e, 0xbc, 0xed, 0xd5, 0x34, 0xb6, 0x26, 0x3f, 0x21, 0xcb, 0x72, 0x2c, 0xc8, 0x78, 0x0c, - 0x8b, 0x3a, 0xa4, 0x1f, 0x79, 0xae, 0x59, 0x6c, 0xa0, 0xe6, 0x62, 0xbb, 0x9a, 0xc6, 0xd6, 0x10, - 0x24, 0x0b, 0xea, 0xfa, 0x26, 0xf2, 0x5c, 0xc3, 0x86, 0xb2, 0xcb, 0x07, 0xd4, 0x0b, 0xcc, 0x92, - 0x0e, 0x84, 0x34, 0xb6, 0x72, 0x84, 0xe4, 0xa7, 0xed, 0xc2, 0xca, 0x7b, 0x49, 0x43, 0x39, 0x5a, - 0xf9, 0x58, 0x0e, 0xf4, 0xef, 0x1c, 0x8f, 0xe0, 0x9e, 0xc3, 0x7c, 0xbf, 0x73, 0x53, 0x4d, 0x25, - 0x8d, 0xad, 0x6b, 0x88, 0x94, 0xd5, 0xe5, 0xad, 0x6b, 0x0f, 0xa0, 0x3e, 0x92, 0x65, 0x8a, 0xde, - 0x1a, 0xdb, 0xb0, 0x24, 0x0e, 0x79, 0xe4, 0xbb, 0x1d, 0xa1, 0x08, 0x74, 0x92, 0x85, 0xf6, 0x4a, - 0x1a, 0x5b, 0x63, 0x38, 0xa9, 0x64, 0x96, 0xce, 0x62, 0x7f, 0x86, 0xda, 0x6b, 0xea, 0xf9, 0xb3, - 0x6a, 0x7a, 0x0a, 0xcb, 0x3d, 0xea, 0xf9, 0x51, 0xc8, 0x3a, 0x21, 0xa3, 0x82, 0x07, 0xb9, 0x34, - 0x23, 0x8d, 0xad, 0x09, 0x0f, 0xa9, 0xe6, 0x36, 0xd1, 0xe6, 0xb3, 0xa2, 0x89, 0xec, 0x53, 0x04, - 0x75, 0xc2, 0x3e, 0x32, 0x67, 0xe6, 0xa6, 0xee, 0xc0, 0x4a, 0xa8, 0x09, 0x3c, 0x1e, 0x8c, 0x97, - 0xb0, 0x96, 0xc6, 0xd6, 0x1f, 0x3e, 0x52, 0xbb, 0x41, 0xb2, 0x32, 0xec, 0x17, 0x50, 0xdb, 0xcf, - 0xc9, 0x66, 0xc8, 0x6f, 0xa7, 0x08, 0x56, 0x77, 0xf9, 0xe0, 0xd8, 0x67, 0x92, 0xfd, 0xd7, 0xc1, - 0x50, 0x23, 0xaa, 0x1a, 0xc8, 0x5c, 0x3d, 0xa2, 0x0b, 0xd9, 0x88, 0x66, 0x08, 0xc9, 0xcf, 0xbf, - 0x3c, 0xc7, 0xdc, 0x1d, 0x9f, 0x43, 0xd1, 0x87, 0x4c, 0x44, 0xbe, 0x34, 0xe7, 0x87, 0xbf, 0x80, - 0x0c, 0x21, 0xf9, 0x69, 0x7f, 0x2d, 0xc2, 0x9a, 0x12, 0xb9, 0x4b, 0x7d, 0xbf, 0x4b, 0x9d, 0xe1, - 0x7c, 0x4e, 0xa3, 0x76, 0xa8, 0xa3, 0x38, 0x85, 0x8e, 0xd2, 0xf4, 0x3a, 0xe6, 0x6e, 0xd3, 0x61, - 0x60, 0x00, 0x1a, 0x04, 0x5c, 0x52, 0xbd, 0x6a, 0xb4, 0x5e, 0x32, 0x82, 0x18, 0x1b, 0x00, 0x4e, - 0xc8, 0xa8, 0x64, 0x6e, 0x87, 0x4a, 0xb3, 0xdc, 0x40, 0xcd, 0x52, 0x7b, 0x39, 0x8d, 0xad, 0x11, - 0x94, 0x2c, 0xe6, 0xf7, 0x97, 0xd2, 0x3e, 0x80, 0x25, 0xd5, 0x15, 0x71, 0xfd, 0xf6, 0xc3, 0x65, - 0x82, 0x6e, 0x5b, 0x26, 0x77, 0x5c, 0x06, 0x07, 0x50, 0xcd, 0x99, 0xa7, 0x59, 0x04, 0x36, 0xcc, - 0xab, 0x6e, 0x0b, 0xb3, 0xd8, 0x28, 0x35, 0x2b, 0x5b, 0x4b, 0xa3, 0x4b, 0x94, 0x64, 0x2e, 0x7b, - 0x07, 0xea, 0xca, 0x6c, 0x9f, 0xcc, 0x3a, 0xf8, 0x1f, 0x32, 0xd1, 0xd3, 0x55, 0xd6, 0x80, 0x39, - 0x45, 0xa0, 0x25, 0x4f, 0x16, 0xa6, 0x3d, 0xed, 0x27, 0x67, 0x17, 0xb8, 0x70, 0x7e, 0x81, 0x0b, - 0x57, 0x17, 0x18, 0x9d, 0x26, 0x18, 0x7d, 0x4b, 0x30, 0xfa, 0x91, 0x60, 0x74, 0x96, 0x60, 0xf4, - 0x33, 0xc1, 0xe8, 0x57, 0x82, 0x0b, 0x57, 0x09, 0x46, 0x5f, 0x2e, 0x71, 0xe1, 0xec, 0x12, 0x17, - 0xce, 0x2f, 0x71, 0xa1, 0x5b, 0xd6, 0xff, 0x4d, 0xdb, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x42, - 0xbf, 0x2a, 0x4c, 0x02, 0x07, 0x00, 0x00, -} - -func (this *TaskLifecycleResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*TaskLifecycleResponse) - if !ok { - that2, ok := that.(TaskLifecycleResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Error.Equal(that1.Error) { - return false - } - return true +func (x *ProtoTaskGuidRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *DesireTaskRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*DesireTaskRequest) - if !ok { - that2, ok := that.(DesireTaskRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.TaskDefinition.Equal(that1.TaskDefinition) { - return false - } - if this.TaskGuid != that1.TaskGuid { - return false - } - if this.Domain != that1.Domain { - return false - } - return true -} -func (this *StartTaskRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoTaskGuidRequest) ProtoMessage() {} - that1, ok := that.(*StartTaskRequest) - if !ok { - that2, ok := that.(StartTaskRequest) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoTaskGuidRequest) ProtoReflect() protoreflect.Message { + mi := &file_task_requests_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TaskGuid != that1.TaskGuid { - return false - } - if this.CellId != that1.CellId { - return false - } - return true + return mi.MessageOf(x) } -func (this *StartTaskResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*StartTaskResponse) - if !ok { - that2, ok := that.(StartTaskResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Error.Equal(that1.Error) { - return false - } - if this.ShouldStart != that1.ShouldStart { - return false - } - return true +// Deprecated: Use ProtoTaskGuidRequest.ProtoReflect.Descriptor instead. +func (*ProtoTaskGuidRequest) Descriptor() ([]byte, []int) { + return file_task_requests_proto_rawDescGZIP(), []int{6} } -func (this *FailTaskRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*FailTaskRequest) - if !ok { - that2, ok := that.(FailTaskRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TaskGuid != that1.TaskGuid { - return false +func (x *ProtoTaskGuidRequest) GetTaskGuid() string { + if x != nil { + return x.TaskGuid } - if this.FailureReason != that1.FailureReason { - return false - } - return true + return "" } -func (this *RejectTaskRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*RejectTaskRequest) - if !ok { - that2, ok := that.(RejectTaskRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TaskGuid != that1.TaskGuid { - return false - } - if this.RejectionReason != that1.RejectionReason { - return false - } - return true +type ProtoCompleteTaskRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,proto3" json:"task_guid,omitempty"` + CellId string `protobuf:"bytes,2,opt,name=cell_id,proto3" json:"cell_id,omitempty"` + Failed bool `protobuf:"varint,3,opt,name=failed,proto3" json:"failed,omitempty"` + FailureReason string `protobuf:"bytes,4,opt,name=failure_reason,proto3" json:"failure_reason,omitempty"` + Result string `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (this *TaskGuidRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*TaskGuidRequest) - if !ok { - that2, ok := that.(TaskGuidRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TaskGuid != that1.TaskGuid { - return false - } - return true +func (x *ProtoCompleteTaskRequest) Reset() { + *x = ProtoCompleteTaskRequest{} + mi := &file_task_requests_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (this *CompleteTaskRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*CompleteTaskRequest) - if !ok { - that2, ok := that.(CompleteTaskRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TaskGuid != that1.TaskGuid { - return false - } - if this.CellId != that1.CellId { - return false - } - if this.Failed != that1.Failed { - return false - } - if this.FailureReason != that1.FailureReason { - return false - } - if this.Result != that1.Result { - return false - } - return true +func (x *ProtoCompleteTaskRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *TaskCallbackResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*TaskCallbackResponse) - if !ok { - that2, ok := that.(TaskCallbackResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TaskGuid != that1.TaskGuid { - return false - } - if this.Failed != that1.Failed { - return false - } - if this.FailureReason != that1.FailureReason { - return false - } - if this.Result != that1.Result { - return false - } - if this.Annotation != that1.Annotation { - return false - } - if this.CreatedAt != that1.CreatedAt { - return false - } - return true -} -func (this *TasksRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoCompleteTaskRequest) ProtoMessage() {} - that1, ok := that.(*TasksRequest) - if !ok { - that2, ok := that.(TasksRequest) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoCompleteTaskRequest) ProtoReflect() protoreflect.Message { + mi := &file_task_requests_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Domain != that1.Domain { - return false - } - if this.CellId != that1.CellId { - return false - } - return true + return mi.MessageOf(x) } -func (this *TasksResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*TasksResponse) - if !ok { - that2, ok := that.(TasksResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Error.Equal(that1.Error) { - return false - } - if len(this.Tasks) != len(that1.Tasks) { - return false - } - for i := range this.Tasks { - if !this.Tasks[i].Equal(that1.Tasks[i]) { - return false - } - } - return true +// Deprecated: Use ProtoCompleteTaskRequest.ProtoReflect.Descriptor instead. +func (*ProtoCompleteTaskRequest) Descriptor() ([]byte, []int) { + return file_task_requests_proto_rawDescGZIP(), []int{7} } -func (this *TaskByGuidRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*TaskByGuidRequest) - if !ok { - that2, ok := that.(TaskByGuidRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false +func (x *ProtoCompleteTaskRequest) GetTaskGuid() string { + if x != nil { + return x.TaskGuid } - if this.TaskGuid != that1.TaskGuid { - return false - } - return true + return "" } -func (this *TaskResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*TaskResponse) - if !ok { - that2, ok := that.(TaskResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Error.Equal(that1.Error) { - return false - } - if !this.Task.Equal(that1.Task) { - return false - } - return true -} -func (this *TaskLifecycleResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.TaskLifecycleResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DesireTaskRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&models.DesireTaskRequest{") - if this.TaskDefinition != nil { - s = append(s, "TaskDefinition: "+fmt.Sprintf("%#v", this.TaskDefinition)+",\n") - } - s = append(s, "TaskGuid: "+fmt.Sprintf("%#v", this.TaskGuid)+",\n") - s = append(s, "Domain: "+fmt.Sprintf("%#v", this.Domain)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StartTaskRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.StartTaskRequest{") - s = append(s, "TaskGuid: "+fmt.Sprintf("%#v", this.TaskGuid)+",\n") - s = append(s, "CellId: "+fmt.Sprintf("%#v", this.CellId)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StartTaskResponse) GoString() string { - if this == nil { - return "nil" +func (x *ProtoCompleteTaskRequest) GetCellId() string { + if x != nil { + return x.CellId } - s := make([]string, 0, 6) - s = append(s, "&models.StartTaskResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - s = append(s, "ShouldStart: "+fmt.Sprintf("%#v", this.ShouldStart)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FailTaskRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.FailTaskRequest{") - s = append(s, "TaskGuid: "+fmt.Sprintf("%#v", this.TaskGuid)+",\n") - s = append(s, "FailureReason: "+fmt.Sprintf("%#v", this.FailureReason)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RejectTaskRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.RejectTaskRequest{") - s = append(s, "TaskGuid: "+fmt.Sprintf("%#v", this.TaskGuid)+",\n") - s = append(s, "RejectionReason: "+fmt.Sprintf("%#v", this.RejectionReason)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TaskGuidRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.TaskGuidRequest{") - s = append(s, "TaskGuid: "+fmt.Sprintf("%#v", this.TaskGuid)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *CompleteTaskRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&models.CompleteTaskRequest{") - s = append(s, "TaskGuid: "+fmt.Sprintf("%#v", this.TaskGuid)+",\n") - s = append(s, "CellId: "+fmt.Sprintf("%#v", this.CellId)+",\n") - s = append(s, "Failed: "+fmt.Sprintf("%#v", this.Failed)+",\n") - s = append(s, "FailureReason: "+fmt.Sprintf("%#v", this.FailureReason)+",\n") - s = append(s, "Result: "+fmt.Sprintf("%#v", this.Result)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TaskCallbackResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&models.TaskCallbackResponse{") - s = append(s, "TaskGuid: "+fmt.Sprintf("%#v", this.TaskGuid)+",\n") - s = append(s, "Failed: "+fmt.Sprintf("%#v", this.Failed)+",\n") - s = append(s, "FailureReason: "+fmt.Sprintf("%#v", this.FailureReason)+",\n") - s = append(s, "Result: "+fmt.Sprintf("%#v", this.Result)+",\n") - s = append(s, "Annotation: "+fmt.Sprintf("%#v", this.Annotation)+",\n") - s = append(s, "CreatedAt: "+fmt.Sprintf("%#v", this.CreatedAt)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TasksRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.TasksRequest{") - s = append(s, "Domain: "+fmt.Sprintf("%#v", this.Domain)+",\n") - s = append(s, "CellId: "+fmt.Sprintf("%#v", this.CellId)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TasksResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.TasksResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - if this.Tasks != nil { - s = append(s, "Tasks: "+fmt.Sprintf("%#v", this.Tasks)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TaskByGuidRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.TaskByGuidRequest{") - s = append(s, "TaskGuid: "+fmt.Sprintf("%#v", this.TaskGuid)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TaskResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.TaskResponse{") - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - if this.Task != nil { - s = append(s, "Task: "+fmt.Sprintf("%#v", this.Task)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringTaskRequests(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *TaskLifecycleResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TaskLifecycleResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskLifecycleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTaskRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return "" } -func (m *DesireTaskRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoCompleteTaskRequest) GetFailed() bool { + if x != nil { + return x.Failed } - return dAtA[:n], nil -} - -func (m *DesireTaskRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return false } -func (m *DesireTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Domain) > 0 { - i -= len(m.Domain) - copy(dAtA[i:], m.Domain) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.Domain))) - i-- - dAtA[i] = 0x1a - } - if len(m.TaskGuid) > 0 { - i -= len(m.TaskGuid) - copy(dAtA[i:], m.TaskGuid) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.TaskGuid))) - i-- - dAtA[i] = 0x12 - } - if m.TaskDefinition != nil { - { - size, err := m.TaskDefinition.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTaskRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func (x *ProtoCompleteTaskRequest) GetFailureReason() string { + if x != nil { + return x.FailureReason } - return len(dAtA) - i, nil + return "" } -func (m *StartTaskRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoCompleteTaskRequest) GetResult() string { + if x != nil { + return x.Result } - return dAtA[:n], nil + return "" } -func (m *StartTaskRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type ProtoTaskCallbackResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,proto3" json:"task_guid,omitempty"` + Failed bool `protobuf:"varint,2,opt,name=failed,proto3" json:"failed,omitempty"` + FailureReason string `protobuf:"bytes,3,opt,name=failure_reason,proto3" json:"failure_reason,omitempty"` + Result string `protobuf:"bytes,4,opt,name=result,proto3" json:"result,omitempty"` + Annotation string `protobuf:"bytes,5,opt,name=annotation,proto3" json:"annotation,omitempty"` + CreatedAt int64 `protobuf:"varint,6,opt,name=created_at,proto3" json:"created_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *StartTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CellId) > 0 { - i -= len(m.CellId) - copy(dAtA[i:], m.CellId) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.CellId))) - i-- - dAtA[i] = 0x12 - } - if len(m.TaskGuid) > 0 { - i -= len(m.TaskGuid) - copy(dAtA[i:], m.TaskGuid) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.TaskGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func (x *ProtoTaskCallbackResponse) Reset() { + *x = ProtoTaskCallbackResponse{} + mi := &file_task_requests_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *StartTaskResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *ProtoTaskCallbackResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *StartTaskResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func (*ProtoTaskCallbackResponse) ProtoMessage() {} -func (m *StartTaskResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ShouldStart { - i-- - if m.ShouldStart { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTaskRequests(dAtA, i, uint64(size)) +func (x *ProtoTaskCallbackResponse) ProtoReflect() protoreflect.Message { + mi := &file_task_requests_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - i-- - dAtA[i] = 0xa + return ms } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *FailTaskRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FailTaskRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ProtoTaskCallbackResponse.ProtoReflect.Descriptor instead. +func (*ProtoTaskCallbackResponse) Descriptor() ([]byte, []int) { + return file_task_requests_proto_rawDescGZIP(), []int{8} } -func (m *FailTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.FailureReason) > 0 { - i -= len(m.FailureReason) - copy(dAtA[i:], m.FailureReason) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.FailureReason))) - i-- - dAtA[i] = 0x12 - } - if len(m.TaskGuid) > 0 { - i -= len(m.TaskGuid) - copy(dAtA[i:], m.TaskGuid) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.TaskGuid))) - i-- - dAtA[i] = 0xa +func (x *ProtoTaskCallbackResponse) GetTaskGuid() string { + if x != nil { + return x.TaskGuid } - return len(dAtA) - i, nil + return "" } -func (m *RejectTaskRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoTaskCallbackResponse) GetFailed() bool { + if x != nil { + return x.Failed } - return dAtA[:n], nil -} - -func (m *RejectTaskRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return false } -func (m *RejectTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RejectionReason) > 0 { - i -= len(m.RejectionReason) - copy(dAtA[i:], m.RejectionReason) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.RejectionReason))) - i-- - dAtA[i] = 0x12 +func (x *ProtoTaskCallbackResponse) GetFailureReason() string { + if x != nil { + return x.FailureReason } - if len(m.TaskGuid) > 0 { - i -= len(m.TaskGuid) - copy(dAtA[i:], m.TaskGuid) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.TaskGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return "" } -func (m *TaskGuidRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoTaskCallbackResponse) GetResult() string { + if x != nil { + return x.Result } - return dAtA[:n], nil -} - -func (m *TaskGuidRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return "" } -func (m *TaskGuidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TaskGuid) > 0 { - i -= len(m.TaskGuid) - copy(dAtA[i:], m.TaskGuid) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.TaskGuid))) - i-- - dAtA[i] = 0xa +func (x *ProtoTaskCallbackResponse) GetAnnotation() string { + if x != nil { + return x.Annotation } - return len(dAtA) - i, nil + return "" } -func (m *CompleteTaskRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoTaskCallbackResponse) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt } - return dAtA[:n], nil + return 0 } -func (m *CompleteTaskRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type ProtoTasksRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` + CellId string `protobuf:"bytes,2,opt,name=cell_id,proto3" json:"cell_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CompleteTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Result) > 0 { - i -= len(m.Result) - copy(dAtA[i:], m.Result) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.Result))) - i-- - dAtA[i] = 0x2a - } - if len(m.FailureReason) > 0 { - i -= len(m.FailureReason) - copy(dAtA[i:], m.FailureReason) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.FailureReason))) - i-- - dAtA[i] = 0x22 - } - if m.Failed { - i-- - if m.Failed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.CellId) > 0 { - i -= len(m.CellId) - copy(dAtA[i:], m.CellId) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.CellId))) - i-- - dAtA[i] = 0x12 - } - if len(m.TaskGuid) > 0 { - i -= len(m.TaskGuid) - copy(dAtA[i:], m.TaskGuid) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.TaskGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func (x *ProtoTasksRequest) Reset() { + *x = ProtoTasksRequest{} + mi := &file_task_requests_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TaskCallbackResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *ProtoTasksRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TaskCallbackResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func (*ProtoTasksRequest) ProtoMessage() {} -func (m *TaskCallbackResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CreatedAt != 0 { - i = encodeVarintTaskRequests(dAtA, i, uint64(m.CreatedAt)) - i-- - dAtA[i] = 0x30 - } - if len(m.Annotation) > 0 { - i -= len(m.Annotation) - copy(dAtA[i:], m.Annotation) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.Annotation))) - i-- - dAtA[i] = 0x2a - } - if len(m.Result) > 0 { - i -= len(m.Result) - copy(dAtA[i:], m.Result) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.Result))) - i-- - dAtA[i] = 0x22 - } - if len(m.FailureReason) > 0 { - i -= len(m.FailureReason) - copy(dAtA[i:], m.FailureReason) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.FailureReason))) - i-- - dAtA[i] = 0x1a - } - if m.Failed { - i-- - if m.Failed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 +func (x *ProtoTasksRequest) ProtoReflect() protoreflect.Message { + mi := &file_task_requests_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - i-- - dAtA[i] = 0x10 - } - if len(m.TaskGuid) > 0 { - i -= len(m.TaskGuid) - copy(dAtA[i:], m.TaskGuid) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.TaskGuid))) - i-- - dAtA[i] = 0xa + return ms } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *TasksRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TasksRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TasksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CellId) > 0 { - i -= len(m.CellId) - copy(dAtA[i:], m.CellId) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.CellId))) - i-- - dAtA[i] = 0x12 - } - if len(m.Domain) > 0 { - i -= len(m.Domain) - copy(dAtA[i:], m.Domain) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.Domain))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +// Deprecated: Use ProtoTasksRequest.ProtoReflect.Descriptor instead. +func (*ProtoTasksRequest) Descriptor() ([]byte, []int) { + return file_task_requests_proto_rawDescGZIP(), []int{9} } -func (m *TasksResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TasksResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TasksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Tasks) > 0 { - for iNdEx := len(m.Tasks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Tasks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTaskRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTaskRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func (x *ProtoTasksRequest) GetDomain() string { + if x != nil { + return x.Domain } - return len(dAtA) - i, nil + return "" } -func (m *TaskByGuidRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoTasksRequest) GetCellId() string { + if x != nil { + return x.CellId } - return dAtA[:n], nil -} - -func (m *TaskByGuidRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return "" } -func (m *TaskByGuidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TaskGuid) > 0 { - i -= len(m.TaskGuid) - copy(dAtA[i:], m.TaskGuid) - i = encodeVarintTaskRequests(dAtA, i, uint64(len(m.TaskGuid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +type ProtoTasksResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Tasks []*ProtoTask `protobuf:"bytes,2,rep,name=tasks,proto3" json:"tasks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *TaskResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TaskResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Task != nil { - { - size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTaskRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTaskRequests(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func (x *ProtoTasksResponse) Reset() { + *x = ProtoTasksResponse{} + mi := &file_task_requests_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func encodeVarintTaskRequests(dAtA []byte, offset int, v uint64) int { - offset -= sovTaskRequests(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *TaskLifecycleResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovTaskRequests(uint64(l)) - } - return n +func (x *ProtoTasksResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DesireTaskRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TaskDefinition != nil { - l = m.TaskDefinition.Size() - n += 1 + l + sovTaskRequests(uint64(l)) - } - l = len(m.TaskGuid) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - l = len(m.Domain) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - return n -} +func (*ProtoTasksResponse) ProtoMessage() {} -func (m *StartTaskRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TaskGuid) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - l = len(m.CellId) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) +func (x *ProtoTasksResponse) ProtoReflect() protoreflect.Message { + mi := &file_task_requests_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return n + return mi.MessageOf(x) } -func (m *StartTaskResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovTaskRequests(uint64(l)) - } - if m.ShouldStart { - n += 2 - } - return n +// Deprecated: Use ProtoTasksResponse.ProtoReflect.Descriptor instead. +func (*ProtoTasksResponse) Descriptor() ([]byte, []int) { + return file_task_requests_proto_rawDescGZIP(), []int{10} } -func (m *FailTaskRequest) Size() (n int) { - if m == nil { - return 0 +func (x *ProtoTasksResponse) GetError() *ProtoError { + if x != nil { + return x.Error } - var l int - _ = l - l = len(m.TaskGuid) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - l = len(m.FailureReason) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - return n + return nil } -func (m *RejectTaskRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TaskGuid) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) +func (x *ProtoTasksResponse) GetTasks() []*ProtoTask { + if x != nil { + return x.Tasks } - l = len(m.RejectionReason) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - return n + return nil } -func (m *TaskGuidRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TaskGuid) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - return n +type ProtoTaskByGuidRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskGuid string `protobuf:"bytes,1,opt,name=task_guid,proto3" json:"task_guid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CompleteTaskRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TaskGuid) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - l = len(m.CellId) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - if m.Failed { - n += 2 - } - l = len(m.FailureReason) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - l = len(m.Result) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - return n +func (x *ProtoTaskByGuidRequest) Reset() { + *x = ProtoTaskByGuidRequest{} + mi := &file_task_requests_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TaskCallbackResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TaskGuid) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - if m.Failed { - n += 2 - } - l = len(m.FailureReason) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - l = len(m.Result) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - l = len(m.Annotation) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - if m.CreatedAt != 0 { - n += 1 + sovTaskRequests(uint64(m.CreatedAt)) - } - return n +func (x *ProtoTaskByGuidRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TasksRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Domain) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - l = len(m.CellId) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - return n -} +func (*ProtoTaskByGuidRequest) ProtoMessage() {} -func (m *TasksResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovTaskRequests(uint64(l)) - } - if len(m.Tasks) > 0 { - for _, e := range m.Tasks { - l = e.Size() - n += 1 + l + sovTaskRequests(uint64(l)) +func (x *ProtoTaskByGuidRequest) ProtoReflect() protoreflect.Message { + mi := &file_task_requests_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return n + return mi.MessageOf(x) } -func (m *TaskByGuidRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TaskGuid) - if l > 0 { - n += 1 + l + sovTaskRequests(uint64(l)) - } - return n -} - -func (m *TaskResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovTaskRequests(uint64(l)) - } - if m.Task != nil { - l = m.Task.Size() - n += 1 + l + sovTaskRequests(uint64(l)) - } - return n -} - -func sovTaskRequests(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTaskRequests(x uint64) (n int) { - return sovTaskRequests(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +// Deprecated: Use ProtoTaskByGuidRequest.ProtoReflect.Descriptor instead. +func (*ProtoTaskByGuidRequest) Descriptor() ([]byte, []int) { + return file_task_requests_proto_rawDescGZIP(), []int{11} } -func (this *TaskLifecycleResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskLifecycleResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `}`, - }, "") - return s -} -func (this *DesireTaskRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DesireTaskRequest{`, - `TaskDefinition:` + strings.Replace(fmt.Sprintf("%v", this.TaskDefinition), "TaskDefinition", "TaskDefinition", 1) + `,`, - `TaskGuid:` + fmt.Sprintf("%v", this.TaskGuid) + `,`, - `Domain:` + fmt.Sprintf("%v", this.Domain) + `,`, - `}`, - }, "") - return s -} -func (this *StartTaskRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StartTaskRequest{`, - `TaskGuid:` + fmt.Sprintf("%v", this.TaskGuid) + `,`, - `CellId:` + fmt.Sprintf("%v", this.CellId) + `,`, - `}`, - }, "") - return s -} -func (this *StartTaskResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StartTaskResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `ShouldStart:` + fmt.Sprintf("%v", this.ShouldStart) + `,`, - `}`, - }, "") - return s -} -func (this *FailTaskRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FailTaskRequest{`, - `TaskGuid:` + fmt.Sprintf("%v", this.TaskGuid) + `,`, - `FailureReason:` + fmt.Sprintf("%v", this.FailureReason) + `,`, - `}`, - }, "") - return s -} -func (this *RejectTaskRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RejectTaskRequest{`, - `TaskGuid:` + fmt.Sprintf("%v", this.TaskGuid) + `,`, - `RejectionReason:` + fmt.Sprintf("%v", this.RejectionReason) + `,`, - `}`, - }, "") - return s -} -func (this *TaskGuidRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskGuidRequest{`, - `TaskGuid:` + fmt.Sprintf("%v", this.TaskGuid) + `,`, - `}`, - }, "") - return s -} -func (this *CompleteTaskRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CompleteTaskRequest{`, - `TaskGuid:` + fmt.Sprintf("%v", this.TaskGuid) + `,`, - `CellId:` + fmt.Sprintf("%v", this.CellId) + `,`, - `Failed:` + fmt.Sprintf("%v", this.Failed) + `,`, - `FailureReason:` + fmt.Sprintf("%v", this.FailureReason) + `,`, - `Result:` + fmt.Sprintf("%v", this.Result) + `,`, - `}`, - }, "") - return s -} -func (this *TaskCallbackResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskCallbackResponse{`, - `TaskGuid:` + fmt.Sprintf("%v", this.TaskGuid) + `,`, - `Failed:` + fmt.Sprintf("%v", this.Failed) + `,`, - `FailureReason:` + fmt.Sprintf("%v", this.FailureReason) + `,`, - `Result:` + fmt.Sprintf("%v", this.Result) + `,`, - `Annotation:` + fmt.Sprintf("%v", this.Annotation) + `,`, - `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, - `}`, - }, "") - return s -} -func (this *TasksRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TasksRequest{`, - `Domain:` + fmt.Sprintf("%v", this.Domain) + `,`, - `CellId:` + fmt.Sprintf("%v", this.CellId) + `,`, - `}`, - }, "") - return s -} -func (this *TasksResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForTasks := "[]*Task{" - for _, f := range this.Tasks { - repeatedStringForTasks += strings.Replace(fmt.Sprintf("%v", f), "Task", "Task", 1) + "," - } - repeatedStringForTasks += "}" - s := strings.Join([]string{`&TasksResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `Tasks:` + repeatedStringForTasks + `,`, - `}`, - }, "") - return s -} -func (this *TaskByGuidRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskByGuidRequest{`, - `TaskGuid:` + fmt.Sprintf("%v", this.TaskGuid) + `,`, - `}`, - }, "") - return s -} -func (this *TaskResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskResponse{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Error", "Error", 1) + `,`, - `Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "Task", 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringTaskRequests(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *TaskLifecycleResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TaskLifecycleResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskLifecycleResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTaskRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTaskRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoTaskByGuidRequest) GetTaskGuid() string { + if x != nil { + return x.TaskGuid } - return nil -} -func (m *DesireTaskRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DesireTaskRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DesireTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskDefinition", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskDefinition == nil { - m.TaskDefinition = &TaskDefinition{} - } - if err := m.TaskDefinition.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTaskRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTaskRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StartTaskRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StartTaskRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StartTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CellId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CellId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTaskRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTaskRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil + return "" } -func (m *StartTaskResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StartTaskResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StartTaskResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ShouldStart", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ShouldStart = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTaskRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTaskRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +type ProtoTaskResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *ProtoError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Task *ProtoTask `protobuf:"bytes,2,opt,name=task,proto3" json:"task,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *FailTaskRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FailTaskRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FailTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FailureReason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FailureReason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTaskRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTaskRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func (x *ProtoTaskResponse) Reset() { + *x = ProtoTaskResponse{} + mi := &file_task_requests_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *RejectTaskRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RejectTaskRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RejectTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RejectionReason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RejectionReason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTaskRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTaskRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func (x *ProtoTaskResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TaskGuidRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TaskGuidRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskGuidRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTaskRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTaskRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CompleteTaskRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CompleteTaskRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CompleteTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CellId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CellId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Failed = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FailureReason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FailureReason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Result = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTaskRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTaskRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +func (*ProtoTaskResponse) ProtoMessage() {} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TaskCallbackResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } +func (x *ProtoTaskResponse) ProtoReflect() protoreflect.Message { + mi := &file_task_requests_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TaskCallbackResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskCallbackResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Failed = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FailureReason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FailureReason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Result = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotation", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Annotation = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - m.CreatedAt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreatedAt |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTaskRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTaskRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF + return ms } - return nil + return mi.MessageOf(x) } -func (m *TasksRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TasksRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TasksRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CellId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CellId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTaskRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTaskRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use ProtoTaskResponse.ProtoReflect.Descriptor instead. +func (*ProtoTaskResponse) Descriptor() ([]byte, []int) { + return file_task_requests_proto_rawDescGZIP(), []int{12} } -func (m *TasksResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TasksResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TasksResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tasks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tasks = append(m.Tasks, &Task{}) - if err := m.Tasks[len(m.Tasks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTaskRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTaskRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoTaskResponse) GetError() *ProtoError { + if x != nil { + return x.Error } return nil } -func (m *TaskByGuidRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TaskByGuidRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskByGuidRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskGuid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskGuid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTaskRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTaskRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoTaskResponse) GetTask() *ProtoTask { + if x != nil { + return x.Task } return nil } -func (m *TaskResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TaskResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTaskRequests - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTaskRequests - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Task == nil { - m.Task = &Task{} - } - if err := m.Task.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTaskRequests(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTaskRequests - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTaskRequests(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTaskRequests - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTaskRequests - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTaskRequests - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTaskRequests - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +var File_task_requests_proto protoreflect.FileDescriptor + +const file_task_requests_proto_rawDesc = "" + + "\n" + + "\x13task_requests.proto\x12\x06models\x1a\tbbs.proto\x1a\n" + + "task.proto\x1a\verror.proto\"F\n" + + "\x1aProtoTaskLifecycleResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\"\xa4\x01\n" + + "\x16ProtoDesireTaskRequest\x12J\n" + + "\x0ftask_definition\x18\x01 \x01(\v2\x1b.models.ProtoTaskDefinitionB\x03\xc0>\x01R\x0ftask_definition\x12!\n" + + "\ttask_guid\x18\x02 \x01(\tB\x03\xc0>\x01R\ttask_guid\x12\x1b\n" + + "\x06domain\x18\x03 \x01(\tB\x03\xc0>\x01R\x06domain\"Y\n" + + "\x15ProtoStartTaskRequest\x12!\n" + + "\ttask_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\ttask_guid\x12\x1d\n" + + "\acell_id\x18\x02 \x01(\tB\x03\xc0>\x01R\acell_id\"k\n" + + "\x16ProtoStartTaskResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\x12'\n" + + "\fshould_start\x18\x02 \x01(\bB\x03\xc0>\x01R\fshould_start\"j\n" + + "\x14ProtoFailTaskRequest\x12!\n" + + "\ttask_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\ttask_guid\x12+\n" + + "\x0efailure_reason\x18\x02 \x01(\tB\x03\xc0>\x01R\x0efailure_reason:\x02\x18\x01\"l\n" + + "\x16ProtoRejectTaskRequest\x12!\n" + + "\ttask_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\ttask_guid\x12/\n" + + "\x10rejection_reason\x18\x02 \x01(\tB\x03\xc0>\x01R\x10rejection_reason\"9\n" + + "\x14ProtoTaskGuidRequest\x12!\n" + + "\ttask_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\ttask_guid\"\xc3\x01\n" + + "\x18ProtoCompleteTaskRequest\x12!\n" + + "\ttask_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\ttask_guid\x12\x1d\n" + + "\acell_id\x18\x02 \x01(\tB\x03\xc0>\x01R\acell_id\x12\x1b\n" + + "\x06failed\x18\x03 \x01(\bB\x03\xc0>\x01R\x06failed\x12+\n" + + "\x0efailure_reason\x18\x04 \x01(\tB\x03\xc0>\x01R\x0efailure_reason\x12\x1b\n" + + "\x06result\x18\x05 \x01(\tB\x03\xc0>\x01R\x06result\"\xea\x01\n" + + "\x19ProtoTaskCallbackResponse\x12!\n" + + "\ttask_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\ttask_guid\x12\x1b\n" + + "\x06failed\x18\x02 \x01(\bB\x03\xc0>\x01R\x06failed\x12+\n" + + "\x0efailure_reason\x18\x03 \x01(\tB\x03\xc0>\x01R\x0efailure_reason\x12\x1b\n" + + "\x06result\x18\x04 \x01(\tB\x03\xc0>\x01R\x06result\x12\x1e\n" + + "\n" + + "annotation\x18\x05 \x01(\tR\n" + + "annotation\x12#\n" + + "\n" + + "created_at\x18\x06 \x01(\x03B\x03\xc0>\x01R\n" + + "created_at\"O\n" + + "\x11ProtoTasksRequest\x12\x1b\n" + + "\x06domain\x18\x01 \x01(\tB\x03\xc0>\x01R\x06domain\x12\x1d\n" + + "\acell_id\x18\x02 \x01(\tB\x03\xc0>\x01R\acell_id\"g\n" + + "\x12ProtoTasksResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\x12'\n" + + "\x05tasks\x18\x02 \x03(\v2\x11.models.ProtoTaskR\x05tasks\";\n" + + "\x16ProtoTaskByGuidRequest\x12!\n" + + "\ttask_guid\x18\x01 \x01(\tB\x03\xc0>\x01R\ttask_guid\"d\n" + + "\x11ProtoTaskResponse\x12(\n" + + "\x05error\x18\x01 \x01(\v2\x12.models.ProtoErrorR\x05error\x12%\n" + + "\x04task\x18\x02 \x01(\v2\x11.models.ProtoTaskR\x04taskB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthTaskRequests = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTaskRequests = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTaskRequests = fmt.Errorf("proto: unexpected end of group") + file_task_requests_proto_rawDescOnce sync.Once + file_task_requests_proto_rawDescData []byte ) + +func file_task_requests_proto_rawDescGZIP() []byte { + file_task_requests_proto_rawDescOnce.Do(func() { + file_task_requests_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_task_requests_proto_rawDesc), len(file_task_requests_proto_rawDesc))) + }) + return file_task_requests_proto_rawDescData +} + +var file_task_requests_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_task_requests_proto_goTypes = []any{ + (*ProtoTaskLifecycleResponse)(nil), // 0: models.ProtoTaskLifecycleResponse + (*ProtoDesireTaskRequest)(nil), // 1: models.ProtoDesireTaskRequest + (*ProtoStartTaskRequest)(nil), // 2: models.ProtoStartTaskRequest + (*ProtoStartTaskResponse)(nil), // 3: models.ProtoStartTaskResponse + (*ProtoFailTaskRequest)(nil), // 4: models.ProtoFailTaskRequest + (*ProtoRejectTaskRequest)(nil), // 5: models.ProtoRejectTaskRequest + (*ProtoTaskGuidRequest)(nil), // 6: models.ProtoTaskGuidRequest + (*ProtoCompleteTaskRequest)(nil), // 7: models.ProtoCompleteTaskRequest + (*ProtoTaskCallbackResponse)(nil), // 8: models.ProtoTaskCallbackResponse + (*ProtoTasksRequest)(nil), // 9: models.ProtoTasksRequest + (*ProtoTasksResponse)(nil), // 10: models.ProtoTasksResponse + (*ProtoTaskByGuidRequest)(nil), // 11: models.ProtoTaskByGuidRequest + (*ProtoTaskResponse)(nil), // 12: models.ProtoTaskResponse + (*ProtoError)(nil), // 13: models.ProtoError + (*ProtoTaskDefinition)(nil), // 14: models.ProtoTaskDefinition + (*ProtoTask)(nil), // 15: models.ProtoTask +} +var file_task_requests_proto_depIdxs = []int32{ + 13, // 0: models.ProtoTaskLifecycleResponse.error:type_name -> models.ProtoError + 14, // 1: models.ProtoDesireTaskRequest.task_definition:type_name -> models.ProtoTaskDefinition + 13, // 2: models.ProtoStartTaskResponse.error:type_name -> models.ProtoError + 13, // 3: models.ProtoTasksResponse.error:type_name -> models.ProtoError + 15, // 4: models.ProtoTasksResponse.tasks:type_name -> models.ProtoTask + 13, // 5: models.ProtoTaskResponse.error:type_name -> models.ProtoError + 15, // 6: models.ProtoTaskResponse.task:type_name -> models.ProtoTask + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_task_requests_proto_init() } +func file_task_requests_proto_init() { + if File_task_requests_proto != nil { + return + } + file_bbs_proto_init() + file_task_proto_init() + file_error_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_task_requests_proto_rawDesc), len(file_task_requests_proto_rawDesc)), + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_task_requests_proto_goTypes, + DependencyIndexes: file_task_requests_proto_depIdxs, + MessageInfos: file_task_requests_proto_msgTypes, + }.Build() + File_task_requests_proto = out.File + file_task_requests_proto_goTypes = nil + file_task_requests_proto_depIdxs = nil +} diff --git a/models/task_requests.proto b/models/task_requests.proto index bf43ad66..25e2be35 100644 --- a/models/task_requests.proto +++ b/models/task_requests.proto @@ -1,78 +1,79 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; import "task.proto"; import "error.proto"; -message TaskLifecycleResponse { - Error error = 1; +message ProtoTaskLifecycleResponse { + ProtoError error = 1; } -message DesireTaskRequest { - TaskDefinition task_definition = 1 [(gogoproto.jsontag) = "task_definition"]; - string task_guid = 2 [(gogoproto.jsontag) = "task_guid"]; - string domain = 3 [(gogoproto.jsontag) = "domain"]; +message ProtoDesireTaskRequest { + ProtoTaskDefinition task_definition = 1 [json_name = "task_definition", (bbs.bbs_json_always_emit) = true]; + string task_guid = 2 [json_name = "task_guid", (bbs.bbs_json_always_emit) = true]; + string domain = 3 [json_name = "domain", (bbs.bbs_json_always_emit) = true]; } -message StartTaskRequest { - string task_guid = 1 [(gogoproto.jsontag) = "task_guid"]; - string cell_id = 2 [(gogoproto.jsontag) = "cell_id"]; +message ProtoStartTaskRequest { + string task_guid = 1 [json_name = "task_guid", (bbs.bbs_json_always_emit) = true]; + string cell_id = 2 [json_name = "cell_id", (bbs.bbs_json_always_emit) = true]; } -message StartTaskResponse { - Error error = 1; - bool should_start = 2 [(gogoproto.jsontag) = "should_start"]; +message ProtoStartTaskResponse { + ProtoError error = 1; + bool should_start = 2 [json_name = "should_start", (bbs.bbs_json_always_emit) = true]; } -message FailTaskRequest { +message ProtoFailTaskRequest { option deprecated = true; - string task_guid = 1 [(gogoproto.jsontag) = "task_guid"]; - string failure_reason = 2 [(gogoproto.jsontag) = "failure_reason"]; + string task_guid = 1 [json_name = "task_guid", (bbs.bbs_json_always_emit) = true]; + string failure_reason = 2 [json_name = "failure_reason", (bbs.bbs_json_always_emit) = true]; } -message RejectTaskRequest { - string task_guid = 1 [(gogoproto.jsontag) = "task_guid"]; - string rejection_reason = 2 [(gogoproto.jsontag) = "rejection_reason"]; +message ProtoRejectTaskRequest { + string task_guid = 1 [json_name = "task_guid", (bbs.bbs_json_always_emit) = true]; + string rejection_reason = 2 [json_name = "rejection_reason", (bbs.bbs_json_always_emit) = true]; } -message TaskGuidRequest { - string task_guid = 1 [(gogoproto.jsontag) = "task_guid"]; +message ProtoTaskGuidRequest { + string task_guid = 1 [json_name = "task_guid", (bbs.bbs_json_always_emit) = true]; } -message CompleteTaskRequest { - string task_guid = 1 [(gogoproto.jsontag) = "task_guid"]; - string cell_id = 2 [(gogoproto.jsontag) = "cell_id"]; - bool failed = 3 [(gogoproto.jsontag) = "failed"]; - string failure_reason = 4 [(gogoproto.jsontag) = "failure_reason"]; - string result = 5 [(gogoproto.jsontag) = "result"]; +message ProtoCompleteTaskRequest { + string task_guid = 1 [json_name = "task_guid", (bbs.bbs_json_always_emit) = true]; + string cell_id = 2 [json_name = "cell_id", (bbs.bbs_json_always_emit) = true]; + bool failed = 3 [json_name = "failed", (bbs.bbs_json_always_emit) = true]; + string failure_reason = 4 [json_name = "failure_reason", (bbs.bbs_json_always_emit) = true]; + string result = 5 [json_name = "result", (bbs.bbs_json_always_emit) = true]; } -message TaskCallbackResponse { - string task_guid = 1 [(gogoproto.jsontag) = "task_guid"]; - bool failed = 2 [(gogoproto.jsontag) = "failed"]; - string failure_reason = 3 [(gogoproto.jsontag) = "failure_reason"]; - string result = 4 [(gogoproto.jsontag) = "result"]; - string annotation = 5; - int64 created_at = 6 [(gogoproto.jsontag) = "created_at"]; +message ProtoTaskCallbackResponse { + string task_guid = 1 [json_name = "task_guid", (bbs.bbs_json_always_emit) = true]; + bool failed = 2 [json_name = "failed", (bbs.bbs_json_always_emit) = true]; + string failure_reason = 3 [json_name = "failure_reason", (bbs.bbs_json_always_emit) = true]; + string result = 4 [json_name = "result", (bbs.bbs_json_always_emit) = true]; + string annotation = 5; + int64 created_at = 6 [json_name = "created_at", (bbs.bbs_json_always_emit) = true]; } -message TasksRequest{ - string domain = 1 [(gogoproto.jsontag) = "domain"]; - string cell_id = 2 [(gogoproto.jsontag) = "cell_id"]; +message ProtoTasksRequest{ + string domain = 1 [json_name = "domain", (bbs.bbs_json_always_emit) = true]; + string cell_id = 2 [json_name = "cell_id", (bbs.bbs_json_always_emit) = true]; } -message TasksResponse{ - Error error = 1; - repeated Task tasks = 2; +message ProtoTasksResponse{ + ProtoError error = 1; + repeated ProtoTask tasks = 2; } -message TaskByGuidRequest{ - string task_guid = 1 [(gogoproto.jsontag) = "task_guid"]; +message ProtoTaskByGuidRequest{ + string task_guid = 1 [json_name = "task_guid", (bbs.bbs_json_always_emit) = true]; } -message TaskResponse{ - Error error = 1; - Task task = 2; +message ProtoTaskResponse{ + ProtoError error = 1; + ProtoTask task = 2; } diff --git a/models/task_requests_bbs.pb.go b/models/task_requests_bbs.pb.go new file mode 100644 index 00000000..e78f34c7 --- /dev/null +++ b/models/task_requests_bbs.pb.go @@ -0,0 +1,1526 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: task_requests.proto + +package models + +// Prevent copylock errors when using ProtoTaskLifecycleResponse directly +type TaskLifecycleResponse struct { + Error *Error `json:"error,omitempty"` +} + +func (this *TaskLifecycleResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TaskLifecycleResponse) + if !ok { + that2, ok := that.(TaskLifecycleResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + return true +} +func (m *TaskLifecycleResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *TaskLifecycleResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (x *TaskLifecycleResponse) ToProto() *ProtoTaskLifecycleResponse { + if x == nil { + return nil + } + + proto := &ProtoTaskLifecycleResponse{ + Error: x.Error.ToProto(), + } + return proto +} + +func (x *ProtoTaskLifecycleResponse) FromProto() *TaskLifecycleResponse { + if x == nil { + return nil + } + + copysafe := &TaskLifecycleResponse{ + Error: x.Error.FromProto(), + } + return copysafe +} + +func TaskLifecycleResponseToProtoSlice(values []*TaskLifecycleResponse) []*ProtoTaskLifecycleResponse { + if values == nil { + return nil + } + result := make([]*ProtoTaskLifecycleResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TaskLifecycleResponseFromProtoSlice(values []*ProtoTaskLifecycleResponse) []*TaskLifecycleResponse { + if values == nil { + return nil + } + result := make([]*TaskLifecycleResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoDesireTaskRequest directly +type DesireTaskRequest struct { + TaskDefinition *TaskDefinition `json:"task_definition"` + TaskGuid string `json:"task_guid"` + Domain string `json:"domain"` +} + +func (this *DesireTaskRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*DesireTaskRequest) + if !ok { + that2, ok := that.(DesireTaskRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.TaskDefinition == nil { + if that1.TaskDefinition != nil { + return false + } + } else if !this.TaskDefinition.Equal(*that1.TaskDefinition) { + return false + } + if this.TaskGuid != that1.TaskGuid { + return false + } + if this.Domain != that1.Domain { + return false + } + return true +} +func (m *DesireTaskRequest) GetTaskDefinition() *TaskDefinition { + if m != nil { + return m.TaskDefinition + } + return nil +} +func (m *DesireTaskRequest) SetTaskDefinition(value *TaskDefinition) { + if m != nil { + m.TaskDefinition = value + } +} +func (m *DesireTaskRequest) GetTaskGuid() string { + if m != nil { + return m.TaskGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesireTaskRequest) SetTaskGuid(value string) { + if m != nil { + m.TaskGuid = value + } +} +func (m *DesireTaskRequest) GetDomain() string { + if m != nil { + return m.Domain + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *DesireTaskRequest) SetDomain(value string) { + if m != nil { + m.Domain = value + } +} +func (x *DesireTaskRequest) ToProto() *ProtoDesireTaskRequest { + if x == nil { + return nil + } + + proto := &ProtoDesireTaskRequest{ + TaskDefinition: x.TaskDefinition.ToProto(), + TaskGuid: x.TaskGuid, + Domain: x.Domain, + } + return proto +} + +func (x *ProtoDesireTaskRequest) FromProto() *DesireTaskRequest { + if x == nil { + return nil + } + + copysafe := &DesireTaskRequest{ + TaskDefinition: x.TaskDefinition.FromProto(), + TaskGuid: x.TaskGuid, + Domain: x.Domain, + } + return copysafe +} + +func DesireTaskRequestToProtoSlice(values []*DesireTaskRequest) []*ProtoDesireTaskRequest { + if values == nil { + return nil + } + result := make([]*ProtoDesireTaskRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func DesireTaskRequestFromProtoSlice(values []*ProtoDesireTaskRequest) []*DesireTaskRequest { + if values == nil { + return nil + } + result := make([]*DesireTaskRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoStartTaskRequest directly +type StartTaskRequest struct { + TaskGuid string `json:"task_guid"` + CellId string `json:"cell_id"` +} + +func (this *StartTaskRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*StartTaskRequest) + if !ok { + that2, ok := that.(StartTaskRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.TaskGuid != that1.TaskGuid { + return false + } + if this.CellId != that1.CellId { + return false + } + return true +} +func (m *StartTaskRequest) GetTaskGuid() string { + if m != nil { + return m.TaskGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *StartTaskRequest) SetTaskGuid(value string) { + if m != nil { + m.TaskGuid = value + } +} +func (m *StartTaskRequest) GetCellId() string { + if m != nil { + return m.CellId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *StartTaskRequest) SetCellId(value string) { + if m != nil { + m.CellId = value + } +} +func (x *StartTaskRequest) ToProto() *ProtoStartTaskRequest { + if x == nil { + return nil + } + + proto := &ProtoStartTaskRequest{ + TaskGuid: x.TaskGuid, + CellId: x.CellId, + } + return proto +} + +func (x *ProtoStartTaskRequest) FromProto() *StartTaskRequest { + if x == nil { + return nil + } + + copysafe := &StartTaskRequest{ + TaskGuid: x.TaskGuid, + CellId: x.CellId, + } + return copysafe +} + +func StartTaskRequestToProtoSlice(values []*StartTaskRequest) []*ProtoStartTaskRequest { + if values == nil { + return nil + } + result := make([]*ProtoStartTaskRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func StartTaskRequestFromProtoSlice(values []*ProtoStartTaskRequest) []*StartTaskRequest { + if values == nil { + return nil + } + result := make([]*StartTaskRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoStartTaskResponse directly +type StartTaskResponse struct { + Error *Error `json:"error,omitempty"` + ShouldStart bool `json:"should_start"` +} + +func (this *StartTaskResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*StartTaskResponse) + if !ok { + that2, ok := that.(StartTaskResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + if this.ShouldStart != that1.ShouldStart { + return false + } + return true +} +func (m *StartTaskResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *StartTaskResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (m *StartTaskResponse) GetShouldStart() bool { + if m != nil { + return m.ShouldStart + } + var defaultValue bool + defaultValue = false + return defaultValue +} +func (m *StartTaskResponse) SetShouldStart(value bool) { + if m != nil { + m.ShouldStart = value + } +} +func (x *StartTaskResponse) ToProto() *ProtoStartTaskResponse { + if x == nil { + return nil + } + + proto := &ProtoStartTaskResponse{ + Error: x.Error.ToProto(), + ShouldStart: x.ShouldStart, + } + return proto +} + +func (x *ProtoStartTaskResponse) FromProto() *StartTaskResponse { + if x == nil { + return nil + } + + copysafe := &StartTaskResponse{ + Error: x.Error.FromProto(), + ShouldStart: x.ShouldStart, + } + return copysafe +} + +func StartTaskResponseToProtoSlice(values []*StartTaskResponse) []*ProtoStartTaskResponse { + if values == nil { + return nil + } + result := make([]*ProtoStartTaskResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func StartTaskResponseFromProtoSlice(values []*ProtoStartTaskResponse) []*StartTaskResponse { + if values == nil { + return nil + } + result := make([]*StartTaskResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Deprecated: marked deprecated in task_requests.proto +// Prevent copylock errors when using ProtoFailTaskRequest directly +type FailTaskRequest struct { + TaskGuid string `json:"task_guid"` + FailureReason string `json:"failure_reason"` +} + +func (this *FailTaskRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*FailTaskRequest) + if !ok { + that2, ok := that.(FailTaskRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.TaskGuid != that1.TaskGuid { + return false + } + if this.FailureReason != that1.FailureReason { + return false + } + return true +} +func (m *FailTaskRequest) GetTaskGuid() string { + if m != nil { + return m.TaskGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *FailTaskRequest) SetTaskGuid(value string) { + if m != nil { + m.TaskGuid = value + } +} +func (m *FailTaskRequest) GetFailureReason() string { + if m != nil { + return m.FailureReason + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *FailTaskRequest) SetFailureReason(value string) { + if m != nil { + m.FailureReason = value + } +} +func (x *FailTaskRequest) ToProto() *ProtoFailTaskRequest { + if x == nil { + return nil + } + + proto := &ProtoFailTaskRequest{ + TaskGuid: x.TaskGuid, + FailureReason: x.FailureReason, + } + return proto +} + +func (x *ProtoFailTaskRequest) FromProto() *FailTaskRequest { + if x == nil { + return nil + } + + copysafe := &FailTaskRequest{ + TaskGuid: x.TaskGuid, + FailureReason: x.FailureReason, + } + return copysafe +} + +func FailTaskRequestToProtoSlice(values []*FailTaskRequest) []*ProtoFailTaskRequest { + if values == nil { + return nil + } + result := make([]*ProtoFailTaskRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func FailTaskRequestFromProtoSlice(values []*ProtoFailTaskRequest) []*FailTaskRequest { + if values == nil { + return nil + } + result := make([]*FailTaskRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoRejectTaskRequest directly +type RejectTaskRequest struct { + TaskGuid string `json:"task_guid"` + RejectionReason string `json:"rejection_reason"` +} + +func (this *RejectTaskRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*RejectTaskRequest) + if !ok { + that2, ok := that.(RejectTaskRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.TaskGuid != that1.TaskGuid { + return false + } + if this.RejectionReason != that1.RejectionReason { + return false + } + return true +} +func (m *RejectTaskRequest) GetTaskGuid() string { + if m != nil { + return m.TaskGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *RejectTaskRequest) SetTaskGuid(value string) { + if m != nil { + m.TaskGuid = value + } +} +func (m *RejectTaskRequest) GetRejectionReason() string { + if m != nil { + return m.RejectionReason + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *RejectTaskRequest) SetRejectionReason(value string) { + if m != nil { + m.RejectionReason = value + } +} +func (x *RejectTaskRequest) ToProto() *ProtoRejectTaskRequest { + if x == nil { + return nil + } + + proto := &ProtoRejectTaskRequest{ + TaskGuid: x.TaskGuid, + RejectionReason: x.RejectionReason, + } + return proto +} + +func (x *ProtoRejectTaskRequest) FromProto() *RejectTaskRequest { + if x == nil { + return nil + } + + copysafe := &RejectTaskRequest{ + TaskGuid: x.TaskGuid, + RejectionReason: x.RejectionReason, + } + return copysafe +} + +func RejectTaskRequestToProtoSlice(values []*RejectTaskRequest) []*ProtoRejectTaskRequest { + if values == nil { + return nil + } + result := make([]*ProtoRejectTaskRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func RejectTaskRequestFromProtoSlice(values []*ProtoRejectTaskRequest) []*RejectTaskRequest { + if values == nil { + return nil + } + result := make([]*RejectTaskRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoTaskGuidRequest directly +type TaskGuidRequest struct { + TaskGuid string `json:"task_guid"` +} + +func (this *TaskGuidRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TaskGuidRequest) + if !ok { + that2, ok := that.(TaskGuidRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.TaskGuid != that1.TaskGuid { + return false + } + return true +} +func (m *TaskGuidRequest) GetTaskGuid() string { + if m != nil { + return m.TaskGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskGuidRequest) SetTaskGuid(value string) { + if m != nil { + m.TaskGuid = value + } +} +func (x *TaskGuidRequest) ToProto() *ProtoTaskGuidRequest { + if x == nil { + return nil + } + + proto := &ProtoTaskGuidRequest{ + TaskGuid: x.TaskGuid, + } + return proto +} + +func (x *ProtoTaskGuidRequest) FromProto() *TaskGuidRequest { + if x == nil { + return nil + } + + copysafe := &TaskGuidRequest{ + TaskGuid: x.TaskGuid, + } + return copysafe +} + +func TaskGuidRequestToProtoSlice(values []*TaskGuidRequest) []*ProtoTaskGuidRequest { + if values == nil { + return nil + } + result := make([]*ProtoTaskGuidRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TaskGuidRequestFromProtoSlice(values []*ProtoTaskGuidRequest) []*TaskGuidRequest { + if values == nil { + return nil + } + result := make([]*TaskGuidRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoCompleteTaskRequest directly +type CompleteTaskRequest struct { + TaskGuid string `json:"task_guid"` + CellId string `json:"cell_id"` + Failed bool `json:"failed"` + FailureReason string `json:"failure_reason"` + Result string `json:"result"` +} + +func (this *CompleteTaskRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*CompleteTaskRequest) + if !ok { + that2, ok := that.(CompleteTaskRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.TaskGuid != that1.TaskGuid { + return false + } + if this.CellId != that1.CellId { + return false + } + if this.Failed != that1.Failed { + return false + } + if this.FailureReason != that1.FailureReason { + return false + } + if this.Result != that1.Result { + return false + } + return true +} +func (m *CompleteTaskRequest) GetTaskGuid() string { + if m != nil { + return m.TaskGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CompleteTaskRequest) SetTaskGuid(value string) { + if m != nil { + m.TaskGuid = value + } +} +func (m *CompleteTaskRequest) GetCellId() string { + if m != nil { + return m.CellId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CompleteTaskRequest) SetCellId(value string) { + if m != nil { + m.CellId = value + } +} +func (m *CompleteTaskRequest) GetFailed() bool { + if m != nil { + return m.Failed + } + var defaultValue bool + defaultValue = false + return defaultValue +} +func (m *CompleteTaskRequest) SetFailed(value bool) { + if m != nil { + m.Failed = value + } +} +func (m *CompleteTaskRequest) GetFailureReason() string { + if m != nil { + return m.FailureReason + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CompleteTaskRequest) SetFailureReason(value string) { + if m != nil { + m.FailureReason = value + } +} +func (m *CompleteTaskRequest) GetResult() string { + if m != nil { + return m.Result + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *CompleteTaskRequest) SetResult(value string) { + if m != nil { + m.Result = value + } +} +func (x *CompleteTaskRequest) ToProto() *ProtoCompleteTaskRequest { + if x == nil { + return nil + } + + proto := &ProtoCompleteTaskRequest{ + TaskGuid: x.TaskGuid, + CellId: x.CellId, + Failed: x.Failed, + FailureReason: x.FailureReason, + Result: x.Result, + } + return proto +} + +func (x *ProtoCompleteTaskRequest) FromProto() *CompleteTaskRequest { + if x == nil { + return nil + } + + copysafe := &CompleteTaskRequest{ + TaskGuid: x.TaskGuid, + CellId: x.CellId, + Failed: x.Failed, + FailureReason: x.FailureReason, + Result: x.Result, + } + return copysafe +} + +func CompleteTaskRequestToProtoSlice(values []*CompleteTaskRequest) []*ProtoCompleteTaskRequest { + if values == nil { + return nil + } + result := make([]*ProtoCompleteTaskRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func CompleteTaskRequestFromProtoSlice(values []*ProtoCompleteTaskRequest) []*CompleteTaskRequest { + if values == nil { + return nil + } + result := make([]*CompleteTaskRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoTaskCallbackResponse directly +type TaskCallbackResponse struct { + TaskGuid string `json:"task_guid"` + Failed bool `json:"failed"` + FailureReason string `json:"failure_reason"` + Result string `json:"result"` + Annotation string `json:"annotation,omitempty"` + CreatedAt int64 `json:"created_at"` +} + +func (this *TaskCallbackResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TaskCallbackResponse) + if !ok { + that2, ok := that.(TaskCallbackResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.TaskGuid != that1.TaskGuid { + return false + } + if this.Failed != that1.Failed { + return false + } + if this.FailureReason != that1.FailureReason { + return false + } + if this.Result != that1.Result { + return false + } + if this.Annotation != that1.Annotation { + return false + } + if this.CreatedAt != that1.CreatedAt { + return false + } + return true +} +func (m *TaskCallbackResponse) GetTaskGuid() string { + if m != nil { + return m.TaskGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskCallbackResponse) SetTaskGuid(value string) { + if m != nil { + m.TaskGuid = value + } +} +func (m *TaskCallbackResponse) GetFailed() bool { + if m != nil { + return m.Failed + } + var defaultValue bool + defaultValue = false + return defaultValue +} +func (m *TaskCallbackResponse) SetFailed(value bool) { + if m != nil { + m.Failed = value + } +} +func (m *TaskCallbackResponse) GetFailureReason() string { + if m != nil { + return m.FailureReason + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskCallbackResponse) SetFailureReason(value string) { + if m != nil { + m.FailureReason = value + } +} +func (m *TaskCallbackResponse) GetResult() string { + if m != nil { + return m.Result + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskCallbackResponse) SetResult(value string) { + if m != nil { + m.Result = value + } +} +func (m *TaskCallbackResponse) GetAnnotation() string { + if m != nil { + return m.Annotation + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskCallbackResponse) SetAnnotation(value string) { + if m != nil { + m.Annotation = value + } +} +func (m *TaskCallbackResponse) GetCreatedAt() int64 { + if m != nil { + return m.CreatedAt + } + var defaultValue int64 + defaultValue = 0 + return defaultValue +} +func (m *TaskCallbackResponse) SetCreatedAt(value int64) { + if m != nil { + m.CreatedAt = value + } +} +func (x *TaskCallbackResponse) ToProto() *ProtoTaskCallbackResponse { + if x == nil { + return nil + } + + proto := &ProtoTaskCallbackResponse{ + TaskGuid: x.TaskGuid, + Failed: x.Failed, + FailureReason: x.FailureReason, + Result: x.Result, + Annotation: x.Annotation, + CreatedAt: x.CreatedAt, + } + return proto +} + +func (x *ProtoTaskCallbackResponse) FromProto() *TaskCallbackResponse { + if x == nil { + return nil + } + + copysafe := &TaskCallbackResponse{ + TaskGuid: x.TaskGuid, + Failed: x.Failed, + FailureReason: x.FailureReason, + Result: x.Result, + Annotation: x.Annotation, + CreatedAt: x.CreatedAt, + } + return copysafe +} + +func TaskCallbackResponseToProtoSlice(values []*TaskCallbackResponse) []*ProtoTaskCallbackResponse { + if values == nil { + return nil + } + result := make([]*ProtoTaskCallbackResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TaskCallbackResponseFromProtoSlice(values []*ProtoTaskCallbackResponse) []*TaskCallbackResponse { + if values == nil { + return nil + } + result := make([]*TaskCallbackResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoTasksRequest directly +type TasksRequest struct { + Domain string `json:"domain"` + CellId string `json:"cell_id"` +} + +func (this *TasksRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TasksRequest) + if !ok { + that2, ok := that.(TasksRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Domain != that1.Domain { + return false + } + if this.CellId != that1.CellId { + return false + } + return true +} +func (m *TasksRequest) GetDomain() string { + if m != nil { + return m.Domain + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TasksRequest) SetDomain(value string) { + if m != nil { + m.Domain = value + } +} +func (m *TasksRequest) GetCellId() string { + if m != nil { + return m.CellId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TasksRequest) SetCellId(value string) { + if m != nil { + m.CellId = value + } +} +func (x *TasksRequest) ToProto() *ProtoTasksRequest { + if x == nil { + return nil + } + + proto := &ProtoTasksRequest{ + Domain: x.Domain, + CellId: x.CellId, + } + return proto +} + +func (x *ProtoTasksRequest) FromProto() *TasksRequest { + if x == nil { + return nil + } + + copysafe := &TasksRequest{ + Domain: x.Domain, + CellId: x.CellId, + } + return copysafe +} + +func TasksRequestToProtoSlice(values []*TasksRequest) []*ProtoTasksRequest { + if values == nil { + return nil + } + result := make([]*ProtoTasksRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TasksRequestFromProtoSlice(values []*ProtoTasksRequest) []*TasksRequest { + if values == nil { + return nil + } + result := make([]*TasksRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoTasksResponse directly +type TasksResponse struct { + Error *Error `json:"error,omitempty"` + Tasks []*Task `json:"tasks,omitempty"` +} + +func (this *TasksResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TasksResponse) + if !ok { + that2, ok := that.(TasksResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + if this.Tasks == nil { + if that1.Tasks != nil { + return false + } + } else if len(this.Tasks) != len(that1.Tasks) { + return false + } + for i := range this.Tasks { + if !this.Tasks[i].Equal(that1.Tasks[i]) { + return false + } + } + return true +} +func (m *TasksResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *TasksResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (m *TasksResponse) GetTasks() []*Task { + if m != nil { + return m.Tasks + } + return nil +} +func (m *TasksResponse) SetTasks(value []*Task) { + if m != nil { + m.Tasks = value + } +} +func (x *TasksResponse) ToProto() *ProtoTasksResponse { + if x == nil { + return nil + } + + proto := &ProtoTasksResponse{ + Error: x.Error.ToProto(), + Tasks: TaskToProtoSlice(x.Tasks), + } + return proto +} + +func (x *ProtoTasksResponse) FromProto() *TasksResponse { + if x == nil { + return nil + } + + copysafe := &TasksResponse{ + Error: x.Error.FromProto(), + Tasks: TaskFromProtoSlice(x.Tasks), + } + return copysafe +} + +func TasksResponseToProtoSlice(values []*TasksResponse) []*ProtoTasksResponse { + if values == nil { + return nil + } + result := make([]*ProtoTasksResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TasksResponseFromProtoSlice(values []*ProtoTasksResponse) []*TasksResponse { + if values == nil { + return nil + } + result := make([]*TasksResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoTaskByGuidRequest directly +type TaskByGuidRequest struct { + TaskGuid string `json:"task_guid"` +} + +func (this *TaskByGuidRequest) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TaskByGuidRequest) + if !ok { + that2, ok := that.(TaskByGuidRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.TaskGuid != that1.TaskGuid { + return false + } + return true +} +func (m *TaskByGuidRequest) GetTaskGuid() string { + if m != nil { + return m.TaskGuid + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *TaskByGuidRequest) SetTaskGuid(value string) { + if m != nil { + m.TaskGuid = value + } +} +func (x *TaskByGuidRequest) ToProto() *ProtoTaskByGuidRequest { + if x == nil { + return nil + } + + proto := &ProtoTaskByGuidRequest{ + TaskGuid: x.TaskGuid, + } + return proto +} + +func (x *ProtoTaskByGuidRequest) FromProto() *TaskByGuidRequest { + if x == nil { + return nil + } + + copysafe := &TaskByGuidRequest{ + TaskGuid: x.TaskGuid, + } + return copysafe +} + +func TaskByGuidRequestToProtoSlice(values []*TaskByGuidRequest) []*ProtoTaskByGuidRequest { + if values == nil { + return nil + } + result := make([]*ProtoTaskByGuidRequest, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TaskByGuidRequestFromProtoSlice(values []*ProtoTaskByGuidRequest) []*TaskByGuidRequest { + if values == nil { + return nil + } + result := make([]*TaskByGuidRequest, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoTaskResponse directly +type TaskResponse struct { + Error *Error `json:"error,omitempty"` + Task *Task `json:"task,omitempty"` +} + +func (this *TaskResponse) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*TaskResponse) + if !ok { + that2, ok := that.(TaskResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Error == nil { + if that1.Error != nil { + return false + } + } else if !this.Error.Equal(*that1.Error) { + return false + } + if this.Task == nil { + if that1.Task != nil { + return false + } + } else if !this.Task.Equal(*that1.Task) { + return false + } + return true +} +func (m *TaskResponse) GetError() *Error { + if m != nil { + return m.Error + } + return nil +} +func (m *TaskResponse) SetError(value *Error) { + if m != nil { + m.Error = value + } +} +func (m *TaskResponse) GetTask() *Task { + if m != nil { + return m.Task + } + return nil +} +func (m *TaskResponse) SetTask(value *Task) { + if m != nil { + m.Task = value + } +} +func (x *TaskResponse) ToProto() *ProtoTaskResponse { + if x == nil { + return nil + } + + proto := &ProtoTaskResponse{ + Error: x.Error.ToProto(), + Task: x.Task.ToProto(), + } + return proto +} + +func (x *ProtoTaskResponse) FromProto() *TaskResponse { + if x == nil { + return nil + } + + copysafe := &TaskResponse{ + Error: x.Error.FromProto(), + Task: x.Task.FromProto(), + } + return copysafe +} + +func TaskResponseToProtoSlice(values []*TaskResponse) []*ProtoTaskResponse { + if values == nil { + return nil + } + result := make([]*ProtoTaskResponse, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func TaskResponseFromProtoSlice(values []*ProtoTaskResponse) []*TaskResponse { + if values == nil { + return nil + } + result := make([]*TaskResponse, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/models/task_test.go b/models/task_test.go index 4d5ab56d..3fb216e8 100644 --- a/models/task_test.go +++ b/models/task_test.go @@ -8,139 +8,143 @@ import ( "code.cloudfoundry.org/bbs/format" "code.cloudfoundry.org/bbs/models" . "code.cloudfoundry.org/bbs/test_helpers" - "github.com/gogo/protobuf/proto" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) var _ = Describe("Task", func() { var taskPayload string - var task models.Task + var initTask models.Task BeforeEach(func() { taskPayload = `{ "task_guid":"some-guid", "domain":"some-domain", - "rootfs": "docker:///docker.com/docker", - "env":[ - { - "name":"ENV_VAR_NAME", - "value":"an environmment value" - } - ], "cell_id":"cell", - "action": { - "download":{ - "from":"old_location", - "to":"new_location", - "cache_key":"the-cache-key", - "user":"someone", - "checksum_algorithm": "md5", - "checksum_value": "some value" - } - }, - "result_file":"some-file.txt", "result": "turboencabulated", "failed":true, "failure_reason":"because i said so", - "memory_mb":256, - "disk_mb":1024, - "log_rate_limit": { - "bytes_per_second": 2048 - }, - "cpu_weight": 42, - "privileged": true, - "log_guid": "123", - "log_source": "APP", - "metrics_guid": "456", "created_at": 1393371971000000000, "updated_at": 1393371971000000010, "first_completed_at": 1393371971000000030, "state": "Pending", - "annotation": "[{\"anything\": \"you want!\"}]... dude", - "network": { - "properties": { - "some-key": "some-value", - "some-other-key": "some-other-value" - } - }, - "egress_rules": [ - { - "protocol": "tcp", - "destinations": ["0.0.0.0/0"], - "port_range": { - "start": 1, - "end": 1024 - }, - "log": true - }, - { - "protocol": "udp", - "destinations": ["8.8.0.0/16"], - "ports": [53], - "log": false - } - ], - "completion_callback_url":"http://user:password@a.b.c/d/e/f", - "max_pids": 256, - "certificate_properties": { - "organizational_unit": ["stuff"] - }, - "image_username": "jake", - "image_password": "thedog", "rejection_count": 0, "rejection_reason": "", - "image_layers": [ - { - "url": "some-url", - "destination_path": "/tmp", - "media_type": "TGZ", - "layer_type": "SHARED" - } - ], - "legacy_download_user": "some-user", - "metric_tags": { - "source_id": { - "static": "some-guid" - }, - "foo": { - "static": "some-value" - }, - "bar": { - "dynamic": "INDEX" + "task_definition" : { + "rootfs": "docker:///docker.com/docker", + "env":[ + { + "name":"ENV_VAR_NAME", + "value":"an environmment value" + } + ], + "action": { + "download":{ + "from":"old_location", + "to":"new_location", + "cache_key":"the-cache-key", + "user":"someone", + "checksum_algorithm": "md5", + "checksum_value": "some value" + } + }, + "result_file":"some-file.txt", + "memory_mb":256, + "disk_mb":1024, + "log_rate_limit": { + "bytes_per_second": 2048 + }, + "cpu_weight": 42, + "privileged": true, + "log_guid": "123", + "log_source": "APP", + "metrics_guid": "456", + "annotation": "[{\"anything\": \"you want!\"}]... dude", + "network": { + "properties": { + "some-key": "some-value", + "some-other-key": "some-other-value" + } + }, + "egress_rules": [ + { + "protocol": "tcp", + "destinations": ["0.0.0.0/0"], + "port_range": { + "start": 1, + "end": 1024 + }, + "log": true + }, + { + "protocol": "udp", + "destinations": ["8.8.0.0/16"], + "ports": [53], + "log": false + } + ], + "completion_callback_url":"http://user:password@a.b.c/d/e/f", + "max_pids": 256, + "certificate_properties": { + "organizational_unit": ["stuff"] + }, + "image_username": "jake", + "image_password": "thedog", + "image_layers": [ + { + "url": "some-url", + "destination_path": "/tmp", + "media_type": "TGZ", + "layer_type": "SHARED" + } + ], + "legacy_download_user": "some-user", + "metric_tags": { + "source_id": { + "static": "some-guid" + }, + "foo": { + "static": "some-value" + }, + "bar": { + "dynamic": "INDEX" + } + }, + "volume_mounted_files": [ + {"path": "/redis/username", "content": "username"} + ] } - }, - "volume_mounted_files": [ - {"path": "/redis/username", "content": "username"} - ] - }` - - task = models.Task{} - err := json.Unmarshal([]byte(taskPayload), &task) + }` + + err := json.Unmarshal([]byte(taskPayload), &initTask) Expect(err).NotTo(HaveOccurred()) }) Describe("serialization", func() { It("successfully round trips through json and protobuf", func() { - jsonSerialization, err := json.Marshal(task) + var serializeTask models.Task + err := json.Unmarshal([]byte(taskPayload), &serializeTask) + Expect(err).NotTo(HaveOccurred()) + + jsonSerialization, err := json.Marshal(serializeTask) Expect(err).NotTo(HaveOccurred()) Expect(jsonSerialization).To(MatchJSON(taskPayload)) - protoSerialization, err := proto.Marshal(&task) + protoSerialization, err := proto.Marshal(serializeTask.ToProto()) Expect(err).NotTo(HaveOccurred()) - var protoDeserialization models.Task + var protoDeserialization models.ProtoTask err = proto.Unmarshal(protoSerialization, &protoDeserialization) Expect(err).NotTo(HaveOccurred()) - - Expect(protoDeserialization).To(Equal(task)) + Expect(*protoDeserialization.FromProto()).To(Equal(serializeTask)) }) }) Describe("Validate", func() { Context("when the task has a domain, valid guid, stack, and valid action", func() { It("is valid", func() { - task = models.Task{ + validateTask := models.Task{ Domain: "some-domain", TaskGuid: "some-task-guid", TaskDefinition: &models.TaskDefinition{ @@ -152,14 +156,14 @@ var _ = Describe("Task", func() { }, } - err := task.Validate() + err := validateTask.Validate() Expect(err).NotTo(HaveOccurred()) }) }) Context("when the task GUID is present but invalid", func() { It("returns an error indicating so", func() { - task = models.Task{ + validateTask := models.Task{ Domain: "some-domain", TaskGuid: "invalid/guid", TaskDefinition: &models.TaskDefinition{ @@ -171,7 +175,7 @@ var _ = Describe("Task", func() { }, } - err := task.Validate() + err := validateTask.Validate() Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("task_guid")) }) @@ -438,7 +442,7 @@ var _ = Describe("Task", func() { ImageUsername: "jake", ImagePassword: "pass", ImageLayers: []*models.ImageLayer{ - {Url: "some-url", DestinationPath: "", MediaType: models.MediaTypeTgz}, // invalid destination path + {Url: "some-url", DestinationPath: "", MediaType: models.ImageLayer_MediaTypeTgz}, // invalid destination path }, }, }, @@ -457,7 +461,7 @@ var _ = Describe("Task", func() { ImageUsername: "jake", ImagePassword: "pass", ImageLayers: []*models.ImageLayer{ - {Url: "some-url", DestinationPath: "/tmp", MediaType: models.MediaTypeTgz, LayerType: models.LayerTypeExclusive}, // exclusive layers require legacy_download_user to be set + {Url: "some-url", DestinationPath: "/tmp", MediaType: models.ImageLayer_MediaTypeTgz, LayerType: models.ImageLayer_LayerTypeExclusive}, // exclusive layers require legacy_download_user to be set }, }, }, @@ -479,42 +483,42 @@ var _ = Describe("Task", func() { Context("V3->V2", func() { Context("when there are no image layers", func() { BeforeEach(func() { - task.ImageLayers = nil + task.TaskDefinition.ImageLayers = nil }) It("does not add any cached dependencies to the TaskDefinition", func() { convertedTask := task.VersionDownTo(format.V2) - Expect(convertedTask.CachedDependencies).To(BeEmpty()) + Expect(convertedTask.TaskDefinition.CachedDependencies).To(BeEmpty()) }) It("does not add any Download Actions", func() { convertedTask := task.VersionDownTo(format.V2) - Expect(convertedTask.Action).To(Equal(task.Action)) + Expect(convertedTask.TaskDefinition.Action).To(Equal(task.TaskDefinition.Action)) }) }) Context("when there are shared image layers", func() { BeforeEach(func() { - task.ImageLayers = []*models.ImageLayer{ + task.TaskDefinition.ImageLayers = []*models.ImageLayer{ { Name: "dep0", Url: "u0", DestinationPath: "/tmp/0", - LayerType: models.LayerTypeShared, - MediaType: models.MediaTypeTgz, - DigestAlgorithm: models.DigestAlgorithmSha256, + LayerType: models.ImageLayer_LayerTypeShared, + MediaType: models.ImageLayer_MediaTypeTgz, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, DigestValue: "some-sha", }, { Name: "dep1", Url: "u1", DestinationPath: "/tmp/1", - LayerType: models.LayerTypeShared, - MediaType: models.MediaTypeTgz, + LayerType: models.ImageLayer_LayerTypeShared, + MediaType: models.ImageLayer_MediaTypeTgz, }, } - task.CachedDependencies = []*models.CachedDependency{ + task.TaskDefinition.CachedDependencies = []*models.CachedDependency{ { Name: "dep2", From: "u2", @@ -527,7 +531,7 @@ var _ = Describe("Task", func() { It("converts them to cached dependencies and prepends them to the list", func() { convertedTask := task.VersionDownTo(format.V2) - Expect(convertedTask.CachedDependencies).To(DeepEqual([]*models.CachedDependency{ + Expect(convertedTask.TaskDefinition.CachedDependencies).To(DeepEqual([]*models.CachedDependency{ { Name: "dep0", From: "u0", @@ -556,7 +560,7 @@ var _ = Describe("Task", func() { It("sets removes the existing image layers", func() { convertedTask := task.VersionDownTo(format.V2) - Expect(convertedTask.ImageLayers).To(BeNil()) + Expect(convertedTask.TaskDefinition.ImageLayers).To(BeNil()) }) }) @@ -566,28 +570,28 @@ var _ = Describe("Task", func() { ) BeforeEach(func() { - task.ImageLayers = []*models.ImageLayer{ + task.TaskDefinition.ImageLayers = []*models.ImageLayer{ { Name: "dep0", Url: "u0", DestinationPath: "/tmp/0", - LayerType: models.LayerTypeExclusive, - MediaType: models.MediaTypeTgz, - DigestAlgorithm: models.DigestAlgorithmSha256, + LayerType: models.ImageLayer_LayerTypeExclusive, + MediaType: models.ImageLayer_MediaTypeTgz, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, DigestValue: "some-sha", }, { Name: "dep1", Url: "u1", DestinationPath: "/tmp/1", - LayerType: models.LayerTypeExclusive, - MediaType: models.MediaTypeTgz, - DigestAlgorithm: models.DigestAlgorithmSha256, + LayerType: models.ImageLayer_LayerTypeExclusive, + MediaType: models.ImageLayer_MediaTypeTgz, + DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, DigestValue: "some-other-sha", }, } - task.LegacyDownloadUser = "the user" - task.Action = models.WrapAction(models.Timeout( + task.TaskDefinition.LegacyDownloadUser = "the user" + task.TaskDefinition.Action = models.WrapAction(models.Timeout( &models.RunAction{ Path: "/the/path", User: "the user", @@ -620,26 +624,26 @@ var _ = Describe("Task", func() { It("converts them to download actions with the correct user and prepends them to the action", func() { convertedTask := task.VersionDownTo(format.V2) - Expect(convertedTask.Action.GetValue()).To(DeepEqual( + Expect(convertedTask.TaskDefinition.Action.GetValue()).To(DeepEqual( models.Serial( models.Parallel(&downloadAction1, &downloadAction2), - task.Action.GetValue().(models.ActionInterface), + task.TaskDefinition.Action.GetValue().(models.ActionInterface), ))) }) It("sets removes the existing image layers", func() { convertedTask := task.VersionDownTo(format.V2) - Expect(convertedTask.ImageLayers).To(BeNil()) + Expect(convertedTask.TaskDefinition.ImageLayers).To(BeNil()) }) Context("when there is no existing action", func() { BeforeEach(func() { - task.Action = nil + task.TaskDefinition.Action = nil }) It("creates an action with exclusive layers converted to download actions", func() { convertedLRP := task.VersionDownTo(format.V2) - Expect(convertedLRP.Action.GetValue()).To(DeepEqual( + Expect(convertedLRP.TaskDefinition.Action.GetValue()).To(DeepEqual( models.Parallel(&downloadAction1, &downloadAction2), )) }) diff --git a/models/test/model_helpers/constructors.go b/models/test/model_helpers/constructors.go index 473afed6..8a833a53 100644 --- a/models/test/model_helpers/constructors.go +++ b/models/test/model_helpers/constructors.go @@ -9,10 +9,13 @@ import ( ) func NewValidActualLRP(guid string, index int32) *models.ActualLRP { + actualLrpKey := models.NewActualLRPKey(guid, index, "some-domain") + actualLrpInstanceKey := models.NewActualLRPInstanceKey("some-guid", "some-cell") + actualLrpNetInfo := models.NewActualLRPNetInfo("some-address", "container-address", models.ActualLRPNetInfo_PreferredAddressUnknown, models.NewPortMapping(2222, 4444)) actualLRP := &models.ActualLRP{ - ActualLRPKey: models.NewActualLRPKey(guid, index, "some-domain"), - ActualLRPInstanceKey: models.NewActualLRPInstanceKey("some-guid", "some-cell"), - ActualLRPNetInfo: models.NewActualLRPNetInfo("some-address", "container-address", models.ActualLRPNetInfo_PreferredAddressUnknown, models.NewPortMapping(2222, 4444)), + ActualLrpKey: actualLrpKey, + ActualLrpInstanceKey: actualLrpInstanceKey, + ActualLrpNetInfo: actualLrpNetInfo, ActualLrpInternalRoutes: NewActualLRPInternalRoutes(), MetricTags: NewActualLRPMetricTags(), AvailabilityZone: "some-zone", @@ -25,7 +28,8 @@ func NewValidActualLRP(guid string, index int32) *models.ActualLRP { Index: 999, }, } - actualLRP.SetRoutable(false) + routable := false + actualLRP.SetRoutable(&routable) err := actualLRP.Validate() Expect(err).NotTo(HaveOccurred()) @@ -47,13 +51,15 @@ func NewActualLRPMetricTags() map[string]string { func NewValidEvacuatingActualLRP(guid string, index int32) *models.ActualLRP { actualLRP := NewValidActualLRP(guid, index) actualLRP.Presence = models.ActualLRP_Evacuating - actualLRP.ActualLRPInstanceKey = models.NewActualLRPInstanceKey("some-guid", "some-evacuating-cell") + actualLrpInstanceKey := models.NewActualLRPInstanceKey("some-guid", "some-evacuating-cell") + actualLRP.ActualLrpInstanceKey = actualLrpInstanceKey return actualLRP } func NewValidDesiredLRP(guid string) *models.DesiredLRP { myRouterJSON := json.RawMessage(`{"foo":"bar"}`) modTag := models.NewModificationTag("epoch", 0) + routes := &models.Routes{"my-router": &myRouterJSON} desiredLRP := &models.DesiredLRP{ ProcessGuid: guid, Domain: "some-domain", @@ -90,7 +96,7 @@ func NewValidDesiredLRP(guid string) *models.DesiredLRP { MemoryMb: 1024, CpuWeight: 42, MaxPids: 1024, - Routes: &models.Routes{"my-router": &myRouterJSON}, + Routes: routes, LogSource: "some-log-source", LogGuid: "some-log-guid", MetricsGuid: "some-metrics-guid", @@ -127,8 +133,8 @@ func NewValidDesiredLRP(guid string) *models.DesiredLRP { ImageUsername: "image-username", ImagePassword: "image-password", ImageLayers: []*models.ImageLayer{ - {Name: "shared layer", LayerType: models.LayerTypeShared, Url: "some-url", DestinationPath: "/tmp", MediaType: models.MediaTypeTgz}, - {Name: "exclusive layer", LayerType: models.LayerTypeExclusive, Url: "some-url-2", DestinationPath: "/tmp/foo", MediaType: models.MediaTypeZip, DigestAlgorithm: models.DigestAlgorithmSha256, DigestValue: "some-sha256"}, + {Name: "shared layer", LayerType: models.ImageLayer_LayerTypeShared, Url: "some-url", DestinationPath: "/tmp", MediaType: models.ImageLayer_MediaTypeTgz}, + {Name: "exclusive layer", LayerType: models.ImageLayer_LayerTypeExclusive, Url: "some-url-2", DestinationPath: "/tmp/foo", MediaType: models.ImageLayer_MediaTypeZip, DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, DigestValue: "some-sha256"}, }, MetricTags: map[string]*models.MetricTagValue{ "source_id": {Static: "some-metrics-guid"}, @@ -227,8 +233,8 @@ func NewValidTaskDefinition() *models.TaskDefinition { ImageUsername: "image-username", ImagePassword: "image-password", ImageLayers: []*models.ImageLayer{ - {Name: "shared layer", LayerType: models.LayerTypeShared, Url: "some-url", DestinationPath: "/tmp", MediaType: models.MediaTypeTgz}, - {Name: "exclusive layer", LayerType: models.LayerTypeExclusive, Url: "some-url-2", DestinationPath: "/tmp/foo", MediaType: models.MediaTypeZip, DigestAlgorithm: models.DigestAlgorithmSha256, DigestValue: "some-sha256"}, + {Name: "shared layer", LayerType: models.ImageLayer_LayerTypeShared, Url: "some-url", DestinationPath: "/tmp", MediaType: models.ImageLayer_MediaTypeTgz}, + {Name: "exclusive layer", LayerType: models.ImageLayer_LayerTypeExclusive, Url: "some-url-2", DestinationPath: "/tmp/foo", MediaType: models.ImageLayer_MediaTypeZip, DigestAlgorithm: models.ImageLayer_DigestAlgorithmSha256, DigestValue: "some-sha256"}, }, MetricTags: map[string]*models.MetricTagValue{ "source_id": {Static: "some-metrics-guid"}, @@ -236,8 +242,8 @@ func NewValidTaskDefinition() *models.TaskDefinition { } } -func NewValidEgressRules() []models.SecurityGroupRule { - return []models.SecurityGroupRule{ +func NewValidEgressRules() []*models.SecurityGroupRule { + return []*models.SecurityGroupRule{ { Protocol: "tcp", Destinations: []string{"0.0.0.0/0"}, diff --git a/models/volume_mount.pb.go b/models/volume_mount.pb.go index 2193674d..21431986 100644 --- a/models/volume_mount.pb.go +++ b/models/volume_mount.pb.go @@ -1,1061 +1,255 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: volume_mount.proto package models import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" + sync "sync" + unsafe "unsafe" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type SharedDevice struct { - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id"` - MountConfig string `protobuf:"bytes,2,opt,name=mount_config,json=mountConfig,proto3" json:"mount_config"` -} +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -func (m *SharedDevice) Reset() { *m = SharedDevice{} } -func (*SharedDevice) ProtoMessage() {} -func (*SharedDevice) Descriptor() ([]byte, []int) { - return fileDescriptor_bbde336a4634d84f, []int{0} -} -func (m *SharedDevice) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SharedDevice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SharedDevice.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SharedDevice) XXX_Merge(src proto.Message) { - xxx_messageInfo_SharedDevice.Merge(m, src) +type ProtoSharedDevice struct { + state protoimpl.MessageState `protogen:"open.v1"` + VolumeId string `protobuf:"bytes,1,opt,name=volume_id,proto3" json:"volume_id,omitempty"` + MountConfig string `protobuf:"bytes,2,opt,name=mount_config,proto3" json:"mount_config,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *SharedDevice) XXX_Size() int { - return m.Size() -} -func (m *SharedDevice) XXX_DiscardUnknown() { - xxx_messageInfo_SharedDevice.DiscardUnknown(m) -} - -var xxx_messageInfo_SharedDevice proto.InternalMessageInfo -func (m *SharedDevice) GetVolumeId() string { - if m != nil { - return m.VolumeId - } - return "" +func (x *ProtoSharedDevice) Reset() { + *x = ProtoSharedDevice{} + mi := &file_volume_mount_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *SharedDevice) GetMountConfig() string { - if m != nil { - return m.MountConfig - } - return "" +func (x *ProtoSharedDevice) String() string { + return protoimpl.X.MessageStringOf(x) } -type VolumeMount struct { - Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver"` - ContainerDir string `protobuf:"bytes,3,opt,name=container_dir,json=containerDir,proto3" json:"container_dir"` - Mode string `protobuf:"bytes,6,opt,name=mode,proto3" json:"mode"` - // oneof device { - Shared *SharedDevice `protobuf:"bytes,7,opt,name=shared,proto3" json:"shared"` -} +func (*ProtoSharedDevice) ProtoMessage() {} -func (m *VolumeMount) Reset() { *m = VolumeMount{} } -func (*VolumeMount) ProtoMessage() {} -func (*VolumeMount) Descriptor() ([]byte, []int) { - return fileDescriptor_bbde336a4634d84f, []int{1} -} -func (m *VolumeMount) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeMount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeMount.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ProtoSharedDevice) ProtoReflect() protoreflect.Message { + mi := &file_volume_mount_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *VolumeMount) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeMount.Merge(m, src) -} -func (m *VolumeMount) XXX_Size() int { - return m.Size() -} -func (m *VolumeMount) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeMount.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_VolumeMount proto.InternalMessageInfo - -func (m *VolumeMount) GetDriver() string { - if m != nil { - return m.Driver - } - return "" +// Deprecated: Use ProtoSharedDevice.ProtoReflect.Descriptor instead. +func (*ProtoSharedDevice) Descriptor() ([]byte, []int) { + return file_volume_mount_proto_rawDescGZIP(), []int{0} } -func (m *VolumeMount) GetContainerDir() string { - if m != nil { - return m.ContainerDir +func (x *ProtoSharedDevice) GetVolumeId() string { + if x != nil { + return x.VolumeId } return "" } -func (m *VolumeMount) GetMode() string { - if m != nil { - return m.Mode +func (x *ProtoSharedDevice) GetMountConfig() string { + if x != nil { + return x.MountConfig } return "" } -func (m *VolumeMount) GetShared() *SharedDevice { - if m != nil { - return m.Shared - } - return nil -} - -type VolumePlacement struct { - DriverNames []string `protobuf:"bytes,1,rep,name=driver_names,json=driverNames,proto3" json:"driver_names"` -} - -func (m *VolumePlacement) Reset() { *m = VolumePlacement{} } -func (*VolumePlacement) ProtoMessage() {} -func (*VolumePlacement) Descriptor() ([]byte, []int) { - return fileDescriptor_bbde336a4634d84f, []int{2} -} -func (m *VolumePlacement) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumePlacement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumePlacement.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumePlacement) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumePlacement.Merge(m, src) -} -func (m *VolumePlacement) XXX_Size() int { - return m.Size() -} -func (m *VolumePlacement) XXX_DiscardUnknown() { - xxx_messageInfo_VolumePlacement.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumePlacement proto.InternalMessageInfo - -func (m *VolumePlacement) GetDriverNames() []string { - if m != nil { - return m.DriverNames - } - return nil +type ProtoVolumeMount struct { + state protoimpl.MessageState `protogen:"open.v1"` + Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` + ContainerDir string `protobuf:"bytes,3,opt,name=container_dir,proto3" json:"container_dir,omitempty"` + Mode string `protobuf:"bytes,6,opt,name=mode,proto3" json:"mode,omitempty"` + // oneof device { + Shared *ProtoSharedDevice `protobuf:"bytes,7,opt,name=shared,proto3" json:"shared,omitempty"` // } + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { - proto.RegisterType((*SharedDevice)(nil), "models.SharedDevice") - proto.RegisterType((*VolumeMount)(nil), "models.VolumeMount") - proto.RegisterType((*VolumePlacement)(nil), "models.VolumePlacement") +func (x *ProtoVolumeMount) Reset() { + *x = ProtoVolumeMount{} + mi := &file_volume_mount_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func init() { proto.RegisterFile("volume_mount.proto", fileDescriptor_bbde336a4634d84f) } - -var fileDescriptor_bbde336a4634d84f = []byte{ - // 381 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xc1, 0x6a, 0xa3, 0x40, - 0x18, 0xc7, 0x9d, 0xc4, 0xb8, 0x66, 0x4c, 0x58, 0x77, 0xd8, 0x83, 0x2c, 0xcb, 0x18, 0x3c, 0x85, - 0x85, 0x35, 0xd0, 0x94, 0xd2, 0x73, 0x1a, 0x0a, 0x0d, 0xb4, 0x14, 0x0b, 0xbd, 0x8a, 0xd1, 0x89, - 0x19, 0x88, 0x4e, 0x31, 0x9a, 0x73, 0x1f, 0xa1, 0x8f, 0xd1, 0x47, 0xe9, 0x31, 0xd0, 0x4b, 0x4e, - 0xd2, 0x98, 0x4b, 0xf1, 0x94, 0x47, 0x28, 0xce, 0xd8, 0x36, 0xb9, 0x38, 0xf3, 0xfb, 0x7f, 0x7f, - 0x3f, 0xbf, 0xef, 0x2f, 0x44, 0x2b, 0xb6, 0xc8, 0x22, 0xe2, 0x46, 0x2c, 0x8b, 0x53, 0xfb, 0x21, - 0x61, 0x29, 0x43, 0x4a, 0xc4, 0x02, 0xb2, 0x58, 0xfe, 0xf9, 0x1f, 0xd2, 0x74, 0x9e, 0x4d, 0x6d, - 0x9f, 0x45, 0x83, 0x90, 0x85, 0x6c, 0xc0, 0xcb, 0xd3, 0x6c, 0xc6, 0x89, 0x03, 0xbf, 0x89, 0xd7, - 0x2c, 0x06, 0x3b, 0x77, 0x73, 0x2f, 0x21, 0xc1, 0x98, 0xac, 0xa8, 0x4f, 0xd0, 0x3f, 0xd8, 0xae, - 0x9b, 0xd3, 0xc0, 0x00, 0x3d, 0xd0, 0x6f, 0x8f, 0xba, 0x65, 0x6e, 0x7e, 0x8b, 0x8e, 0x2a, 0xae, - 0x57, 0x01, 0x1a, 0xc2, 0x0e, 0x9f, 0xc0, 0xf5, 0x59, 0x3c, 0xa3, 0xa1, 0xd1, 0xe0, 0x76, 0xbd, - 0xcc, 0xcd, 0x23, 0xdd, 0xd1, 0x38, 0x5d, 0x70, 0xb0, 0x5e, 0x01, 0xd4, 0xee, 0x79, 0x87, 0xeb, - 0x4a, 0x45, 0x16, 0x54, 0x82, 0x84, 0xae, 0x48, 0x52, 0x7f, 0x0d, 0x96, 0xb9, 0x59, 0x2b, 0x4e, - 0x7d, 0xa2, 0x33, 0xd8, 0xf5, 0x59, 0x9c, 0x7a, 0x34, 0x26, 0x89, 0x1b, 0xd0, 0xc4, 0x68, 0x72, - 0xeb, 0xaf, 0x32, 0x37, 0x8f, 0x0b, 0x4e, 0xe7, 0x0b, 0xc7, 0x34, 0x41, 0x7f, 0xa1, 0x5c, 0xa5, - 0x62, 0x28, 0xdc, 0xae, 0x96, 0xb9, 0xc9, 0xd9, 0xe1, 0x4f, 0x74, 0x0e, 0x95, 0x25, 0x5f, 0xdd, - 0xf8, 0xd1, 0x03, 0x7d, 0xed, 0xe4, 0xb7, 0x2d, 0x22, 0xb4, 0x0f, 0x03, 0x11, 0xf3, 0x08, 0x9f, - 0x53, 0x9f, 0x13, 0x59, 0x6d, 0xe8, 0xcd, 0x89, 0xac, 0xca, 0x7a, 0x6b, 0x22, 0xab, 0x2d, 0x5d, - 0xb1, 0x2e, 0xe1, 0x4f, 0xb1, 0xd4, 0xed, 0xc2, 0xf3, 0x49, 0x44, 0xe2, 0xb4, 0x4a, 0x47, 0x8c, - 0xef, 0xc6, 0x5e, 0x44, 0x96, 0x06, 0xe8, 0x35, 0x3f, 0xd3, 0x39, 0xd4, 0x1d, 0x4d, 0xd0, 0x4d, - 0x05, 0xa3, 0xd3, 0xf5, 0x16, 0x83, 0xcd, 0x16, 0x4b, 0xfb, 0x2d, 0x06, 0x8f, 0x05, 0x06, 0xcf, - 0x05, 0x06, 0x2f, 0x05, 0x06, 0xeb, 0x02, 0x83, 0xb7, 0x02, 0x83, 0xf7, 0x02, 0x4b, 0xfb, 0x02, - 0x83, 0xa7, 0x1d, 0x96, 0xd6, 0x3b, 0x2c, 0x6d, 0x76, 0x58, 0x9a, 0x2a, 0xfc, 0x5f, 0x0e, 0x3f, - 0x02, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x23, 0x60, 0xde, 0x18, 0x02, 0x00, 0x00, +func (x *ProtoVolumeMount) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *SharedDevice) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*ProtoVolumeMount) ProtoMessage() {} - that1, ok := that.(*SharedDevice) - if !ok { - that2, ok := that.(SharedDevice) - if ok { - that1 = &that2 - } else { - return false +func (x *ProtoVolumeMount) ProtoReflect() protoreflect.Message { + mi := &file_volume_mount_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.VolumeId != that1.VolumeId { - return false - } - if this.MountConfig != that1.MountConfig { - return false - } - return true + return mi.MessageOf(x) } -func (this *VolumeMount) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*VolumeMount) - if !ok { - that2, ok := that.(VolumeMount) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Driver != that1.Driver { - return false - } - if this.ContainerDir != that1.ContainerDir { - return false - } - if this.Mode != that1.Mode { - return false - } - if !this.Shared.Equal(that1.Shared) { - return false - } - return true +// Deprecated: Use ProtoVolumeMount.ProtoReflect.Descriptor instead. +func (*ProtoVolumeMount) Descriptor() ([]byte, []int) { + return file_volume_mount_proto_rawDescGZIP(), []int{1} } -func (this *VolumePlacement) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*VolumePlacement) - if !ok { - that2, ok := that.(VolumePlacement) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.DriverNames) != len(that1.DriverNames) { - return false - } - for i := range this.DriverNames { - if this.DriverNames[i] != that1.DriverNames[i] { - return false - } - } - return true -} -func (this *SharedDevice) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&models.SharedDevice{") - s = append(s, "VolumeId: "+fmt.Sprintf("%#v", this.VolumeId)+",\n") - s = append(s, "MountConfig: "+fmt.Sprintf("%#v", this.MountConfig)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *VolumeMount) GoString() string { - if this == nil { - return "nil" +func (x *ProtoVolumeMount) GetDriver() string { + if x != nil { + return x.Driver } - s := make([]string, 0, 8) - s = append(s, "&models.VolumeMount{") - s = append(s, "Driver: "+fmt.Sprintf("%#v", this.Driver)+",\n") - s = append(s, "ContainerDir: "+fmt.Sprintf("%#v", this.ContainerDir)+",\n") - s = append(s, "Mode: "+fmt.Sprintf("%#v", this.Mode)+",\n") - if this.Shared != nil { - s = append(s, "Shared: "+fmt.Sprintf("%#v", this.Shared)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *VolumePlacement) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&models.VolumePlacement{") - s = append(s, "DriverNames: "+fmt.Sprintf("%#v", this.DriverNames)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringVolumeMount(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *SharedDevice) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SharedDevice) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SharedDevice) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MountConfig) > 0 { - i -= len(m.MountConfig) - copy(dAtA[i:], m.MountConfig) - i = encodeVarintVolumeMount(dAtA, i, uint64(len(m.MountConfig))) - i-- - dAtA[i] = 0x12 - } - if len(m.VolumeId) > 0 { - i -= len(m.VolumeId) - copy(dAtA[i:], m.VolumeId) - i = encodeVarintVolumeMount(dAtA, i, uint64(len(m.VolumeId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return "" } -func (m *VolumeMount) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoVolumeMount) GetContainerDir() string { + if x != nil { + return x.ContainerDir } - return dAtA[:n], nil -} - -func (m *VolumeMount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return "" } -func (m *VolumeMount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Shared != nil { - { - size, err := m.Shared.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintVolumeMount(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a +func (x *ProtoVolumeMount) GetMode() string { + if x != nil { + return x.Mode } - if len(m.Mode) > 0 { - i -= len(m.Mode) - copy(dAtA[i:], m.Mode) - i = encodeVarintVolumeMount(dAtA, i, uint64(len(m.Mode))) - i-- - dAtA[i] = 0x32 - } - if len(m.ContainerDir) > 0 { - i -= len(m.ContainerDir) - copy(dAtA[i:], m.ContainerDir) - i = encodeVarintVolumeMount(dAtA, i, uint64(len(m.ContainerDir))) - i-- - dAtA[i] = 0x1a - } - if len(m.Driver) > 0 { - i -= len(m.Driver) - copy(dAtA[i:], m.Driver) - i = encodeVarintVolumeMount(dAtA, i, uint64(len(m.Driver))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return "" } -func (m *VolumePlacement) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ProtoVolumeMount) GetShared() *ProtoSharedDevice { + if x != nil { + return x.Shared } - return dAtA[:n], nil + return nil } -func (m *VolumePlacement) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type ProtoVolumePlacement struct { + state protoimpl.MessageState `protogen:"open.v1"` + DriverNames []string `protobuf:"bytes,1,rep,name=driver_names,proto3" json:"driver_names,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *VolumePlacement) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DriverNames) > 0 { - for iNdEx := len(m.DriverNames) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.DriverNames[iNdEx]) - copy(dAtA[i:], m.DriverNames[iNdEx]) - i = encodeVarintVolumeMount(dAtA, i, uint64(len(m.DriverNames[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil +func (x *ProtoVolumePlacement) Reset() { + *x = ProtoVolumePlacement{} + mi := &file_volume_mount_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func encodeVarintVolumeMount(dAtA []byte, offset int, v uint64) int { - offset -= sovVolumeMount(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *SharedDevice) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.VolumeId) - if l > 0 { - n += 1 + l + sovVolumeMount(uint64(l)) - } - l = len(m.MountConfig) - if l > 0 { - n += 1 + l + sovVolumeMount(uint64(l)) - } - return n +func (x *ProtoVolumePlacement) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *VolumeMount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Driver) - if l > 0 { - n += 1 + l + sovVolumeMount(uint64(l)) - } - l = len(m.ContainerDir) - if l > 0 { - n += 1 + l + sovVolumeMount(uint64(l)) - } - l = len(m.Mode) - if l > 0 { - n += 1 + l + sovVolumeMount(uint64(l)) - } - if m.Shared != nil { - l = m.Shared.Size() - n += 1 + l + sovVolumeMount(uint64(l)) - } - return n -} +func (*ProtoVolumePlacement) ProtoMessage() {} -func (m *VolumePlacement) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.DriverNames) > 0 { - for _, s := range m.DriverNames { - l = len(s) - n += 1 + l + sovVolumeMount(uint64(l)) +func (x *ProtoVolumePlacement) ProtoReflect() protoreflect.Message { + mi := &file_volume_mount_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return n + return mi.MessageOf(x) } -func sovVolumeMount(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozVolumeMount(x uint64) (n int) { - return sovVolumeMount(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *SharedDevice) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SharedDevice{`, - `VolumeId:` + fmt.Sprintf("%v", this.VolumeId) + `,`, - `MountConfig:` + fmt.Sprintf("%v", this.MountConfig) + `,`, - `}`, - }, "") - return s +// Deprecated: Use ProtoVolumePlacement.ProtoReflect.Descriptor instead. +func (*ProtoVolumePlacement) Descriptor() ([]byte, []int) { + return file_volume_mount_proto_rawDescGZIP(), []int{2} } -func (this *VolumeMount) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeMount{`, - `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, - `ContainerDir:` + fmt.Sprintf("%v", this.ContainerDir) + `,`, - `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, - `Shared:` + strings.Replace(this.Shared.String(), "SharedDevice", "SharedDevice", 1) + `,`, - `}`, - }, "") - return s -} -func (this *VolumePlacement) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumePlacement{`, - `DriverNames:` + fmt.Sprintf("%v", this.DriverNames) + `,`, - `}`, - }, "") - return s -} -func valueToStringVolumeMount(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *SharedDevice) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVolumeMount - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SharedDevice: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SharedDevice: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVolumeMount - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthVolumeMount - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthVolumeMount - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VolumeId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MountConfig", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVolumeMount - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthVolumeMount - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthVolumeMount - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MountConfig = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipVolumeMount(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthVolumeMount - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ProtoVolumePlacement) GetDriverNames() []string { + if x != nil { + return x.DriverNames } return nil } -func (m *VolumeMount) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVolumeMount - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VolumeMount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeMount: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVolumeMount - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthVolumeMount - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthVolumeMount - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Driver = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerDir", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVolumeMount - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthVolumeMount - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthVolumeMount - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContainerDir = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVolumeMount - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthVolumeMount - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthVolumeMount - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Mode = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shared", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVolumeMount - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthVolumeMount - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthVolumeMount - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Shared == nil { - m.Shared = &SharedDevice{} - } - if err := m.Shared.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipVolumeMount(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthVolumeMount - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumePlacement) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVolumeMount - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VolumePlacement: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumePlacement: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverNames", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVolumeMount - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthVolumeMount - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthVolumeMount - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DriverNames = append(m.DriverNames, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipVolumeMount(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthVolumeMount - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var File_volume_mount_proto protoreflect.FileDescriptor - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipVolumeMount(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVolumeMount - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVolumeMount - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVolumeMount - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthVolumeMount - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupVolumeMount - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthVolumeMount - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} +const file_volume_mount_proto_rawDesc = "" + + "\n" + + "\x12volume_mount.proto\x12\x06models\x1a\tbbs.proto\"_\n" + + "\x11ProtoSharedDevice\x12!\n" + + "\tvolume_id\x18\x01 \x01(\tB\x03\xc0>\x01R\tvolume_id\x12'\n" + + "\fmount_config\x18\x02 \x01(\tB\x03\xc0>\x01R\fmount_config\"\xbd\x01\n" + + "\x10ProtoVolumeMount\x12\x1b\n" + + "\x06driver\x18\x01 \x01(\tB\x03\xc0>\x01R\x06driver\x12)\n" + + "\rcontainer_dir\x18\x03 \x01(\tB\x03\xc0>\x01R\rcontainer_dir\x12\x17\n" + + "\x04mode\x18\x06 \x01(\tB\x03\xc0>\x01R\x04mode\x126\n" + + "\x06shared\x18\a \x01(\v2\x19.models.ProtoSharedDeviceB\x03\xc0>\x01R\x06sharedJ\x04\b\x02\x10\x03J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06\"?\n" + + "\x14ProtoVolumePlacement\x12'\n" + + "\fdriver_names\x18\x01 \x03(\tB\x03\xc0>\x01R\fdriver_namesB\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" var ( - ErrInvalidLengthVolumeMount = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowVolumeMount = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupVolumeMount = fmt.Errorf("proto: unexpected end of group") + file_volume_mount_proto_rawDescOnce sync.Once + file_volume_mount_proto_rawDescData []byte ) + +func file_volume_mount_proto_rawDescGZIP() []byte { + file_volume_mount_proto_rawDescOnce.Do(func() { + file_volume_mount_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_volume_mount_proto_rawDesc), len(file_volume_mount_proto_rawDesc))) + }) + return file_volume_mount_proto_rawDescData +} + +var file_volume_mount_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_volume_mount_proto_goTypes = []any{ + (*ProtoSharedDevice)(nil), // 0: models.ProtoSharedDevice + (*ProtoVolumeMount)(nil), // 1: models.ProtoVolumeMount + (*ProtoVolumePlacement)(nil), // 2: models.ProtoVolumePlacement +} +var file_volume_mount_proto_depIdxs = []int32{ + 0, // 0: models.ProtoVolumeMount.shared:type_name -> models.ProtoSharedDevice + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_volume_mount_proto_init() } +func file_volume_mount_proto_init() { + if File_volume_mount_proto != nil { + return + } + file_bbs_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_volume_mount_proto_rawDesc), len(file_volume_mount_proto_rawDesc)), + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_volume_mount_proto_goTypes, + DependencyIndexes: file_volume_mount_proto_depIdxs, + MessageInfos: file_volume_mount_proto_msgTypes, + }.Build() + File_volume_mount_proto = out.File + file_volume_mount_proto_goTypes = nil + file_volume_mount_proto_depIdxs = nil +} diff --git a/models/volume_mount.proto b/models/volume_mount.proto index 3139b87e..ec3cf676 100644 --- a/models/volume_mount.proto +++ b/models/volume_mount.proto @@ -1,28 +1,27 @@ syntax = "proto3"; package models; +option go_package="code.cloudfoundry.org/bbs/models"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "bbs.proto"; -option (gogoproto.goproto_enum_prefix_all) = true; - -message SharedDevice { - string volume_id = 1 [(gogoproto.jsontag) = "volume_id"]; - string mount_config = 2 [(gogoproto.jsontag) = "mount_config"]; +message ProtoSharedDevice { + string volume_id = 1 [json_name = "volume_id", (bbs.bbs_json_always_emit) = true]; + string mount_config = 2 [json_name = "mount_config", (bbs.bbs_json_always_emit) = true]; } -message VolumeMount { +message ProtoVolumeMount { reserved 2, 4, 5; - string driver = 1 [(gogoproto.jsontag) = "driver"]; - string container_dir = 3 [(gogoproto.jsontag) = "container_dir"]; - string mode = 6 [(gogoproto.jsontag) = "mode"]; + string driver = 1 [json_name = "driver", (bbs.bbs_json_always_emit) = true]; + string container_dir = 3 [json_name = "container_dir", (bbs.bbs_json_always_emit) = true]; + string mode = 6 [json_name = "mode", (bbs.bbs_json_always_emit) = true]; // oneof device { - SharedDevice shared = 7 [(gogoproto.jsontag) = "shared"]; + ProtoSharedDevice shared = 7 [json_name = "shared", (bbs.bbs_json_always_emit) = true]; // } } -message VolumePlacement { - repeated string driver_names = 1 [(gogoproto.jsontag) = "driver_names"]; +message ProtoVolumePlacement { + repeated string driver_names = 1 [json_name = "driver_names", (bbs.bbs_json_always_emit) = true]; } diff --git a/models/volume_mount_bbs.pb.go b/models/volume_mount_bbs.pb.go new file mode 100644 index 00000000..7d033710 --- /dev/null +++ b/models/volume_mount_bbs.pb.go @@ -0,0 +1,359 @@ +// Code generated by protoc-gen-go-bbs. DO NOT EDIT. +// versions: +// - protoc-gen-go-bbs v0.0.1 +// - protoc v6.31.1 +// source: volume_mount.proto + +package models + +// Prevent copylock errors when using ProtoSharedDevice directly +type SharedDevice struct { + VolumeId string `json:"volume_id"` + MountConfig string `json:"mount_config"` +} + +func (this *SharedDevice) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*SharedDevice) + if !ok { + that2, ok := that.(SharedDevice) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.VolumeId != that1.VolumeId { + return false + } + if this.MountConfig != that1.MountConfig { + return false + } + return true +} +func (m *SharedDevice) GetVolumeId() string { + if m != nil { + return m.VolumeId + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *SharedDevice) SetVolumeId(value string) { + if m != nil { + m.VolumeId = value + } +} +func (m *SharedDevice) GetMountConfig() string { + if m != nil { + return m.MountConfig + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *SharedDevice) SetMountConfig(value string) { + if m != nil { + m.MountConfig = value + } +} +func (x *SharedDevice) ToProto() *ProtoSharedDevice { + if x == nil { + return nil + } + + proto := &ProtoSharedDevice{ + VolumeId: x.VolumeId, + MountConfig: x.MountConfig, + } + return proto +} + +func (x *ProtoSharedDevice) FromProto() *SharedDevice { + if x == nil { + return nil + } + + copysafe := &SharedDevice{ + VolumeId: x.VolumeId, + MountConfig: x.MountConfig, + } + return copysafe +} + +func SharedDeviceToProtoSlice(values []*SharedDevice) []*ProtoSharedDevice { + if values == nil { + return nil + } + result := make([]*ProtoSharedDevice, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func SharedDeviceFromProtoSlice(values []*ProtoSharedDevice) []*SharedDevice { + if values == nil { + return nil + } + result := make([]*SharedDevice, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoVolumeMount directly +type VolumeMount struct { + Driver string `json:"driver"` + ContainerDir string `json:"container_dir"` + Mode string `json:"mode"` + Shared *SharedDevice `json:"shared"` +} + +func (this *VolumeMount) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*VolumeMount) + if !ok { + that2, ok := that.(VolumeMount) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.Driver != that1.Driver { + return false + } + if this.ContainerDir != that1.ContainerDir { + return false + } + if this.Mode != that1.Mode { + return false + } + if this.Shared == nil { + if that1.Shared != nil { + return false + } + } else if !this.Shared.Equal(*that1.Shared) { + return false + } + return true +} +func (m *VolumeMount) GetDriver() string { + if m != nil { + return m.Driver + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *VolumeMount) SetDriver(value string) { + if m != nil { + m.Driver = value + } +} +func (m *VolumeMount) GetContainerDir() string { + if m != nil { + return m.ContainerDir + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *VolumeMount) SetContainerDir(value string) { + if m != nil { + m.ContainerDir = value + } +} +func (m *VolumeMount) GetMode() string { + if m != nil { + return m.Mode + } + var defaultValue string + defaultValue = "" + return defaultValue +} +func (m *VolumeMount) SetMode(value string) { + if m != nil { + m.Mode = value + } +} +func (m *VolumeMount) GetShared() *SharedDevice { + if m != nil { + return m.Shared + } + return nil +} +func (m *VolumeMount) SetShared(value *SharedDevice) { + if m != nil { + m.Shared = value + } +} +func (x *VolumeMount) ToProto() *ProtoVolumeMount { + if x == nil { + return nil + } + + proto := &ProtoVolumeMount{ + Driver: x.Driver, + ContainerDir: x.ContainerDir, + Mode: x.Mode, + Shared: x.Shared.ToProto(), + } + return proto +} + +func (x *ProtoVolumeMount) FromProto() *VolumeMount { + if x == nil { + return nil + } + + copysafe := &VolumeMount{ + Driver: x.Driver, + ContainerDir: x.ContainerDir, + Mode: x.Mode, + Shared: x.Shared.FromProto(), + } + return copysafe +} + +func VolumeMountToProtoSlice(values []*VolumeMount) []*ProtoVolumeMount { + if values == nil { + return nil + } + result := make([]*ProtoVolumeMount, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func VolumeMountFromProtoSlice(values []*ProtoVolumeMount) []*VolumeMount { + if values == nil { + return nil + } + result := make([]*VolumeMount, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} + +// Prevent copylock errors when using ProtoVolumePlacement directly +type VolumePlacement struct { + DriverNames []string `json:"driver_names"` +} + +func (this *VolumePlacement) Equal(that interface{}) bool { + + if that == nil { + return this == nil + } + + that1, ok := that.(*VolumePlacement) + if !ok { + that2, ok := that.(VolumePlacement) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + + if this.DriverNames == nil { + if that1.DriverNames != nil { + return false + } + } else if len(this.DriverNames) != len(that1.DriverNames) { + return false + } + for i := range this.DriverNames { + if this.DriverNames[i] != that1.DriverNames[i] { + return false + } + } + return true +} +func (m *VolumePlacement) GetDriverNames() []string { + if m != nil { + return m.DriverNames + } + return nil +} +func (m *VolumePlacement) SetDriverNames(value []string) { + if m != nil { + m.DriverNames = value + } +} +func (x *VolumePlacement) ToProto() *ProtoVolumePlacement { + if x == nil { + return nil + } + + proto := &ProtoVolumePlacement{ + DriverNames: x.DriverNames, + } + return proto +} + +func (x *ProtoVolumePlacement) FromProto() *VolumePlacement { + if x == nil { + return nil + } + + copysafe := &VolumePlacement{ + DriverNames: x.DriverNames, + } + return copysafe +} + +func VolumePlacementToProtoSlice(values []*VolumePlacement) []*ProtoVolumePlacement { + if values == nil { + return nil + } + result := make([]*ProtoVolumePlacement, len(values)) + for i, val := range values { + result[i] = val.ToProto() + } + return result +} + +func VolumePlacementFromProtoSlice(values []*ProtoVolumePlacement) []*VolumePlacement { + if values == nil { + return nil + } + result := make([]*VolumePlacement, len(values)) + for i, val := range values { + result[i] = val.FromProto() + } + return result +} diff --git a/protoc-gen-go-bbs/bbs.go b/protoc-gen-go-bbs/bbs.go new file mode 100644 index 00000000..4922cc50 --- /dev/null +++ b/protoc-gen-go-bbs/bbs.go @@ -0,0 +1,950 @@ +package main + +import ( + "fmt" + "log" + "slices" + "strings" + "text/template" + "unicode" + + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/types/descriptorpb" +) + +type bbsGenerateHelperInterface interface { + genCopysafeStruct(g *protogen.GeneratedFile, msg *protogen.Message) + genToProtoMethod(g *protogen.GeneratedFile, msg *protogen.Message) + genFromProtoMethod(g *protogen.GeneratedFile, msg *protogen.Message) + genToProtoSliceMethod(g *protogen.GeneratedFile, msg *protogen.Message) + genFromProtoSliceMethod(g *protogen.GeneratedFile, msg *protogen.Message) + genMessageEnums(g *protogen.GeneratedFile, msg *protogen.Message) + genAccessors(g *protogen.GeneratedFile, msg *protogen.Message) + genEqual(g *protogen.GeneratedFile, msg *protogen.Message) + + genGlobalEnum(g *protogen.GeneratedFile, eNuM *protogen.Enum) +} +type bbsGenerateHelper struct{} + +var ignoredMessages []string = []string{"ProtoRoutes"} +var ignoredEnums []string = []string{} +var ignoredServices []string = []string{} + +var helper bbsGenerateHelperInterface = bbsGenerateHelper{} + +func getUnsafeName(g *protogen.GeneratedFile, ident protogen.GoIdent) string { + return g.QualifiedGoIdent(ident) +} + +func getUnsafeNameFromString(name protoreflect.Name) string { + unsafeName := name + return string(unsafeName) +} + +func getCopysafeName(g *protogen.GeneratedFile, ident protogen.GoIdent) (string, bool) { + unsafeName := getUnsafeName(g, ident) + return strings.CutPrefix(unsafeName, *prefix) +} + +func getCopysafeNameFromString(name protoreflect.Name) (string, bool) { + unsafeName := getUnsafeNameFromString(name) + return strings.CutPrefix(unsafeName, *prefix) +} + +func getFieldName(goName string) string { + result := goName + return result +} + +func getJsonTag(field *protogen.Field) string { + jsonName := field.Desc.JSONName() + jsonEmit := ",omitempty" + if isAlwaysEmit(field) { + jsonEmit = "" + } + tag := fmt.Sprintf("`json:\"%s%s\"`", jsonName, jsonEmit) + return tag +} + +func isAlwaysEmit(field *protogen.Field) bool { + isAlwaysEmit := proto.GetExtension(field.Desc.Options().(*descriptorpb.FieldOptions), E_BbsJsonAlwaysEmit) + return isAlwaysEmit.(bool) +} + +func isMessageDeprecated(msg *protogen.Message) bool { + options := msg.Desc.Options().(*descriptorpb.MessageOptions) + return options.GetDeprecated() +} + +func isFieldDeprecated(field *protogen.Field) bool { + options := field.Desc.Options().(*descriptorpb.FieldOptions) + return options.GetDeprecated() +} + +func isEnumValueDeprecated(enumValue *protogen.EnumValue) bool { + options := enumValue.Desc.Options().(*descriptorpb.EnumValueOptions) + return options.GetDeprecated() +} + +func (bbsGenerateHelper) genCopysafeStruct(g *protogen.GeneratedFile, msg *protogen.Message) { + if copysafeName, ok := getCopysafeName(g, msg.GoIdent); ok { + if isMessageDeprecated(msg) { + g.P("// Deprecated: marked deprecated in ", msg.Location.SourceFile) + } + g.P("// Prevent copylock errors when using ", msg.GoIdent.GoName, " directly") + g.P("type ", copysafeName, " struct {") + for _, field := range msg.Fields { + if isFieldDeprecated(field) { + g.P("// Deprecated: marked deprecated in ", msg.Location.SourceFile) + } + if *debug { + options := field.Desc.Options().(*descriptorpb.FieldOptions) + log.Printf("New Field Detected: %+v\n\n", field) + log.Printf("Field Options: %+v\n\n", options) + } + fieldName := getFieldName(field.GoName) + fieldType := getActualType(g, field) + jsonTag := getJsonTag(field) + g.P(fieldName, " ", fieldType, " ", jsonTag) + } + g.P("}") + + helper.genEqual(g, msg) + helper.genAccessors(g, msg) + } +} + +type EqualFunc struct { + CopysafeName string +} + +type EqualField struct { + FieldName string +} + +func (bbsGenerateHelper) genEqual(g *protogen.GeneratedFile, msg *protogen.Message) { + if copysafeName, ok := getCopysafeName(g, msg.GoIdent); ok { + equalBuilder := new(strings.Builder) + equal, err := template.New("equal").Parse( + ` + if that == nil { + return this == nil + } + + that1, ok := that.(*{{.CopysafeName}}) + if !ok { + that2, ok := that.({{.CopysafeName}}) + if ok { + that1 = &that2 + } else { + return false + } + } + + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + `) + if err != nil { + panic(err) + } + equal.Execute(equalBuilder, EqualFunc{CopysafeName: copysafeName}) + + g.P("func (this *", copysafeName, ") Equal(that interface{}) bool {") + g.P(equalBuilder.String()) + g.P() + for _, field := range msg.Fields { + if isExcludedFromEqual(field) { + continue + } + fieldName := getFieldName(field.GoName) + if field.Desc.Cardinality() == protoreflect.Repeated { + g.P("if this.", fieldName, " == nil {") + g.P("if that1.", fieldName, " != nil {") + g.P("return false") + g.P("}") + g.P("} else if len(this.", fieldName, ") != len(that1.", fieldName, ") {") + g.P("return false") + g.P("}") + g.P("for i := range this.", fieldName, " {") + if field.Message != nil && !field.Desc.IsMap() { + g.P("if !this.", fieldName, "[i].Equal(that1.", fieldName, "[i]) {") + } else if field.Desc.IsMap() && field.Desc.MapValue().Kind() == protoreflect.BytesKind { + bytesEqual := protogen.GoIdent{GoName: "Equal", GoImportPath: "bytes"} + g.P("if !", g.QualifiedGoIdent(bytesEqual), "(this.", fieldName, "[i], that1.", fieldName, "[i]) {") + } else if field.Desc.IsMap() && field.Desc.MapValue().Kind() == protoreflect.MessageKind { + g.P("if !this.", fieldName, "[i].Equal(that1.", fieldName, "[i]) {") + } else { + g.P("if this.", fieldName, "[i] != that1.", fieldName, "[i] {") + } + g.P("return false") + g.P("}") + } else if field.Message != nil { + pointer := "*" + if isByValueType(field) { + pointer = "" + } else { + g.P("if this.", fieldName, " == nil {") + g.P("if that1.", fieldName, " != nil {") + g.P("return false") + g.P("}") + g.P("} else ") + } + g.P("if !this.", fieldName, ".Equal(", pointer, "that1.", fieldName, ") {") + g.P("return false") + } else { + pointer := "" + if field.Desc.HasOptionalKeyword() { + pointer = "*" + g.P("if this.", fieldName, " == nil {") + g.P("if that1.", fieldName, " != nil {") + g.P("return false") + g.P("}") + g.P("} else ") + } + g.P("if ", pointer, "this.", fieldName, " != ", pointer, "that1.", fieldName, " {") + g.P("return false") + } + g.P("}") + } + g.P("return true") + g.P("}") + } +} + +func (bbsGenerateHelper) genAccessors(g *protogen.GeneratedFile, msg *protogen.Message) { + if copysafeName, ok := getCopysafeName(g, msg.GoIdent); ok { + for _, field := range msg.Fields { + fieldName := getFieldName(field.GoName) + fieldType := getActualType(g, field) + deprecated := isFieldDeprecated(field) + + if *debug { + log.Printf("Generating accessors for %s...\n", fieldName) + } + + if !isByValueType(field) { + if deprecated { + g.P("// Deprecated: marked deprecated in ", msg.Location.SourceFile) + } + genGetter(g, copysafeName, field) + } + + if deprecated { + g.P("// Deprecated: marked deprecated in ", msg.Location.SourceFile) + } + genSetter(g, copysafeName, fieldName, fieldType) + } + } +} + +func genExists(g *protogen.GeneratedFile, copysafeName string, field *protogen.Field) { + if *debug { + log.Print("Exists...") + } + fieldName := getFieldName(field.GoName) + g.P("func (m *", copysafeName, ") ", fieldName, "Exists() bool {") + g.P("return m != nil && m.", fieldName, " != nil") + g.P("}") +} + +func genGetter(g *protogen.GeneratedFile, copysafeName string, field *protogen.Field) { + if *debug { + log.Print("Getter...") + } + fieldName := getFieldName(field.GoName) + fieldType := getActualType(g, field) + defaultValue := getDefaultValueString(field) + defaultReturn := "defaultValue" + isOptional := field.Desc.HasOptionalKeyword() + optionalCheck := "" + if isOptional { + defaultReturn = "&" + defaultReturn + optionalCheck = fmt.Sprintf("&& m.%s != nil ", fieldName) //extra space intentional + genExists(g, copysafeName, field) + } + g.P("func (m *", copysafeName, ") Get", fieldName, "() ", fieldType, " {") + g.P("if m != nil ", optionalCheck, "{") + g.P("return m.", fieldName) + g.P("}") + if defaultValue == "nil" { + g.P("return nil") + } else { + valueType, _ := strings.CutPrefix(fieldType, "*") + g.P("var defaultValue ", valueType) + g.P("defaultValue = ", defaultValue) + g.P("return ", defaultReturn) + } + g.P("}") +} + +func genSetter(g *protogen.GeneratedFile, copysafeName string, fieldName string, fieldType string) { + if *debug { + log.Print("Setter...") + } + setValue := " = value" + g.P("func (m *", copysafeName, ") Set", fieldName, "(value ", fieldType, ") {") + g.P("if m != nil {") + g.P("m.", fieldName, setValue) + g.P("}") + g.P("}") +} + +func hasDefaultValue(field *protogen.Field) bool { + defaultValue := proto.GetExtension(field.Desc.Options().(*descriptorpb.FieldOptions), E_BbsDefaultValue) + return len(defaultValue.(string)) > 0 +} + +func getDefaultValue(field *protogen.Field) string { + defaultValue := proto.GetExtension(field.Desc.Options().(*descriptorpb.FieldOptions), E_BbsDefaultValue) + return defaultValue.(string) +} + +func getDefaultValueString(field *protogen.Field) string { + if hasDefaultValue(field) { + return getDefaultValue(field) + } + + if field.Desc.Cardinality() == protoreflect.Repeated { + return "nil" + } + + switch kind := field.Desc.Kind(); kind { + case protoreflect.BytesKind, protoreflect.GroupKind, protoreflect.MessageKind: + return "nil" + case protoreflect.BoolKind: + return "false" + case protoreflect.EnumKind: + return "0" + case protoreflect.DoubleKind, protoreflect.Fixed32Kind, protoreflect.Fixed64Kind, protoreflect.FloatKind, protoreflect.Int32Kind, protoreflect.Sfixed32Kind, protoreflect.Sfixed64Kind, protoreflect.Sint32Kind, protoreflect.Sint64Kind, protoreflect.Uint32Kind, protoreflect.Uint64Kind, protoreflect.Int64Kind: + return "0" + case protoreflect.StringKind: + return `""` + default: + panic(fmt.Sprintf("Unrecognized type: %s", kind)) + } +} + +func getActualType(g *protogen.GeneratedFile, field *protogen.Field) string { + var fieldType string + if field.Desc.Cardinality() == protoreflect.Repeated { + fieldType = "[]" + } + + if isCustomType(field) { + customType := getCustomType(field) + pointer := "*" + if isByValueType(field) { + pointer = "" + } + fieldType += pointer + customType + } else if field.Desc.IsMap() { + // check for maps first because legacy protobuf would generate "Entry" messages, + // and for some reason the Message field is still populated + if *debug { + log.Printf("Map Field Detected: %+v\n\n", field.Message) + } + mapValueKind := field.Desc.MapValue().Kind() + mapValueType := mapValueKind.String() + if mapValueKind == protoreflect.BytesKind { + mapValueType = "[]byte" + } else if mapValueKind == protoreflect.MessageKind { + valueField := field.Desc.MapValue().Message().FullName() + rawGoIdent := strings.Split(string(valueField), ".") + valueFieldType, _ := strings.CutPrefix(rawGoIdent[1], *prefix) + mapValueType = "*" + valueFieldType + } + + fieldType = "map[" + field.Desc.MapKey().Kind().String() + "]" + mapValueType + } else if field.Message != nil { + if *debug { + log.Printf("Message Field Detected: %+v\n\n", field.Message) + log.Printf("Message Description: %+v\n\n", field.Message.Desc) + } + messageType, _ := getCopysafeName(g, field.Message.GoIdent) + pointer := "*" + if isByValueType(field) { + pointer = "" + } + fieldType += pointer + messageType + } else if field.Enum != nil { + if *debug { + log.Printf("Enum Field Detected: %+v\n\n", field.Enum) + log.Printf("Enum Description: %+v\n\n", field.Enum.Desc) + } + enumType, _ := getCopysafeName(g, field.Enum.GoIdent) + fieldType += enumType + } else { + optional := "" + if field.Desc.HasOptionalKeyword() { + optional = "*" + } + fieldType += optional + field.Desc.Kind().String() + } + + return fieldType +} + +func isByValueType(field *protogen.Field) bool { + isByValueType := proto.GetExtension(field.Desc.Options().(*descriptorpb.FieldOptions), E_BbsByValue) + return isByValueType.(bool) +} + +func isExcludedFromEqual(field *protogen.Field) bool { + isExcludedFromEqual := proto.GetExtension(field.Desc.Options().(*descriptorpb.FieldOptions), E_BbsExcludeFromEqual) + return isExcludedFromEqual.(bool) +} + +func isCustomType(field *protogen.Field) bool { + customType := proto.GetExtension(field.Desc.Options().(*descriptorpb.FieldOptions), E_BbsCustomType) + return len(customType.(string)) > 0 +} + +func getCustomType(field *protogen.Field) string { + customType := proto.GetExtension(field.Desc.Options().(*descriptorpb.FieldOptions), E_BbsCustomType) + return customType.(string) +} + +func (bbsGenerateHelper) genGlobalEnum(g *protogen.GeneratedFile, eNuM *protogen.Enum) { + genEnumTypeWithValues(g, eNuM, nil) + genEnumValueMaps(g, eNuM) + genEnumStringFunc(g, eNuM) +} + +func (bbsGenerateHelper) genMessageEnums(g *protogen.GeneratedFile, msg *protogen.Message) { + for _, eNuM := range msg.Enums { + if *debug { + log.Printf("Nested Enum: %+v\n", eNuM) + } + + genEnumTypeWithValues(g, eNuM, msg) + genEnumValueMaps(g, eNuM) + genEnumStringFunc(g, eNuM) + } +} + +func genEnumTypeWithValues(g *protogen.GeneratedFile, eNuM *protogen.Enum, msg *protogen.Message) { + copysafeName, _ := getCopysafeName(g, eNuM.GoIdent) + g.P("type ", copysafeName, " int32") + g.P("const (") + for _, enumValue := range eNuM.Values { + if isEnumValueDeprecated(enumValue) { + g.P("// Deprecated: marked deprecated in proto file") + } + enumValueName := getEnumValueName(g, enumValue, msg) + actualValue := enumValue.Desc.Number() + + g.P(enumValueName, " ", copysafeName, "=", actualValue) + } + g.P(")") +} + +func genEnumValueMaps(g *protogen.GeneratedFile, eNuM *protogen.Enum) { + copysafeName, _ := getCopysafeName(g, eNuM.GoIdent) + g.P("// Enum value maps for ", copysafeName) + g.P("var (") + g.P(copysafeName, "_name = map[int32]string{") + for _, enumValue := range eNuM.Values { + enumValueName := enumValue.Desc.Name() + actualValue := enumValue.Desc.Number() + + g.P(actualValue, `: "`, enumValueName, `",`) + } + g.P("}") + g.P(copysafeName, "_value = map[string]int32{") + for _, enumValue := range eNuM.Values { + enumValueName := enumValue.Desc.Name() + actualValue := enumValue.Desc.Number() + + g.P(`"`, enumValueName, `": `, actualValue, `,`) + } + g.P("}") + g.P(")") +} + +func genEnumStringFunc(g *protogen.GeneratedFile, eNuM *protogen.Enum) { + copysafeName, _ := getCopysafeName(g, eNuM.GoIdent) + strconvItoa := protogen.GoIdent{GoName: "Itoa", GoImportPath: "strconv"} + g.P("func (m ", copysafeName, ") String() string {") + g.P("s, ok :=", copysafeName, "_name[int32(m)]") + g.P("if ok {") + g.P("return s") + g.P("}") + g.P("return ", g.QualifiedGoIdent(strconvItoa), "(int(m))") + g.P("}") +} + +func getEnumValueName(g *protogen.GeneratedFile, enumValue *protogen.EnumValue, msg *protogen.Message) string { + copysafeEnumValueName, _ := getCopysafeName(g, enumValue.GoIdent) + customName := proto.GetExtension(enumValue.Desc.Options().(*descriptorpb.EnumValueOptions), E_BbsEnumvalueCustomname) + + result := copysafeEnumValueName + if len(customName.(string)) > 0 { + if msg == nil { + result = customName.(string) + } else { + copysafeParentName, _ := getCopysafeName(g, msg.GoIdent) + result = copysafeParentName + "_" + customName.(string) + } + } + return result + +} + +func (bbsGenerateHelper) genToProtoMethod(g *protogen.GeneratedFile, msg *protogen.Message) { + unsafeName := getUnsafeName(g, msg.GoIdent) + if copysafeName, ok := getCopysafeName(g, msg.GoIdent); ok { + g.P("func(x *", copysafeName, ") ToProto() *", unsafeName, " {") + g.P("if x == nil {") + g.P("return nil") + g.P("}") + g.P() + g.P("proto := &", unsafeName, "{") + for _, field := range msg.Fields { + protoFieldName := field.GoName + if field.Message != nil { + fieldCopysafeName, _ := getCopysafeName(g, field.Message.GoIdent) + fieldCopysafeName = getFieldName(fieldCopysafeName) + if field.Desc.Cardinality() == protoreflect.Repeated { + if field.Desc.IsList() { + g.P(protoFieldName, ": ", fieldCopysafeName, "ToProtoSlice(x.", getFieldName(protoFieldName), "),") + } else if field.Desc.IsMap() { + mapValueKind := field.Desc.MapValue().Kind() + if mapValueKind == protoreflect.MessageKind { + g.P(protoFieldName, ": ", copysafeName, getFieldName(protoFieldName), "ToProtoMap(x.", protoFieldName, "),") + } else { + g.P(protoFieldName, ": ", "x.", protoFieldName, ",") + } + } else { + panic("Unrecognized Repeated field found") + } + } else { + g.P(protoFieldName, ": x.", getFieldName(protoFieldName), ".ToProto(),") + } + } else if field.Enum != nil { + g.P(protoFieldName, ": ", *prefix, getActualType(g, field), "(x.", protoFieldName, "),") + } else { + // we weren't using oneof correctly, so we're not going to support it + // if field.Oneof != nil { + // g.P(protoFieldName, ": &x.", protoFieldName, ",") + // } else { + g.P(protoFieldName, ": x.", protoFieldName, ",") + // } + } + } + g.P("}") + g.P("return proto") + g.P("}") + g.P() + } +} + +func (bbsGenerateHelper) genFromProtoMethod(g *protogen.GeneratedFile, msg *protogen.Message) { + unsafeName := getUnsafeName(g, msg.GoIdent) + if copysafeName, ok := getCopysafeName(g, msg.GoIdent); ok { + g.P("func(x *", unsafeName, ") FromProto() *", copysafeName, " {") + g.P("if x == nil {") + g.P("return nil") + g.P("}") + g.P() + g.P("copysafe := &", copysafeName, "{") + for _, field := range msg.Fields { + protoFieldName := field.GoName + if field.Message != nil { + fieldCopysafeName, _ := getCopysafeName(g, field.Message.GoIdent) + fieldCopysafeName = getFieldName(fieldCopysafeName) + if field.Desc.Cardinality() == protoreflect.Repeated { + if field.Desc.IsList() { + g.P(protoFieldName, ": ", fieldCopysafeName, "FromProtoSlice(x.", getFieldName(protoFieldName), "),") + } else if field.Desc.IsMap() { + mapValueKind := field.Desc.MapValue().Kind() + if mapValueKind == protoreflect.MessageKind { + g.P(protoFieldName, ": ", copysafeName, getFieldName(protoFieldName), "FromProtoMap(x.", protoFieldName, "),") + } else { + g.P(protoFieldName, ": ", "x.", protoFieldName, ",") + } + } else { + panic("Unrecognized Repeated field found") + } + } else { + // note the reversal of pointer logic here compared to other isByValueType checks + // FromProto() returns a pointer so we need to dereference that before calling FromProto() on a value type + pointer := "" + if isByValueType(field) { + pointer = "*" + } + g.P(protoFieldName, ": ", pointer, "x.", getFieldName(protoFieldName), ".FromProto(),") + } + } else if field.Enum != nil { + g.P(protoFieldName, ": ", getActualType(g, field), "(x.", protoFieldName, "),") + } else { + // we weren't using oneof correctly, so we're not going to support it + // if field.Oneof != nil { + // g.P(protoFieldName, ": &x.", protoFieldName, ",") + // } else { + g.P(protoFieldName, ": x.", protoFieldName, ",") + // } + } + } + g.P("}") + g.P("return copysafe") + g.P("}") + g.P() + } +} + +func (bbsGenerateHelper) genToProtoSliceMethod(g *protogen.GeneratedFile, msg *protogen.Message) { + unsafeName := getUnsafeName(g, msg.GoIdent) + if copysafeName, ok := getCopysafeName(g, msg.GoIdent); ok { + g.P("func ", copysafeName, "ToProtoSlice(values []*", copysafeName, ") []*", unsafeName, " {") + g.P("if values == nil {") + g.P("return nil") + g.P("}") + g.P("result := make([]*", unsafeName, ", len(values))") + g.P("for i, val := range values {") + g.P("result[i] = val.ToProto()") + g.P("}") + g.P("return result") + g.P("}") + g.P() + + for _, field := range msg.Fields { + if field.Desc.IsMap() { + mapValueKind := field.Desc.MapValue().Kind() + if mapValueKind == protoreflect.MessageKind { + valueField := field.Desc.MapValue().Message().FullName() + rawGoIdent := strings.Split(string(valueField), ".") + protoValueFieldType := rawGoIdent[1] + valueFieldType, _ := strings.CutPrefix(protoValueFieldType, *prefix) + mapValueType := "*" + valueFieldType + mapKeyType := field.Desc.MapKey().Kind().String() + fieldType := "map[" + mapKeyType + "]" + mapValueType + protoMapValueType := "*" + protoValueFieldType + protoFieldType := "map[" + mapKeyType + "]" + protoMapValueType + + g.P("func ", copysafeName, getFieldName(field.GoName), "ToProtoMap(values ", fieldType, ") ", protoFieldType, " {") + g.P("if values == nil {") + g.P("return nil") + g.P("}") + g.P("result := make(map[", mapKeyType, "]*", protoValueFieldType, ", len(values))") + g.P("for i, val := range values {") + g.P("result[i] = val.ToProto()") + g.P("}") + g.P("return result") + g.P("}") + g.P() + } + } + } + } +} + +func (bbsGenerateHelper) genFromProtoSliceMethod(g *protogen.GeneratedFile, msg *protogen.Message) { + unsafeName := getUnsafeName(g, msg.GoIdent) + if copysafeName, ok := getCopysafeName(g, msg.GoIdent); ok { + g.P("func ", copysafeName, "FromProtoSlice(values []*", unsafeName, ") []*", copysafeName, " {") + g.P("if values == nil {") + g.P("return nil") + g.P("}") + g.P("result := make([]*", copysafeName, ", len(values))") + g.P("for i, val := range values {") + g.P("result[i] = val.FromProto()") + g.P("}") + g.P("return result") + g.P("}") + g.P() + + for _, field := range msg.Fields { + if field.Desc.IsMap() { + mapValueKind := field.Desc.MapValue().Kind() + if mapValueKind == protoreflect.MessageKind { + valueField := field.Desc.MapValue().Message().FullName() + rawGoIdent := strings.Split(string(valueField), ".") + protoValueFieldType := rawGoIdent[1] + valueFieldType, _ := strings.CutPrefix(protoValueFieldType, *prefix) + mapValueType := "*" + valueFieldType + mapKeyType := field.Desc.MapKey().Kind().String() + fieldType := "map[" + mapKeyType + "]" + mapValueType + protoMapValueType := "*" + protoValueFieldType + protoFieldType := "map[" + mapKeyType + "]" + protoMapValueType + + g.P("func ", copysafeName, getFieldName(field.GoName), "FromProtoMap(values ", protoFieldType, ") ", fieldType, " {") + g.P("if values == nil {") + g.P("return nil") + g.P("}") + g.P("result := make(map[", mapKeyType, "]*", valueFieldType, ", len(values))") + g.P("for i, val := range values {") + g.P("result[i] = val.FromProto()") + g.P("}") + g.P("return result") + g.P("}") + g.P() + } + } + } + } +} + +func generateFile(plugin *protogen.Plugin, file *protogen.File) *protogen.GeneratedFile { + filename := file.GeneratedFilenamePrefix + "_bbs.pb.go" + g := plugin.NewGeneratedFile(filename, file.GoImportPath) + g.P("// Code generated by protoc-gen-go-bbs. DO NOT EDIT.") + g.P("// versions:") + g.P("// - protoc-gen-go-bbs v", version) // version from main.go + g.P("// - protoc ", protocVersion(plugin)) + + if file.Proto.GetOptions().GetDeprecated() { + g.P("// ", file.Desc.Path(), " is a deprecated file.") + } else { + g.P("// source: ", file.Desc.Path()) + } + g.P() + g.P("package ", file.GoPackageName) + g.P() + generateFileContent(file, g) + return g +} + +func generateRpcFile(plugin *protogen.Plugin, file *protogen.File) *protogen.GeneratedFile { + filename := file.GeneratedFilenamePrefix + "_bbs_grpc.pb.go" + g := plugin.NewGeneratedFile(filename, file.GoImportPath) + g.P("// Code generated by protoc-gen-go-bbs. DO NOT EDIT.") + g.P("// versions:") + g.P("// - protoc-gen-go-bbs v", version) // version from main.go + g.P("// - protoc-gen-go-grpc ", "TODO: get version") + g.P("// - protoc ", protocVersion(plugin)) + + if file.Proto.GetOptions().GetDeprecated() { + g.P("// ", file.Desc.Path(), " is a deprecated file.") + } else { + g.P("// source: ", file.Desc.Path()) + } + g.P() + g.P("package ", file.GoPackageName) + g.P() + generateRpcFileContent(file, g) + return g +} + +func protocVersion(plugin *protogen.Plugin) string { + v := plugin.Request.GetCompilerVersion() + if v == nil { + return "(unknown)" + } + var suffix string + if s := v.GetSuffix(); s != "" { + suffix = "-" + s + } + return fmt.Sprintf("v%d.%d.%d%s", v.GetMajor(), v.GetMinor(), v.GetPatch(), suffix) +} + +func generateFileEnums(file *protogen.File, g *protogen.GeneratedFile) { + for _, eNuM := range file.Enums { + if *debug { + log.Printf("New Enum Detected: %+v\n\n", eNuM) + } + + if slices.Contains(ignoredEnums, getUnsafeName(g, eNuM.GoIdent)) { + log.Printf("\tIgnoring enum %s", eNuM.Desc.Name()) + continue + } + + helper.genGlobalEnum(g, eNuM) + } +} + +func generateFileMessages(file *protogen.File, g *protogen.GeneratedFile) { + for _, msg := range file.Messages { + if *debug { + log.Printf("New Message Detected: %+v\n\n", msg) + } + + if slices.Contains(ignoredMessages, getUnsafeName(g, msg.GoIdent)) { + log.Printf("\tIgnoring message %s", msg.Desc.Name()) + continue + } + helper.genMessageEnums(g, msg) + helper.genCopysafeStruct(g, msg) + helper.genToProtoMethod(g, msg) + helper.genFromProtoMethod(g, msg) + helper.genToProtoSliceMethod(g, msg) + helper.genFromProtoSliceMethod(g, msg) + } +} + +var currentService Service + +func generateFileServices(file *protogen.File, g *protogen.GeneratedFile) { + for _, svc := range file.Services { + if *debug { + log.Printf("New Service Detected: %+v\n\n", svc) + } + + if slices.Contains(ignoredServices, svc.GoName) { + log.Printf("\tIgnoring service %s", svc.Desc.Name()) + continue + } + + if serviceName, ok := getCopysafeNameFromString(svc.Desc.Name()); ok { + sourceFilename := file.Desc.Path() + currentService = Service{Name: serviceName, Source: sourceFilename} + + genImports(g) + genClient(g, svc) + genServer(g, svc) + genServiceDesc(g, svc) + } + } +} + +var funcMap template.FuncMap = template.FuncMap{ + "LowerFirst": lowerFirst, +} + +func lowerFirst(s string) string { + if len(s) == 0 { + return s + } + + runes := []rune(s) + runes[0] = unicode.ToLower(runes[0]) + return string(runes) +} + +func genImports(g *protogen.GeneratedFile) { + importBuilder := new(strings.Builder) + importT, err := template.New("import").Funcs(funcMap).Parse(grpcImports) + if err != nil { + panic(err) + } + importT.Execute(importBuilder, nil) + g.P(importBuilder.String()) + +} + +func genClient(g *protogen.GeneratedFile, svc *protogen.Service) { + clientMethodNames := genMethodTemplate(svc, clientMethodName, false) + clientInterfaceMethods := genMethodTemplate(svc, clientInterfaceMethod, false) + clientMethods := genMethodTemplate(svc, clientMethod, false) + clientBuilder := new(strings.Builder) + + clientT, err := template.New("client").Funcs(funcMap).Parse(grpcClient) + if err != nil { + panic(err) + } + clientT.Execute(clientBuilder, + Client{ + Service: currentService, + ClientInterfaceMethods: clientInterfaceMethods, + ClientMethodNames: clientMethodNames, + ClientMethods: clientMethods, + }) + g.P(clientBuilder.String()) +} + +func genServer(g *protogen.GeneratedFile, svc *protogen.Service) { + unimplementedServerMethods := genMethodTemplate(svc, unimplementedServerMethod, false) + serverInterfaceMethods := genMethodTemplate(svc, serverInterfaceMethod, false) + serverHandlers := genMethodTemplate(svc, serverHandler, false) + + serverBuilder := new(strings.Builder) + serverT, err := template.New("server").Funcs(funcMap).Parse(grpcServer) + if err != nil { + panic(err) + } + + serverT.Execute(serverBuilder, + Server{ + Service: currentService, + ServerHandlers: serverHandlers, + ServerInterfaceMethods: serverInterfaceMethods, + UnimplementedServerMethods: unimplementedServerMethods, + }) + g.P(serverBuilder.String()) +} + +func genMethodTemplate(svc *protogen.Service, methodTemplate string, addComma bool) string { + builder := new(strings.Builder) + methodT, err := template.New("method-template").Funcs(funcMap).Parse(methodTemplate) + if err != nil { + panic(err) + } + + for i, method := range svc.Methods { + methodName, _ := getCopysafeNameFromString(method.Desc.Name()) + methodT.Execute(builder, + Method{ + Service: currentService, + MethodName: methodName, + }) + if addComma { + if i < len(svc.Methods)-1 { + builder.WriteRune(',') + } + } + } + return builder.String() +} + +type Service struct { + Name string + Source string +} + +type Client struct { + ClientInterfaceMethods string + ClientMethodNames string + ClientMethods string + Service Service +} + +type Server struct { + ServerInterfaceMethods string + ServerHandlers string + Service Service + UnimplementedServerMethods string +} + +type ServiceDescData struct { + Methods string + Service Service +} + +type Method struct { + MethodName string + Service Service +} + +func genServiceDesc(g *protogen.GeneratedFile, svc *protogen.Service) { + methodsBuilder := new(strings.Builder) + methodsBuilder.WriteString("Methods: []grpc.MethodDesc{") + serviceDescMethods := genMethodTemplate(svc, grpcMethodDesc, true) + methodsBuilder.WriteString(serviceDescMethods) + methodsBuilder.WriteString("}") + methods := methodsBuilder.String() + + serviceDescBuilder := new(strings.Builder) + serviceDescT, err := template.New("serviceDesc").Parse(grpcServiceDescription) + if err != nil { + panic(err) + } + serviceDescT.Execute(serviceDescBuilder, + ServiceDescData{ + Service: currentService, + Methods: methods, + }) + g.P(serviceDescBuilder.String()) +} + +func generateFileContent(file *protogen.File, g *protogen.GeneratedFile) { + generateFileEnums(file, g) + generateFileMessages(file, g) +} + +func generateRpcFileContent(file *protogen.File, g *protogen.GeneratedFile) { + generateFileServices(file, g) +} diff --git a/protoc-gen-go-bbs/bbs.pb.go b/protoc-gen-go-bbs/bbs.pb.go new file mode 100644 index 00000000..92f80438 --- /dev/null +++ b/protoc-gen-go-bbs/bbs.pb.go @@ -0,0 +1,148 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v6.31.1 +// source: bbs.proto + +package main + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var file_bbs_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 1000, + Name: "bbs.bbs_json_always_emit", + Tag: "varint,1000,opt,name=bbs_json_always_emit", + Filename: "bbs.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 1010, + Name: "bbs.bbs_by_value", + Tag: "varint,1010,opt,name=bbs_by_value", + Filename: "bbs.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 1020, + Name: "bbs.bbs_exclude_from_equal", + Tag: "varint,1020,opt,name=bbs_exclude_from_equal", + Filename: "bbs.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 1030, + Name: "bbs.bbs_custom_type", + Tag: "bytes,1030,opt,name=bbs_custom_type", + Filename: "bbs.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 1040, + Name: "bbs.bbs_default_value", + Tag: "bytes,1040,opt,name=bbs_default_value", + Filename: "bbs.proto", + }, + { + ExtendedType: (*descriptorpb.EnumValueOptions)(nil), + ExtensionType: (*string)(nil), + Field: 2000, + Name: "bbs.bbs_enumvalue_customname", + Tag: "bytes,2000,opt,name=bbs_enumvalue_customname", + Filename: "bbs.proto", + }, +} + +// Extension fields to descriptorpb.FieldOptions. +var ( + // optional bool bbs_json_always_emit = 1000; + E_BbsJsonAlwaysEmit = &file_bbs_proto_extTypes[0] + // optional bool bbs_by_value = 1010; + E_BbsByValue = &file_bbs_proto_extTypes[1] + // optional bool bbs_exclude_from_equal = 1020; + E_BbsExcludeFromEqual = &file_bbs_proto_extTypes[2] + // optional string bbs_custom_type = 1030; + E_BbsCustomType = &file_bbs_proto_extTypes[3] + // optional string bbs_default_value = 1040; + E_BbsDefaultValue = &file_bbs_proto_extTypes[4] +) + +// Extension fields to descriptorpb.EnumValueOptions. +var ( + // optional string bbs_enumvalue_customname = 2000; + E_BbsEnumvalueCustomname = &file_bbs_proto_extTypes[5] +) + +var File_bbs_proto protoreflect.FileDescriptor + +const file_bbs_proto_rawDesc = "" + + "\n" + + "\tbbs.proto\x12\x03bbs\x1a google/protobuf/descriptor.proto:R\n" + + "\x14bbs_json_always_emit\x12\x1d.google.protobuf.FieldOptions\x18\xe8\a \x01(\bR\x11bbsJsonAlwaysEmit\x88\x01\x01:C\n" + + "\fbbs_by_value\x12\x1d.google.protobuf.FieldOptions\x18\xf2\a \x01(\bR\n" + + "bbsByValue\x88\x01\x01:V\n" + + "\x16bbs_exclude_from_equal\x12\x1d.google.protobuf.FieldOptions\x18\xfc\a \x01(\bR\x13bbsExcludeFromEqual\x88\x01\x01:I\n" + + "\x0fbbs_custom_type\x12\x1d.google.protobuf.FieldOptions\x18\x86\b \x01(\tR\rbbsCustomType\x88\x01\x01:M\n" + + "\x11bbs_default_value\x12\x1d.google.protobuf.FieldOptions\x18\x90\b \x01(\tR\x0fbbsDefaultValue\x88\x01\x01:_\n" + + "\x18bbs_enumvalue_customname\x12!.google.protobuf.EnumValueOptions\x18\xd0\x0f \x01(\tR\x16bbsEnumvalueCustomname\x88\x01\x01B\"Z code.cloudfoundry.org/bbs/modelsb\x06proto3" + +var file_bbs_proto_goTypes = []any{ + (*descriptorpb.FieldOptions)(nil), // 0: google.protobuf.FieldOptions + (*descriptorpb.EnumValueOptions)(nil), // 1: google.protobuf.EnumValueOptions +} +var file_bbs_proto_depIdxs = []int32{ + 0, // 0: bbs.bbs_json_always_emit:extendee -> google.protobuf.FieldOptions + 0, // 1: bbs.bbs_by_value:extendee -> google.protobuf.FieldOptions + 0, // 2: bbs.bbs_exclude_from_equal:extendee -> google.protobuf.FieldOptions + 0, // 3: bbs.bbs_custom_type:extendee -> google.protobuf.FieldOptions + 0, // 4: bbs.bbs_default_value:extendee -> google.protobuf.FieldOptions + 1, // 5: bbs.bbs_enumvalue_customname:extendee -> google.protobuf.EnumValueOptions + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 0, // [0:6] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_bbs_proto_init() } +func file_bbs_proto_init() { + if File_bbs_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_bbs_proto_rawDesc), len(file_bbs_proto_rawDesc)), + NumEnums: 0, + NumMessages: 0, + NumExtensions: 6, + NumServices: 0, + }, + GoTypes: file_bbs_proto_goTypes, + DependencyIndexes: file_bbs_proto_depIdxs, + ExtensionInfos: file_bbs_proto_extTypes, + }.Build() + File_bbs_proto = out.File + file_bbs_proto_goTypes = nil + file_bbs_proto_depIdxs = nil +} diff --git a/protoc-gen-go-bbs/bbs.proto b/protoc-gen-go-bbs/bbs.proto new file mode 100644 index 00000000..788d08c5 --- /dev/null +++ b/protoc-gen-go-bbs/bbs.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package bbs; +option go_package="code.cloudfoundry.org/bbs/models"; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.FieldOptions { + optional bool bbs_json_always_emit = 1000; + optional bool bbs_by_value = 1010; + optional bool bbs_exclude_from_equal = 1020; + optional string bbs_custom_type = 1030; + optional string bbs_default_value = 1040; +} + +extend google.protobuf.EnumValueOptions { + optional string bbs_enumvalue_customname = 2000; +} diff --git a/protoc-gen-go-bbs/main.go b/protoc-gen-go-bbs/main.go new file mode 100644 index 00000000..1b3724cd --- /dev/null +++ b/protoc-gen-go-bbs/main.go @@ -0,0 +1,52 @@ +package main + +import ( + "flag" + "fmt" + "log" + + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/types/pluginpb" +) + +const version = "0.0.1" + +var prefix *string +var debug *bool + +func main() { + showVersion := flag.Bool("version", false, "print the version and exit") + flag.Parse() + if *showVersion { + fmt.Printf("protoc-gen-go-bbs %v\n", version) + return + } + + var flags flag.FlagSet + prefix = flags.String("prefix", "Proto", "Prefix to strip from protobuf-generated structs") + debug = flags.Bool("debug", false, "Set to true to output codegen debugging lines") + + protogen.Options{ + ParamFunc: flags.Set, + }.Run(func(plugin *protogen.Plugin) error { + plugin.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) + + for _, file := range plugin.Files { + if file.GeneratedFilenamePrefix == "bbs" { + // ignore the bbs.proto file for our plugin always + file.Generate = false + } + if !file.Generate { + continue + } + log.Printf("Generating %s\n", file.Desc.Path()) + + generateFile(plugin, file) + if len(file.Services) > 0 { + generateRpcFile(plugin, file) + } + + } + return nil + }) +} diff --git a/protoc-gen-go-bbs/templates.go b/protoc-gen-go-bbs/templates.go new file mode 100644 index 00000000..ec883989 --- /dev/null +++ b/protoc-gen-go-bbs/templates.go @@ -0,0 +1,145 @@ +package main + +var grpcImports = ` +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 +` + +var clientMethodName = ` +{{.Service.Name}}_{{.MethodName}}_FullMethodName = "/models.{{.Service.Name}}/{{.MethodName}}"` + +var grpcClient = ` +const ( + {{.ClientMethodNames}} +) +// {{.Service.Name}}Client is the client API for {{.Service.Name}} service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type {{.Service.Name}}Client interface { + {{.ClientInterfaceMethods}} +} + +type {{.Service.Name | LowerFirst}}Client struct { + cc grpc.ClientConnInterface +} + +func New{{.Service.Name}}Client(cc grpc.ClientConnInterface) {{.Service.Name}}Client { + return &{{.Service.Name | LowerFirst}}Client{cc} +} + +{{.ClientMethods}} +` + +var clientInterfaceMethod = ` +{{.MethodName}}(ctx context.Context, in *{{.MethodName}}Request, opts ...grpc.CallOption) (*{{.MethodName}}Response, error)` + +var clientMethod = ` +func (c *{{.Service.Name | LowerFirst}}Client) {{.MethodName}}(ctx context.Context, in *{{.MethodName}}Request, opts ...grpc.CallOption) (*{{.MethodName}}Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Proto{{.MethodName}}Response) + protoIn := in.ToProto() + err := c.cc.Invoke(ctx, {{.Service.Name}}_{{.MethodName}}_FullMethodName, protoIn, out, cOpts...) + if err != nil { + return nil, err + } + return out.FromProto(), nil +} +` + +var grpcServer = ` +type {{.Service.Name}}Server interface { + {{.ServerInterfaceMethods}} + mustEmbedUnimplemented{{.Service.Name}}Server() +} + +// Unimplemented{{.Service.Name}}Server must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type Unimplemented{{.Service.Name}}Server struct {} + +{{.UnimplementedServerMethods}} +func (Unimplemented{{.Service.Name}}Server) mustEmbedUnimplemented{{.Service.Name}}Server() {} +func (Unimplemented{{.Service.Name}}Server) testEmbeddedByValue() {} + +// Unsafe{{.Service.Name}}Server may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to {{.Service.Name}}Server will +// result in compilation errors. +type Unsafe{{.Service.Name}}Server interface { + mustEmbedUnimplemented{{.Service.Name}}Server() +} + +func Register{{.Service.Name}}Server(s grpc.ServiceRegistrar, srv {{.Service.Name}}Server) { + // If the following call panics, it indicates Unimplemented{{.Service.Name}}Server was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&{{.Service.Name}}_ServiceDesc, srv) +} + +{{.ServerHandlers}} +` + +var unimplementedServerMethod = ` +func (Unimplemented{{.Service.Name}}Server) {{.MethodName}}(context.Context, *{{.MethodName}}Request) (*{{.MethodName}}Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method {{.MethodName}} not implemented") +}` + +var serverInterfaceMethod = ` +{{.MethodName}}(context.Context, *{{.MethodName}}Request) (*{{.MethodName}}Response, error)` + +var serverHandler = ` +func _{{.Service.Name}}_{{.MethodName}}_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + protoIn := new(Proto{{.MethodName}}Request) + if err := dec(protoIn); err != nil { + return nil, err + } + in := protoIn.FromProto() + + if interceptor == nil { + response, err := srv.({{.Service.Name}}Server).{{.MethodName}}(ctx, in) + return response.ToProto(), err + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: {{.Service.Name}}_{{.MethodName}}_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + response, err := srv.({{.Service.Name}}Server).{{.MethodName}}(ctx, req.(*{{.MethodName}}Request)) + return response.ToProto(), err + } + return interceptor(ctx, in, info, handler) +} +` + +var grpcServiceDescription = ` +// {{.Service.Name}}_ServiceDesc is the grpc.ServiceDesc for {{.Service.Name}} service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var {{.Service.Name}}_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "models.{{.Service.Name}}", + HandlerType: (*{{.Service.Name}}Server)(nil), + {{.Methods}}, + Streams: []grpc.StreamDesc{}, + Metadata: "{{.Service.Source}}", +} +` + +var grpcMethodDesc = ` +{ + MethodName: "{{.MethodName}}", + Handler: _{{.Service.Name}}_{{.MethodName}}_Handler, +}` diff --git a/scripts/generate_protos.sh b/scripts/generate_protos.sh index 5e0f7e07..c137de2f 100755 --- a/scripts/generate_protos.sh +++ b/scripts/generate_protos.sh @@ -1,5 +1,20 @@ +#! /bin/bash set -e DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -pushd "$DIR/../models" -protoc --proto_path=../../vendor:../../vendor/github.com/golang/protobuf/ptypes/duration/:. --gogoslick_out=plugins=grpc:. *.proto -popd +# regenerate protos for protoc plugin +pushd "${DIR}/../protoc-gen-go-bbs" > /dev/null + protoc --proto_path=. --go_out=. --go_opt=paths=source_relative ./*.proto + # we need the custom bbs code from the plugin because of references made by some of the model protos + cp ./bbs.pb.go "${DIR}/../models/" + + # we also need to change the package after it's been copied away + sed -i 's/package models/package main/g' ./bbs.pb.go +popd > /dev/null + +# regenerate protos for models +pushd "${DIR}/../models" > /dev/null + protoc --proto_path=.:../protoc-gen-go-bbs \ + --go_out=. --go_opt=paths=source_relative \ + --go-bbs_out=. --go-bbs_opt=paths=source_relative \ + ./*.proto +popd > /dev/null diff --git a/taskworkpool/taskcallback.go b/taskworkpool/taskcallback.go index c63fbeb9..e0fd9157 100644 --- a/taskworkpool/taskcallback.go +++ b/taskworkpool/taskcallback.go @@ -89,7 +89,7 @@ func (twp *TaskCompletionWorkPool) Submit(taskDB db.TaskDB, taskHub events.Hub, func HandleCompletedTask(logger lager.Logger, httpClient *http.Client, taskDB db.TaskDB, taskHub events.Hub, task *models.Task) { logger = logger.Session("handle-completed-task", lager.Data{"task_guid": task.TaskGuid}) - if task.CompletionCallbackUrl != "" { + if task.TaskDefinition.CompletionCallbackUrl != "" { before, after, modelErr := taskDB.ResolvingTask(context.Background(), logger, task.TaskGuid) if modelErr != nil { logger.Error("marking-task-as-resolving-failed", modelErr) @@ -97,14 +97,14 @@ func HandleCompletedTask(logger lager.Logger, httpClient *http.Client, taskDB db } go taskHub.Emit(models.NewTaskChangedEvent(before, after)) - logger = logger.WithData(lager.Data{"callback_url": task.CompletionCallbackUrl}) + logger = logger.WithData(lager.Data{"callback_url": task.TaskDefinition.CompletionCallbackUrl}) json, err := json.Marshal(&models.TaskCallbackResponse{ TaskGuid: task.TaskGuid, Failed: task.Failed, FailureReason: task.FailureReason, Result: task.Result, - Annotation: task.Annotation, + Annotation: task.TaskDefinition.Annotation, CreatedAt: task.CreatedAt, }) if err != nil { @@ -116,7 +116,7 @@ func HandleCompletedTask(logger lager.Logger, httpClient *http.Client, taskDB db retriableErrRegexp := regexp.MustCompile("Client.Timeout|use of closed network connection") for i := 0; i < MAX_CB_RETRIES; i++ { - request, err := http.NewRequest("POST", task.CompletionCallbackUrl, bytes.NewReader(json)) + request, err := http.NewRequest("POST", task.TaskDefinition.CompletionCallbackUrl, bytes.NewReader(json)) if err != nil { logger.Error("building-request-failed", err) return diff --git a/taskworkpool/taskcallback_test.go b/taskworkpool/taskcallback_test.go index 0287ad27..83aa779d 100644 --- a/taskworkpool/taskcallback_test.go +++ b/taskworkpool/taskcallback_test.go @@ -83,7 +83,7 @@ var _ = Describe("TaskWorker", func() { simulateTaskCompleting := func(signals <-chan os.Signal, ready chan<- struct{}) error { close(ready) task = model_helpers.NewValidTask("the-task-guid") - task.CompletionCallbackUrl = callbackURL + task.TaskDefinition.CompletionCallbackUrl = callbackURL taskworkpool.HandleCompletedTask(logger, httpClient, taskDB, taskHub, task) return nil }