MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / bizGroupToPb

Function bizGroupToPb

app/controlplane/internal/service/group.go:638–653  ·  view source on GitHub ↗

bizGroupToPb converts a biz.Group to a pb.Group protobuf message.

(gr *biz.Group)

Source from the content-addressed store, hash-verified

636
637// bizGroupToPb converts a biz.Group to a pb.Group protobuf message.
638func bizGroupToPb(gr *biz.Group) *pb.Group {
639 base := &pb.Group{
640 Id: gr.ID.String(),
641 Name: gr.Name,
642 Description: gr.Description,
643 MemberCount: int32(gr.MemberCount),
644 CreatedAt: timestamppb.New(*gr.CreatedAt),
645 UpdatedAt: timestamppb.New(*gr.UpdatedAt),
646 }
647
648 if gr.Organization != nil {
649 base.OrganizationId = gr.Organization.ID
650 }
651
652 return base
653}
654
655// bizGroupMemberToPb converts a biz.GroupMembership to a pb.GroupMember protobuf message.
656func bizGroupMemberToPb(m *biz.GroupMembership) *pb.GroupMember {

Callers 5

bizProjectMembershipToPbFunction · 0.85
CreateMethod · 0.85
GetMethod · 0.85
ListMethod · 0.85
UpdateMethod · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected