|
| 1 | +// Code generated by protoc-gen-struct-transformer, version: v0.0.1. DO NOT EDIT. |
| 2 | +// source file: product.proto |
| 3 | +// source package: pb |
| 4 | + |
| 5 | +package product |
| 6 | +func PbToProductPtr(src *pb1.Product, opts ...TransformParam) *repo1.Product { |
| 7 | + if src == nil { |
| 8 | + return nil |
| 9 | + } |
| 10 | + |
| 11 | + d := PbToProduct(*src, opts...) |
| 12 | + return &d |
| 13 | +} |
| 14 | + |
| 15 | +func PbToProductPtrList(src []*pb1.Product, opts ...TransformParam) []*repo1.Product { |
| 16 | + resp := make([]*repo1.Product, len(src)) |
| 17 | + |
| 18 | + for i, s := range src { |
| 19 | + resp[i] = PbToProductPtr(s, opts...) |
| 20 | + } |
| 21 | + |
| 22 | + return resp |
| 23 | +} |
| 24 | + |
| 25 | +func PbToProductPtrVal(src *pb1.Product, opts ...TransformParam) repo1.Product { |
| 26 | + if src == nil { |
| 27 | + return repo1.Product{} |
| 28 | + } |
| 29 | + |
| 30 | + return PbToProduct(*src, opts...) |
| 31 | +} |
| 32 | + |
| 33 | +func PbToProductPtrValList(src []*pb1.Product, opts ...TransformParam) []repo1.Product { |
| 34 | + resp := make([]repo1.Product, len(src)) |
| 35 | + |
| 36 | + for i, s := range src { |
| 37 | + resp[i] = PbToProduct(*s) |
| 38 | + } |
| 39 | + |
| 40 | + return resp |
| 41 | +} |
| 42 | + |
| 43 | +// PbToProductList is DEPRECATED. Use PbToProductPtrValList instead. |
| 44 | +func PbToProductList(src []*pb1.Product, opts ...TransformParam) []repo1.Product { |
| 45 | + return PbToProductPtrValList(src) |
| 46 | +} |
| 47 | + |
| 48 | +func PbToProduct(src pb1.Product, opts ...TransformParam) repo1.Product { |
| 49 | + s := repo1.Product{ |
| 50 | + ID: int(src.Id ), |
| 51 | + } |
| 52 | + |
| 53 | + applyOptions(opts...) |
| 54 | + |
| 55 | + |
| 56 | + return s |
| 57 | +} |
| 58 | + |
| 59 | +func PbToProductValPtr(src pb1.Product, opts ...TransformParam) *repo1.Product { |
| 60 | + d := PbToProduct(src, opts...) |
| 61 | + return &d |
| 62 | +} |
| 63 | + |
| 64 | +func PbToProductValList(src []pb1.Product, opts ...TransformParam) []repo1.Product { |
| 65 | + resp := make([]repo1.Product, len(src)) |
| 66 | + |
| 67 | + for i, s := range src { |
| 68 | + resp[i] = PbToProduct(s, opts...) |
| 69 | + } |
| 70 | + |
| 71 | + return resp |
| 72 | +} |
| 73 | + |
| 74 | +func ProductToPbPtr(src *repo1.Product, opts ...TransformParam) *pb1.Product { |
| 75 | + if src == nil { |
| 76 | + return nil |
| 77 | + } |
| 78 | + |
| 79 | + d := ProductToPb(*src, opts...) |
| 80 | + return &d |
| 81 | +} |
| 82 | + |
| 83 | +func ProductToPbPtrList(src []*repo1.Product, opts ...TransformParam) []*pb1.Product { |
| 84 | + resp := make([]*pb1.Product, len(src)) |
| 85 | + |
| 86 | + for i, s := range src { |
| 87 | + resp[i] = ProductToPbPtr(s, opts...) |
| 88 | + } |
| 89 | + |
| 90 | + return resp |
| 91 | +} |
| 92 | + |
| 93 | +func ProductToPbPtrVal(src *repo1.Product, opts ...TransformParam) pb1.Product { |
| 94 | + if src == nil { |
| 95 | + return pb1.Product{} |
| 96 | + } |
| 97 | + |
| 98 | + return ProductToPb(*src, opts...) |
| 99 | +} |
| 100 | + |
| 101 | +func ProductToPbValPtrList(src []repo1.Product, opts ...TransformParam) []*pb1.Product { |
| 102 | + resp := make([]*pb1.Product, len(src)) |
| 103 | + |
| 104 | + for i, s := range src { |
| 105 | + g := ProductToPb(s, opts...) |
| 106 | + resp[i] = &g |
| 107 | + } |
| 108 | + |
| 109 | + return resp |
| 110 | +} |
| 111 | + |
| 112 | +// ProductToPbList is DEPRECATED. Use ProductToPbValPtrList instead. |
| 113 | +func ProductToPbList(src []repo1.Product, opts ...TransformParam) []*pb1.Product { |
| 114 | + return ProductToPbValPtrList(src) |
| 115 | +} |
| 116 | + |
| 117 | +func ProductToPb(src repo1.Product, opts ...TransformParam) pb1.Product { |
| 118 | + s := pb1.Product{ |
| 119 | + Id: int64(src.ID ), |
| 120 | + } |
| 121 | + |
| 122 | + applyOptions(opts...) |
| 123 | + |
| 124 | + |
| 125 | + return s |
| 126 | +} |
| 127 | + |
| 128 | +func ProductToPbValPtr(src repo1.Product, opts ...TransformParam) *pb1.Product { |
| 129 | + d := ProductToPb(src, opts...) |
| 130 | + return &d |
| 131 | +} |
| 132 | + |
| 133 | +func ProductToPbValList(src []repo1.Product, opts ...TransformParam) []pb1.Product { |
| 134 | + resp := make([]pb1.Product, len(src)) |
| 135 | + |
| 136 | + for i, s := range src { |
| 137 | + resp[i] = ProductToPb(s, opts...) |
| 138 | + } |
| 139 | + |
| 140 | + return resp |
| 141 | +} |
| 142 | + |
0 commit comments