github.com/blend/go-sdk@v1.20220411.3/ref/ref.go (about) 1 /* 2 3 Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved 4 Use of this source code is governed by a MIT license that can be found in the LICENSE file. 5 6 */ 7 8 package ref 9 10 import "time" 11 12 // String returns a reference. 13 func String(v string) *string { 14 return &v 15 } 16 17 // Strings returns a reference. 18 func Strings(values ...string) []*string { 19 output := make([]*string, len(values)) 20 for index := range values { 21 output[index] = &values[index] 22 } 23 return output 24 } 25 26 // Bool returns a reference. 27 func Bool(v bool) *bool { 28 return &v 29 } 30 31 // Byte returns a reference. 32 func Byte(v byte) *byte { 33 return &v 34 } 35 36 // Rune returns a reference. 37 func Rune(v rune) *rune { 38 return &v 39 } 40 41 // Uint8 returns a reference. 42 func Uint8(v uint8) *uint8 { 43 return &v 44 } 45 46 // Uint16 returns a reference. 47 func Uint16(v uint16) *uint16 { 48 return &v 49 } 50 51 // Uint32 returns a reference. 52 func Uint32(v uint32) *uint32 { 53 return &v 54 } 55 56 // Uint64 returns a reference. 57 func Uint64(v uint64) *uint64 { 58 return &v 59 } 60 61 // Int8 returns a reference. 62 func Int8(v int8) *int8 { 63 return &v 64 } 65 66 // Int16 returns a reference. 67 func Int16(v int16) *int16 { 68 return &v 69 } 70 71 // Int32 returns a reference. 72 func Int32(v int32) *int32 { 73 return &v 74 } 75 76 // Int64 returns a reference. 77 func Int64(v int64) *int64 { 78 return &v 79 } 80 81 // Int returns a reference. 82 func Int(v int) *int { 83 return &v 84 } 85 86 // Float32 returns a reference. 87 func Float32(v float32) *float32 { 88 return &v 89 } 90 91 // Float64 returns a reference. 92 func Float64(v float64) *float64 { 93 return &v 94 } 95 96 // Time returns a reference. 97 func Time(v time.Time) *time.Time { 98 return &v 99 } 100 101 // Duration returns a reference. 102 func Duration(v time.Duration) *time.Duration { 103 return &v 104 }