_id
stringlengths
2
7
title
stringlengths
1
118
partition
stringclasses
3 values
text
stringlengths
52
85.5k
language
stringclasses
1 value
meta_information
dict
q171600
GetProject
validation
func (c *Client) GetProject(account, repo string) (*Project, error) { projects, err := c.ListProjects() if err != nil { return nil, err } for _, project := range projects { if account == project.Username && repo == project.Reponame { return project, nil } } return nil, nil }
go
{ "resource": "" }
q171601
ListRecentBuilds
validation
func (c *Client) ListRecentBuilds(limit, offset int) ([]*Build, error) { return c.recentBuilds("recent-builds", nil, limit, offset) }
go
{ "resource": "" }
q171602
ListRecentBuildsForProject
validation
func (c *Client) ListRecentBuildsForProject(account, repo, branch, status string, limit, offset int) ([]*Build, error) { path := fmt.Sprintf("project/%s/%s", account, repo) if branch != "" { path = fmt.Sprintf("%s/tree/%s", path, branch) } params := url.Values{} if status != "" { params.Set("filter", status) ...
go
{ "resource": "" }
q171603
ListBuildArtifacts
validation
func (c *Client) ListBuildArtifacts(account, repo string, buildNum int) ([]*Artifact, error) { artifacts := []*Artifact{} err := c.request("GET", fmt.Sprintf("project/%s/%s/%d/artifacts", account, repo, buildNum), &artifacts, nil, nil) if err != nil { return nil, err } return artifacts, nil }
go
{ "resource": "" }
q171604
AddSSHUser
validation
func (c *Client) AddSSHUser(account, repo string, buildNum int) (*Build, error) { build := &Build{} err := c.request("POST", fmt.Sprintf("project/%s/%s/%d/ssh-users", account, repo, buildNum), build, nil, nil) if err != nil { return nil, err } return build, nil }
go
{ "resource": "" }
q171605
Build
validation
func (c *Client) Build(account, repo, branch string) (*Build, error) { return c.BuildOpts(account, repo, branch, nil) }
go
{ "resource": "" }
q171606
ParameterizedBuild
validation
func (c *Client) ParameterizedBuild(account, repo, branch string, buildParameters map[string]string) (*Build, error) { opts := map[string]interface{}{"build_parameters": buildParameters} return c.BuildOpts(account, repo, branch, opts) }
go
{ "resource": "" }
q171607
BuildOpts
validation
func (c *Client) BuildOpts(account, repo, branch string, opts map[string]interface{}) (*Build, error) { build := &Build{} err := c.request("POST", fmt.Sprintf("project/%s/%s/tree/%s", account, repo, branch), build, nil, opts) if err != nil { return nil, err } return build, nil }
go
{ "resource": "" }
q171608
ClearCache
validation
func (c *Client) ClearCache(account, repo string) (string, error) { status := &struct { Status string `json:"status"` }{} err := c.request("DELETE", fmt.Sprintf("project/%s/%s/build-cache", account, repo), status, nil, nil) if err != nil { return "", err } return status.Status, nil }
go
{ "resource": "" }
q171609
DeleteEnvVar
validation
func (c *Client) DeleteEnvVar(account, repo, name string) error { return c.request("DELETE", fmt.Sprintf("project/%s/%s/envvar/%s", account, repo, name), nil, nil, nil) }
go
{ "resource": "" }
q171610
AddSSHKey
validation
func (c *Client) AddSSHKey(account, repo, hostname, privateKey string) error { key := &struct { Hostname string `json:"hostname"` PrivateKey string `json:"private_key"` }{hostname, privateKey} return c.request("POST", fmt.Sprintf("project/%s/%s/ssh-key", account, repo), nil, nil, key) }
go
{ "resource": "" }
q171611
GetActionOutputs
validation
func (c *Client) GetActionOutputs(a *Action) ([]*Output, error) { if !a.HasOutput || a.OutputURL == "" { return nil, nil } req, err := http.NewRequest("GET", a.OutputURL, nil) if err != nil { return nil, err } c.debugRequest(req) resp, err := c.client().Do(req) if err != nil { return nil, err } defer...
go
{ "resource": "" }
q171612
ListCheckoutKeys
validation
func (c *Client) ListCheckoutKeys(account, repo string) ([]*CheckoutKey, error) { checkoutKeys := []*CheckoutKey{} err := c.request("GET", fmt.Sprintf("project/%s/%s/checkout-key", account, repo), &checkoutKeys, nil, nil) if err != nil { return nil, err } return checkoutKeys, nil }
go
{ "resource": "" }
q171613
CreateCheckoutKey
validation
func (c *Client) CreateCheckoutKey(account, repo, keyType string) (*CheckoutKey, error) { checkoutKey := &CheckoutKey{} body := struct { KeyType string `json:"type"` }{KeyType: keyType} err := c.request("POST", fmt.Sprintf("project/%s/%s/checkout-key", account, repo), checkoutKey, nil, body) if err != nil { ...
go
{ "resource": "" }
q171614
GetCheckoutKey
validation
func (c *Client) GetCheckoutKey(account, repo, fingerprint string) (*CheckoutKey, error) { checkoutKey := &CheckoutKey{} err := c.request("GET", fmt.Sprintf("project/%s/%s/checkout-key/%s", account, repo, fingerprint), &checkoutKey, nil, nil) if err != nil { return nil, err } return checkoutKey, nil }
go
{ "resource": "" }
q171615
DeleteCheckoutKey
validation
func (c *Client) DeleteCheckoutKey(account, repo, fingerprint string) error { return c.request("DELETE", fmt.Sprintf("project/%s/%s/checkout-key/%s", account, repo, fingerprint), nil, nil, nil) }
go
{ "resource": "" }
q171616
New
validation
func New(opts ...Option) (*Client, error) { // The default configuration. conf := &config{ Client: clientConfig{ Rate: 1, }, Conn: connConfig{ Addr: ":8125", FlushPeriod: 100 * time.Millisecond, // Worst-case scenario: // Ethernet MTU - IPv6 Header - TCP Header = 1500 - 40 - 20 = 1440 M...
go
{ "resource": "" }
q171617
Clone
validation
func (c *Client) Clone(opts ...Option) *Client { tf := c.conn.tagFormat conf := &config{ Client: clientConfig{ Rate: c.rate, Prefix: c.prefix, Tags: splitTags(tf, c.tags), }, } for _, o := range opts { o(conf) } clone := &Client{ conn: c.conn, muted: c.muted || conf.Client.Muted, rate...
go
{ "resource": "" }
q171618
Count
validation
func (c *Client) Count(bucket string, n interface{}) { if c.skip() { return } c.conn.metric(c.prefix, bucket, n, "c", c.rate, c.tags) }
go
{ "resource": "" }
q171619
Gauge
validation
func (c *Client) Gauge(bucket string, value interface{}) { if c.skip() { return } c.conn.gauge(c.prefix, bucket, value, c.tags) }
go
{ "resource": "" }
q171620
Timing
validation
func (c *Client) Timing(bucket string, value interface{}) { if c.skip() { return } c.conn.metric(c.prefix, bucket, value, "ms", c.rate, c.tags) }
go
{ "resource": "" }
q171621
Send
validation
func (t Timing) Send(bucket string) { t.c.Timing(bucket, int(t.Duration()/time.Millisecond)) }
go
{ "resource": "" }
q171622
Unique
validation
func (c *Client) Unique(bucket string, value string) { if c.skip() { return } c.conn.unique(c.prefix, bucket, value, c.tags) }
go
{ "resource": "" }
q171623
Flush
validation
func (c *Client) Flush() { if c.muted { return } c.conn.mu.Lock() c.conn.flush(0) c.conn.mu.Unlock() }
go
{ "resource": "" }
q171624
Close
validation
func (c *Client) Close() { if c.muted { return } c.conn.mu.Lock() c.conn.flush(0) c.conn.handleError(c.conn.w.Close()) c.conn.closed = true c.conn.mu.Unlock() }
go
{ "resource": "" }
q171625
SampleRate
validation
func SampleRate(rate float32) Option { return Option(func(c *config) { c.Client.Rate = rate }) }
go
{ "resource": "" }
q171626
Prefix
validation
func Prefix(p string) Option { return Option(func(c *config) { c.Client.Prefix += strings.TrimSuffix(p, ".") + "." }) }
go
{ "resource": "" }
q171627
TagsFormat
validation
func TagsFormat(tf TagFormat) Option { return Option(func(c *config) { c.Conn.TagFormat = tf }) }
go
{ "resource": "" }
q171628
Tags
validation
func Tags(tags ...string) Option { if len(tags)%2 != 0 { panic("statsd: Tags only accepts an even number of arguments") } return Option(func(c *config) { if len(tags) == 0 { return } newTags := make([]tag, len(tags)/2) for i := 0; i < len(tags)/2; i++ { newTags[i] = tag{K: tags[2*i], V: tags[2*i+1]...
go
{ "resource": "" }
q171629
flush
validation
func (c *conn) flush(n int) { if len(c.buf) == 0 { return } if n == 0 { n = len(c.buf) } // Trim the last \n, StatsD does not like it. _, err := c.w.Write(c.buf[:n-1]) c.handleError(err) if n < len(c.buf) { copy(c.buf, c.buf[n:]) } c.buf = c.buf[:len(c.buf)-n] }
go
{ "resource": "" }
q171630
BuildQwerty
validation
func BuildQwerty() Graph { data, err := data.Asset("data/Qwerty.json") if err != nil { panic("Can't find asset") } return getAdjancencyGraphFromFile(data, "qwerty") }
go
{ "resource": "" }
q171631
BuildDvorak
validation
func BuildDvorak() Graph { data, err := data.Asset("data/Dvorak.json") if err != nil { panic("Can't find asset") } return getAdjancencyGraphFromFile(data, "dvorak") }
go
{ "resource": "" }
q171632
BuildKeypad
validation
func BuildKeypad() Graph { data, err := data.Asset("data/Keypad.json") if err != nil { panic("Can't find asset") } return getAdjancencyGraphFromFile(data, "keypad") }
go
{ "resource": "" }
q171633
BuildMacKeypad
validation
func BuildMacKeypad() Graph { data, err := data.Asset("data/MacKeypad.json") if err != nil { panic("Can't find asset") } return getAdjancencyGraphFromFile(data, "mac_keypad") }
go
{ "resource": "" }
q171634
BuildLeet
validation
func BuildLeet() Graph { data, err := data.Asset("data/L33t.json") if err != nil { panic("Can't find asset") } return getAdjancencyGraphFromFile(data, "keypad") }
go
{ "resource": "" }
q171635
DictionaryEntropy
validation
func DictionaryEntropy(match match.Match, rank float64) float64 { baseEntropy := math.Log2(rank) upperCaseEntropy := extraUpperCaseEntropy(match) //TODO: L33t return baseEntropy + upperCaseEntropy }
go
{ "resource": "" }
q171636
SpatialEntropy
validation
func SpatialEntropy(match match.Match, turns int, shiftCount int) float64 { var s, d float64 if match.DictionaryName == "qwerty" || match.DictionaryName == "dvorak" { //todo: verify qwerty and dvorak have the same length and degree s = float64(len(adjacency.BuildQwerty().Graph)) d = adjacency.BuildQwerty().Calc...
go
{ "resource": "" }
q171637
RepeatEntropy
validation
func RepeatEntropy(match match.Match) float64 { cardinality := CalcBruteForceCardinality(match.Token) entropy := math.Log2(cardinality * float64(len(match.Token))) return entropy }
go
{ "resource": "" }
q171638
SequenceEntropy
validation
func SequenceEntropy(match match.Match, dictionaryLength int, ascending bool) float64 { firstChar := match.Token[0] baseEntropy := float64(0) if string(firstChar) == "a" || string(firstChar) == "1" { baseEntropy = float64(0) } else { baseEntropy = math.Log2(float64(dictionaryLength)) //TODO: should this be ju...
go
{ "resource": "" }
q171639
ExtraLeetEntropy
validation
func ExtraLeetEntropy(match match.Match, password string) float64 { var subsitutions float64 var unsub float64 subPassword := password[match.I:match.J] for index, char := range subPassword { if string(char) != string(match.Token[index]) { subsitutions++ } else { //TODO: Make this only true for 1337 chars ...
go
{ "resource": "" }
q171640
DateEntropy
validation
func DateEntropy(dateMatch match.DateMatch) float64 { var entropy float64 if dateMatch.Year < 100 { entropy = math.Log2(numDays * numMonths * 100) } else { entropy = math.Log2(numDays * numMonths * numYears) } if dateMatch.Separator != "" { entropy += 2 //add two bits for separator selection [/,-,.,etc] } ...
go
{ "resource": "" }
q171641
Omnimatch
validation
func Omnimatch(password string, userInputs []string, filters ...func(match.Matcher) bool) (matches []match.Match) { //Can I run into the issue where nil is not equal to nil? if dictionaryMatchers == nil || adjacencyGraphs == nil { loadFrequencyList() } if userInputs != nil { userInputMatcher := buildDictMatch...
go
{ "resource": "" }
q171642
Null
validation
func Null(in []byte, pos int) (int, error) { switch in[pos] { case 'n': return expect(in, pos, n...) return pos + 4, nil default: return 0, errUnexpectedValue } }
go
{ "resource": "" }
q171643
Number
validation
func Number(in []byte, pos int) (int, error) { pos, err := skipSpace(in, pos) if err != nil { return 0, err } max := len(in) for { v := in[pos] switch v { case '-', '+', '.', 'e', 'E', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0': pos++ default: return pos, nil } if pos >= max { return...
go
{ "resource": "" }
q171644
Array
validation
func Array(in []byte, pos int) (int, error) { pos, err := skipSpace(in, pos) if err != nil { return 0, err } if v := in[pos]; v != '[' { return 0, newError(pos, v) } pos++ // clean initial spaces pos, err = skipSpace(in, pos) if err != nil { return 0, err } if in[pos] == ']' { return pos + 1, nil ...
go
{ "resource": "" }
q171645
FindRange
validation
func FindRange(in []byte, pos, from, to int) ([]byte, error) { if to < from { return nil, errToLessThanFrom } pos, err := skipSpace(in, pos) if err != nil { return nil, err } if v := in[pos]; v != '[' { return nil, newError(pos, v) } pos++ idx := 0 itemStart := pos for { pos, err = skipSpace(in, ...
go
{ "resource": "" }
q171646
Object
validation
func Object(in []byte, pos int) (int, error) { pos, err := skipSpace(in, pos) if err != nil { return 0, err } if v := in[pos]; v != '{' { return 0, newError(pos, v) } pos++ // clean initial spaces pos, err = skipSpace(in, pos) if err != nil { return 0, err } if in[pos] == '}' { return pos + 1, nil...
go
{ "resource": "" }
q171647
FindKey
validation
func FindKey(in []byte, pos int, k []byte) ([]byte, error) { pos, err := skipSpace(in, pos) if err != nil { return nil, err } if v := in[pos]; v != '{' { return nil, newError(pos, v) } pos++ for { pos, err = skipSpace(in, pos) if err != nil { return nil, err } keyStart := pos // key pos, er...
go
{ "resource": "" }
q171648
FindIndex
validation
func FindIndex(in []byte, pos, index int) ([]byte, error) { pos, err := skipSpace(in, pos) if err != nil { return nil, err } if v := in[pos]; v != '[' { return nil, newError(pos, v) } pos++ idx := 0 for { pos, err = skipSpace(in, pos) if err != nil { return nil, err } itemStart := pos // dat...
go
{ "resource": "" }
q171649
Dot
validation
func Dot(key string) OpFunc { key = strings.TrimSpace(key) if key == "" { return func(in []byte) ([]byte, error) { return in, nil } } k := []byte(key) return func(in []byte) ([]byte, error) { return scanner.FindKey(in, 0, k) } }
go
{ "resource": "" }
q171650
Chain
validation
func Chain(filters ...Op) OpFunc { return func(in []byte) ([]byte, error) { if filters == nil { return in, nil } var err error data := in for _, filter := range filters { data, err = filter.Apply(data) if err != nil { return nil, err } } return data, nil } }
go
{ "resource": "" }
q171651
Index
validation
func Index(index int) OpFunc { return func(in []byte) ([]byte, error) { return scanner.FindIndex(in, 0, index) } }
go
{ "resource": "" }
q171652
Range
validation
func Range(from, to int) OpFunc { return func(in []byte) ([]byte, error) { return scanner.FindRange(in, 0, from, to) } }
go
{ "resource": "" }
q171653
String
validation
func String(in []byte, pos int) (int, error) { pos, err := skipSpace(in, pos) if err != nil { return 0, err } max := len(in) if v := in[pos]; v != '"' { return 0, newError(pos, v) } pos++ for { switch in[pos] { case '\\': if in[pos+1] == '"' { pos++ } case '"': return pos + 1, nil } ...
go
{ "resource": "" }
q171654
Boolean
validation
func Boolean(in []byte, pos int) (int, error) { switch in[pos] { case 't': return expect(in, pos, t...) case 'f': return expect(in, pos, f...) default: return 0, errUnexpectedValue } }
go
{ "resource": "" }
q171655
Must
validation
func Must(op Op, err error) Op { if err != nil { panic(fmt.Errorf("unable to parse selector; %v", err.Error())) } return op }
go
{ "resource": "" }
q171656
Parse
validation
func Parse(selector string) (Op, error) { segments := strings.Split(selector, ".") ops := make([]Op, 0, len(segments)) for _, segment := range segments { key := strings.TrimSpace(segment) if key == "" { continue } if op, ok := parseArray(key); ok { ops = append(ops, op) continue } ops = appen...
go
{ "resource": "" }
q171657
Any
validation
func Any(in []byte, pos int) (int, error) { pos, err := skipSpace(in, pos) if err != nil { return 0, err } switch in[pos] { case '"': return String(in, pos) case '{': return Object(in, pos) case '.', '-', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0': return Number(in, pos) case '[': return Array(...
go
{ "resource": "" }
q171658
ProxyRequestFromContext
validation
func ProxyRequestFromContext(ctx context.Context) (events.APIGatewayProxyRequest, bool) { event, ok := ctx.Value(requestContextKey).(events.APIGatewayProxyRequest) return event, ok }
go
{ "resource": "" }
q171659
DurationValue
validation
func DurationValue(v *strfmt.Duration) strfmt.Duration { if v == nil { return strfmt.Duration(0) } return *v }
go
{ "resource": "" }
q171660
Base64Value
validation
func Base64Value(v *strfmt.Base64) strfmt.Base64 { if v == nil { return nil } return *v }
go
{ "resource": "" }
q171661
URIValue
validation
func URIValue(v *strfmt.URI) strfmt.URI { if v == nil { return strfmt.URI("") } return *v }
go
{ "resource": "" }
q171662
EmailValue
validation
func EmailValue(v *strfmt.Email) strfmt.Email { if v == nil { return strfmt.Email("") } return *v }
go
{ "resource": "" }
q171663
HostnameValue
validation
func HostnameValue(v *strfmt.Hostname) strfmt.Hostname { if v == nil { return strfmt.Hostname("") } return *v }
go
{ "resource": "" }
q171664
IPv4Value
validation
func IPv4Value(v *strfmt.IPv4) strfmt.IPv4 { if v == nil { return strfmt.IPv4("") } return *v }
go
{ "resource": "" }
q171665
IPv6Value
validation
func IPv6Value(v *strfmt.IPv6) strfmt.IPv6 { if v == nil { return strfmt.IPv6("") } return *v }
go
{ "resource": "" }
q171666
CIDRValue
validation
func CIDRValue(v *strfmt.CIDR) strfmt.CIDR { if v == nil { return strfmt.CIDR("") } return *v }
go
{ "resource": "" }
q171667
MACValue
validation
func MACValue(v *strfmt.MAC) strfmt.MAC { if v == nil { return strfmt.MAC("") } return *v }
go
{ "resource": "" }
q171668
UUIDValue
validation
func UUIDValue(v *strfmt.UUID) strfmt.UUID { if v == nil { return strfmt.UUID("") } return *v }
go
{ "resource": "" }
q171669
UUID3Value
validation
func UUID3Value(v *strfmt.UUID3) strfmt.UUID3 { if v == nil { return strfmt.UUID3("") } return *v }
go
{ "resource": "" }
q171670
UUID4Value
validation
func UUID4Value(v *strfmt.UUID4) strfmt.UUID4 { if v == nil { return strfmt.UUID4("") } return *v }
go
{ "resource": "" }
q171671
UUID5Value
validation
func UUID5Value(v *strfmt.UUID5) strfmt.UUID5 { if v == nil { return strfmt.UUID5("") } return *v }
go
{ "resource": "" }
q171672
ISBNValue
validation
func ISBNValue(v *strfmt.ISBN) strfmt.ISBN { if v == nil { return strfmt.ISBN("") } return *v }
go
{ "resource": "" }
q171673
ISBN10Value
validation
func ISBN10Value(v *strfmt.ISBN10) strfmt.ISBN10 { if v == nil { return strfmt.ISBN10("") } return *v }
go
{ "resource": "" }
q171674
ISBN13Value
validation
func ISBN13Value(v *strfmt.ISBN13) strfmt.ISBN13 { if v == nil { return strfmt.ISBN13("") } return *v }
go
{ "resource": "" }
q171675
CreditCardValue
validation
func CreditCardValue(v *strfmt.CreditCard) strfmt.CreditCard { if v == nil { return strfmt.CreditCard("") } return *v }
go
{ "resource": "" }
q171676
SSNValue
validation
func SSNValue(v *strfmt.SSN) strfmt.SSN { if v == nil { return strfmt.SSN("") } return *v }
go
{ "resource": "" }
q171677
HexColorValue
validation
func HexColorValue(v *strfmt.HexColor) strfmt.HexColor { if v == nil { return strfmt.HexColor("") } return *v }
go
{ "resource": "" }
q171678
RGBColorValue
validation
func RGBColorValue(v *strfmt.RGBColor) strfmt.RGBColor { if v == nil { return strfmt.RGBColor("") } return *v }
go
{ "resource": "" }
q171679
PasswordValue
validation
func PasswordValue(v *strfmt.Password) strfmt.Password { if v == nil { return strfmt.Password("") } return *v }
go
{ "resource": "" }
q171680
MarshalJSON
validation
func (id *ObjectId) MarshalJSON() ([]byte, error) { var w jwriter.Writer id.MarshalEasyJSON(&w) return w.BuildBytes() }
go
{ "resource": "" }
q171681
MarshalEasyJSON
validation
func (id *ObjectId) MarshalEasyJSON(w *jwriter.Writer) { w.String(bson.ObjectId(*id).Hex()) }
go
{ "resource": "" }
q171682
UnmarshalJSON
validation
func (id *ObjectId) UnmarshalJSON(data []byte) error { l := jlexer.Lexer{Data: data} id.UnmarshalEasyJSON(&l) return l.Error() }
go
{ "resource": "" }
q171683
UnmarshalEasyJSON
validation
func (id *ObjectId) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { *id = NewObjectId(data) } }
go
{ "resource": "" }
q171684
SetBSON
validation
func (id *ObjectId) SetBSON(raw bson.Raw) error { var m bson.M if err := raw.Unmarshal(&m); err != nil { return err } if data, ok := m["data"].(string); ok { *id = NewObjectId(data) return nil } return errors.New("couldn't unmarshal bson raw value as ObjectId") }
go
{ "resource": "" }
q171685
DeepCopy
validation
func (id *ObjectId) DeepCopy() *ObjectId { if id == nil { return nil } out := new(ObjectId) id.DeepCopyInto(out) return out }
go
{ "resource": "" }
q171686
IsHostname
validation
func IsHostname(str string) bool { if !rxHostname.MatchString(str) { return false } // the sum of all label octets and label lengths is limited to 255. if len(str) > 255 { return false } // Each node has a label, which is zero to 63 octets in length parts := strings.Split(str, ".") valid := true for _, p...
go
{ "resource": "" }
q171687
IsEmail
validation
func IsEmail(str string) bool { addr, e := mail.ParseAddress(str) return e == nil && addr.Address != "" }
go
{ "resource": "" }
q171688
MarshalJSON
validation
func (b Base64) MarshalJSON() ([]byte, error) { var w jwriter.Writer b.MarshalEasyJSON(&w) return w.BuildBytes() }
go
{ "resource": "" }
q171689
MarshalEasyJSON
validation
func (b Base64) MarshalEasyJSON(w *jwriter.Writer) { w.String(base64.StdEncoding.EncodeToString([]byte(b))) }
go
{ "resource": "" }
q171690
UnmarshalJSON
validation
func (b *Base64) UnmarshalJSON(data []byte) error { l := jlexer.Lexer{Data: data} b.UnmarshalEasyJSON(&l) return l.Error() }
go
{ "resource": "" }
q171691
UnmarshalEasyJSON
validation
func (b *Base64) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { enc := base64.StdEncoding dbuf := make([]byte, enc.DecodedLen(len(data))) n, err := enc.Decode(dbuf, []byte(data)) if err != nil { in.AddError(err) return } *b = dbuf[:n] } }
go
{ "resource": "" }
q171692
SetBSON
validation
func (b *Base64) SetBSON(raw bson.Raw) error { var m bson.M if err := raw.Unmarshal(&m); err != nil { return err } if data, ok := m["data"].(string); ok { *b = Base64(data) return nil } return errors.New("couldn't unmarshal bson raw value as Base64") }
go
{ "resource": "" }
q171693
DeepCopy
validation
func (b *Base64) DeepCopy() *Base64 { if b == nil { return nil } out := new(Base64) b.DeepCopyInto(out) return out }
go
{ "resource": "" }
q171694
MarshalJSON
validation
func (u URI) MarshalJSON() ([]byte, error) { var w jwriter.Writer u.MarshalEasyJSON(&w) return w.BuildBytes() }
go
{ "resource": "" }
q171695
MarshalEasyJSON
validation
func (u URI) MarshalEasyJSON(w *jwriter.Writer) { w.String(string(u)) }
go
{ "resource": "" }
q171696
UnmarshalJSON
validation
func (u *URI) UnmarshalJSON(data []byte) error { l := jlexer.Lexer{Data: data} u.UnmarshalEasyJSON(&l) return l.Error() }
go
{ "resource": "" }
q171697
DeepCopy
validation
func (u *URI) DeepCopy() *URI { if u == nil { return nil } out := new(URI) u.DeepCopyInto(out) return out }
go
{ "resource": "" }
q171698
MarshalJSON
validation
func (e Email) MarshalJSON() ([]byte, error) { var w jwriter.Writer e.MarshalEasyJSON(&w) return w.BuildBytes() }
go
{ "resource": "" }
q171699
MarshalEasyJSON
validation
func (e Email) MarshalEasyJSON(w *jwriter.Writer) { w.String(string(e)) }
go
{ "resource": "" }