id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
30,900 | xeipuuv/gojsonschema | jsonLoader.go | Open | func (o osFileSystem) Open(name string) (http.File, error) {
return o(name)
} | go | func (o osFileSystem) Open(name string) (http.File, error) {
return o(name)
} | [
"func",
"(",
"o",
"osFileSystem",
")",
"Open",
"(",
"name",
"string",
")",
"(",
"http",
".",
"File",
",",
"error",
")",
"{",
"return",
"o",
"(",
"name",
")",
"\n",
"}"
] | // Opens a file with the given name | [
"Opens",
"a",
"file",
"with",
"the",
"given",
"name"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/jsonLoader.go#L89-L91 |
30,901 | xeipuuv/gojsonschema | jsonLoader.go | NewReferenceLoaderFileSystem | func NewReferenceLoaderFileSystem(source string, fs http.FileSystem) JSONLoader {
return &jsonReferenceLoader{
fs: fs,
source: source,
}
} | go | func NewReferenceLoaderFileSystem(source string, fs http.FileSystem) JSONLoader {
return &jsonReferenceLoader{
fs: fs,
source: source,
}
} | [
"func",
"NewReferenceLoaderFileSystem",
"(",
"source",
"string",
",",
"fs",
"http",
".",
"FileSystem",
")",
"JSONLoader",
"{",
"return",
"&",
"jsonReferenceLoader",
"{",
"fs",
":",
"fs",
",",
"source",
":",
"source",
",",
"}",
"\n",
"}"
] | // NewReferenceLoaderFileSystem returns a JSON reference loader using the given source and file system. | [
"NewReferenceLoaderFileSystem",
"returns",
"a",
"JSON",
"reference",
"loader",
"using",
"the",
"given",
"source",
"and",
"file",
"system",
"."
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/jsonLoader.go#L124-L129 |
30,902 | xeipuuv/gojsonschema | jsonLoader.go | NewReaderLoader | func NewReaderLoader(source io.Reader) (JSONLoader, io.Reader) {
buf := &bytes.Buffer{}
return &jsonIOLoader{buf: buf}, io.TeeReader(source, buf)
} | go | func NewReaderLoader(source io.Reader) (JSONLoader, io.Reader) {
buf := &bytes.Buffer{}
return &jsonIOLoader{buf: buf}, io.TeeReader(source, buf)
} | [
"func",
"NewReaderLoader",
"(",
"source",
"io",
".",
"Reader",
")",
"(",
"JSONLoader",
",",
"io",
".",
"Reader",
")",
"{",
"buf",
":=",
"&",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"return",
"&",
"jsonIOLoader",
"{",
"buf",
":",
"buf",
"}",
",",
"i... | // NewReaderLoader creates a new JSON loader using the provided io.Reader | [
"NewReaderLoader",
"creates",
"a",
"new",
"JSON",
"loader",
"using",
"the",
"provided",
"io",
".",
"Reader"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/jsonLoader.go#L313-L316 |
30,903 | xeipuuv/gojsonschema | jsonLoader.go | NewWriterLoader | func NewWriterLoader(source io.Writer) (JSONLoader, io.Writer) {
buf := &bytes.Buffer{}
return &jsonIOLoader{buf: buf}, io.MultiWriter(source, buf)
} | go | func NewWriterLoader(source io.Writer) (JSONLoader, io.Writer) {
buf := &bytes.Buffer{}
return &jsonIOLoader{buf: buf}, io.MultiWriter(source, buf)
} | [
"func",
"NewWriterLoader",
"(",
"source",
"io",
".",
"Writer",
")",
"(",
"JSONLoader",
",",
"io",
".",
"Writer",
")",
"{",
"buf",
":=",
"&",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"return",
"&",
"jsonIOLoader",
"{",
"buf",
":",
"buf",
"}",
",",
"i... | // NewWriterLoader creates a new JSON loader using the provided io.Writer | [
"NewWriterLoader",
"creates",
"a",
"new",
"JSON",
"loader",
"using",
"the",
"provided",
"io",
".",
"Writer"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/jsonLoader.go#L319-L322 |
30,904 | xeipuuv/gojsonschema | format_checkers.go | Add | func (c *FormatCheckerChain) Add(name string, f FormatChecker) *FormatCheckerChain {
lock.Lock()
c.formatters[name] = f
lock.Unlock()
return c
} | go | func (c *FormatCheckerChain) Add(name string, f FormatChecker) *FormatCheckerChain {
lock.Lock()
c.formatters[name] = f
lock.Unlock()
return c
} | [
"func",
"(",
"c",
"*",
"FormatCheckerChain",
")",
"Add",
"(",
"name",
"string",
",",
"f",
"FormatChecker",
")",
"*",
"FormatCheckerChain",
"{",
"lock",
".",
"Lock",
"(",
")",
"\n",
"c",
".",
"formatters",
"[",
"name",
"]",
"=",
"f",
"\n",
"lock",
"."... | // Add adds a FormatChecker to the FormatCheckerChain
// The name used will be the value used for the format key in your json schema | [
"Add",
"adds",
"a",
"FormatChecker",
"to",
"the",
"FormatCheckerChain",
"The",
"name",
"used",
"will",
"be",
"the",
"value",
"used",
"for",
"the",
"format",
"key",
"in",
"your",
"json",
"schema"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/format_checkers.go#L149-L155 |
30,905 | xeipuuv/gojsonschema | format_checkers.go | Has | func (c *FormatCheckerChain) Has(name string) bool {
lock.Lock()
_, ok := c.formatters[name]
lock.Unlock()
return ok
} | go | func (c *FormatCheckerChain) Has(name string) bool {
lock.Lock()
_, ok := c.formatters[name]
lock.Unlock()
return ok
} | [
"func",
"(",
"c",
"*",
"FormatCheckerChain",
")",
"Has",
"(",
"name",
"string",
")",
"bool",
"{",
"lock",
".",
"Lock",
"(",
")",
"\n",
"_",
",",
"ok",
":=",
"c",
".",
"formatters",
"[",
"name",
"]",
"\n",
"lock",
".",
"Unlock",
"(",
")",
"\n\n",
... | // Has checks to see if the FormatCheckerChain holds a FormatChecker with the given name | [
"Has",
"checks",
"to",
"see",
"if",
"the",
"FormatCheckerChain",
"holds",
"a",
"FormatChecker",
"with",
"the",
"given",
"name"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/format_checkers.go#L167-L173 |
30,906 | xeipuuv/gojsonschema | format_checkers.go | IsFormat | func (c *FormatCheckerChain) IsFormat(name string, input interface{}) bool {
lock.Lock()
f, ok := c.formatters[name]
lock.Unlock()
if !ok {
return false
}
return f.IsFormat(input)
} | go | func (c *FormatCheckerChain) IsFormat(name string, input interface{}) bool {
lock.Lock()
f, ok := c.formatters[name]
lock.Unlock()
if !ok {
return false
}
return f.IsFormat(input)
} | [
"func",
"(",
"c",
"*",
"FormatCheckerChain",
")",
"IsFormat",
"(",
"name",
"string",
",",
"input",
"interface",
"{",
"}",
")",
"bool",
"{",
"lock",
".",
"Lock",
"(",
")",
"\n",
"f",
",",
"ok",
":=",
"c",
".",
"formatters",
"[",
"name",
"]",
"\n",
... | // IsFormat will check an input against a FormatChecker with the given name
// to see if it is the correct format | [
"IsFormat",
"will",
"check",
"an",
"input",
"against",
"a",
"FormatChecker",
"with",
"the",
"given",
"name",
"to",
"see",
"if",
"it",
"is",
"the",
"correct",
"format"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/format_checkers.go#L177-L187 |
30,907 | xeipuuv/gojsonschema | format_checkers.go | IsFormat | func (f EmailFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
_, err := mail.ParseAddress(asString)
return err == nil
} | go | func (f EmailFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
_, err := mail.ParseAddress(asString)
return err == nil
} | [
"func",
"(",
"f",
"EmailFormatChecker",
")",
"IsFormat",
"(",
"input",
"interface",
"{",
"}",
")",
"bool",
"{",
"asString",
",",
"ok",
":=",
"input",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"_",
",... | // IsFormat checks if input is a correctly formatted e-mail address | [
"IsFormat",
"checks",
"if",
"input",
"is",
"a",
"correctly",
"formatted",
"e",
"-",
"mail",
"address"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/format_checkers.go#L190-L198 |
30,908 | xeipuuv/gojsonschema | format_checkers.go | IsFormat | func (f IPV4FormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
// Credit: https://github.com/asaskevich/govalidator
ip := net.ParseIP(asString)
return ip != nil && strings.Contains(asString, ".")
} | go | func (f IPV4FormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
// Credit: https://github.com/asaskevich/govalidator
ip := net.ParseIP(asString)
return ip != nil && strings.Contains(asString, ".")
} | [
"func",
"(",
"f",
"IPV4FormatChecker",
")",
"IsFormat",
"(",
"input",
"interface",
"{",
"}",
")",
"bool",
"{",
"asString",
",",
"ok",
":=",
"input",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"// Credit... | // IsFormat checks if input is a correctly formatted IPv4-address | [
"IsFormat",
"checks",
"if",
"input",
"is",
"a",
"correctly",
"formatted",
"IPv4",
"-",
"address"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/format_checkers.go#L201-L210 |
30,909 | xeipuuv/gojsonschema | format_checkers.go | IsFormat | func (f URIFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
u, err := url.Parse(asString)
if err != nil || u.Scheme == "" {
return false
}
return !strings.Contains(asString, `\`)
} | go | func (f URIFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
u, err := url.Parse(asString)
if err != nil || u.Scheme == "" {
return false
}
return !strings.Contains(asString, `\`)
} | [
"func",
"(",
"f",
"URIFormatChecker",
")",
"IsFormat",
"(",
"input",
"interface",
"{",
"}",
")",
"bool",
"{",
"asString",
",",
"ok",
":=",
"input",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"u",
",",... | // IsFormat checks if input is correctly formatted URI with a valid Scheme per RFC3986 | [
"IsFormat",
"checks",
"if",
"input",
"is",
"correctly",
"formatted",
"URI",
"with",
"a",
"valid",
"Scheme",
"per",
"RFC3986"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/format_checkers.go#L274-L287 |
30,910 | xeipuuv/gojsonschema | format_checkers.go | IsFormat | func (f URIReferenceFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
_, err := url.Parse(asString)
return err == nil && !strings.Contains(asString, `\`)
} | go | func (f URIReferenceFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
_, err := url.Parse(asString)
return err == nil && !strings.Contains(asString, `\`)
} | [
"func",
"(",
"f",
"URIReferenceFormatChecker",
")",
"IsFormat",
"(",
"input",
"interface",
"{",
"}",
")",
"bool",
"{",
"asString",
",",
"ok",
":=",
"input",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"_... | // IsFormat checks if input is a correctly formatted URI or relative-reference per RFC3986 | [
"IsFormat",
"checks",
"if",
"input",
"is",
"a",
"correctly",
"formatted",
"URI",
"or",
"relative",
"-",
"reference",
"per",
"RFC3986"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/format_checkers.go#L290-L298 |
30,911 | xeipuuv/gojsonschema | format_checkers.go | IsFormat | func (f URITemplateFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
u, err := url.Parse(asString)
if err != nil || strings.Contains(asString, `\`) {
return false
}
return rxURITemplate.MatchString(u.Path)
} | go | func (f URITemplateFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
u, err := url.Parse(asString)
if err != nil || strings.Contains(asString, `\`) {
return false
}
return rxURITemplate.MatchString(u.Path)
} | [
"func",
"(",
"f",
"URITemplateFormatChecker",
")",
"IsFormat",
"(",
"input",
"interface",
"{",
"}",
")",
"bool",
"{",
"asString",
",",
"ok",
":=",
"input",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"u"... | // IsFormat checks if input is a correctly formatted URI template per RFC6570 | [
"IsFormat",
"checks",
"if",
"input",
"is",
"a",
"correctly",
"formatted",
"URI",
"template",
"per",
"RFC6570"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/format_checkers.go#L301-L313 |
30,912 | xeipuuv/gojsonschema | format_checkers.go | IsFormat | func (f HostnameFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
return rxHostname.MatchString(asString) && len(asString) < 256
} | go | func (f HostnameFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
return rxHostname.MatchString(asString) && len(asString) < 256
} | [
"func",
"(",
"f",
"HostnameFormatChecker",
")",
"IsFormat",
"(",
"input",
"interface",
"{",
"}",
")",
"bool",
"{",
"asString",
",",
"ok",
":=",
"input",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"retur... | // IsFormat checks if input is a correctly formatted hostname | [
"IsFormat",
"checks",
"if",
"input",
"is",
"a",
"correctly",
"formatted",
"hostname"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/format_checkers.go#L316-L323 |
30,913 | xeipuuv/gojsonschema | format_checkers.go | IsFormat | func (f UUIDFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
return rxUUID.MatchString(asString)
} | go | func (f UUIDFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
return rxUUID.MatchString(asString)
} | [
"func",
"(",
"f",
"UUIDFormatChecker",
")",
"IsFormat",
"(",
"input",
"interface",
"{",
"}",
")",
"bool",
"{",
"asString",
",",
"ok",
":=",
"input",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
... | // IsFormat checks if input is a correctly formatted UUID | [
"IsFormat",
"checks",
"if",
"input",
"is",
"a",
"correctly",
"formatted",
"UUID"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/format_checkers.go#L326-L333 |
30,914 | xeipuuv/gojsonschema | format_checkers.go | IsFormat | func (f RegexFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
if asString == "" {
return true
}
_, err := regexp.Compile(asString)
return err == nil
} | go | func (f RegexFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
if asString == "" {
return true
}
_, err := regexp.Compile(asString)
return err == nil
} | [
"func",
"(",
"f",
"RegexFormatChecker",
")",
"IsFormat",
"(",
"input",
"interface",
"{",
"}",
")",
"bool",
"{",
"asString",
",",
"ok",
":=",
"input",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"if",
"... | // IsFormat checks if input is a correctly formatted regular expression | [
"IsFormat",
"checks",
"if",
"input",
"is",
"a",
"correctly",
"formatted",
"regular",
"expression"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/format_checkers.go#L336-L347 |
30,915 | xeipuuv/gojsonschema | format_checkers.go | IsFormat | func (f JSONPointerFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
return rxJSONPointer.MatchString(asString)
} | go | func (f JSONPointerFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
return rxJSONPointer.MatchString(asString)
} | [
"func",
"(",
"f",
"JSONPointerFormatChecker",
")",
"IsFormat",
"(",
"input",
"interface",
"{",
"}",
")",
"bool",
"{",
"asString",
",",
"ok",
":=",
"input",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"re... | // IsFormat checks if input is a correctly formatted JSON Pointer per RFC6901 | [
"IsFormat",
"checks",
"if",
"input",
"is",
"a",
"correctly",
"formatted",
"JSON",
"Pointer",
"per",
"RFC6901"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/format_checkers.go#L350-L357 |
30,916 | xeipuuv/gojsonschema | format_checkers.go | IsFormat | func (f RelativeJSONPointerFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
return rxRelJSONPointer.MatchString(asString)
} | go | func (f RelativeJSONPointerFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return false
}
return rxRelJSONPointer.MatchString(asString)
} | [
"func",
"(",
"f",
"RelativeJSONPointerFormatChecker",
")",
"IsFormat",
"(",
"input",
"interface",
"{",
"}",
")",
"bool",
"{",
"asString",
",",
"ok",
":=",
"input",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n\n... | // IsFormat checks if input is a correctly formatted relative JSON Pointer | [
"IsFormat",
"checks",
"if",
"input",
"is",
"a",
"correctly",
"formatted",
"relative",
"JSON",
"Pointer"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/format_checkers.go#L360-L367 |
30,917 | xeipuuv/gojsonschema | jsonContext.go | String | func (c *JsonContext) String(del ...string) string {
byteArr := make([]byte, 0, c.stringLen())
buf := bytes.NewBuffer(byteArr)
c.writeStringToBuffer(buf, del)
return buf.String()
} | go | func (c *JsonContext) String(del ...string) string {
byteArr := make([]byte, 0, c.stringLen())
buf := bytes.NewBuffer(byteArr)
c.writeStringToBuffer(buf, del)
return buf.String()
} | [
"func",
"(",
"c",
"*",
"JsonContext",
")",
"String",
"(",
"del",
"...",
"string",
")",
"string",
"{",
"byteArr",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"0",
",",
"c",
".",
"stringLen",
"(",
")",
")",
"\n",
"buf",
":=",
"bytes",
".",
"NewBuffer... | // String displays the context in reverse.
// This plays well with the data structure's persistent nature with
// Cons and a json document's tree structure. | [
"String",
"displays",
"the",
"context",
"in",
"reverse",
".",
"This",
"plays",
"well",
"with",
"the",
"data",
"structure",
"s",
"persistent",
"nature",
"with",
"Cons",
"and",
"a",
"json",
"document",
"s",
"tree",
"structure",
"."
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/jsonContext.go#L43-L49 |
30,918 | xeipuuv/gojsonschema | result.go | String | func (v ResultErrorFields) String() string {
// as a fallback, the value is displayed go style
valueString := fmt.Sprintf("%v", v.value)
// marshal the go value value to json
if v.value == nil {
valueString = TYPE_NULL
} else {
if vs, err := marshalToJSONString(v.value); err == nil {
if vs == nil {
val... | go | func (v ResultErrorFields) String() string {
// as a fallback, the value is displayed go style
valueString := fmt.Sprintf("%v", v.value)
// marshal the go value value to json
if v.value == nil {
valueString = TYPE_NULL
} else {
if vs, err := marshalToJSONString(v.value); err == nil {
if vs == nil {
val... | [
"func",
"(",
"v",
"ResultErrorFields",
")",
"String",
"(",
")",
"string",
"{",
"// as a fallback, the value is displayed go style",
"valueString",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"value",
")",
"\n\n",
"// marshal the go value value to js... | // String returns a string representation of the error | [
"String",
"returns",
"a",
"string",
"representation",
"of",
"the",
"error"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/result.go#L159-L182 |
30,919 | xeipuuv/gojsonschema | result.go | mergeErrors | func (v *Result) mergeErrors(otherResult *Result) {
v.errors = append(v.errors, otherResult.Errors()...)
v.score += otherResult.score
} | go | func (v *Result) mergeErrors(otherResult *Result) {
v.errors = append(v.errors, otherResult.Errors()...)
v.score += otherResult.score
} | [
"func",
"(",
"v",
"*",
"Result",
")",
"mergeErrors",
"(",
"otherResult",
"*",
"Result",
")",
"{",
"v",
".",
"errors",
"=",
"append",
"(",
"v",
".",
"errors",
",",
"otherResult",
".",
"Errors",
"(",
")",
"...",
")",
"\n",
"v",
".",
"score",
"+=",
... | // Used to copy errors from a sub-schema to the main one | [
"Used",
"to",
"copy",
"errors",
"from",
"a",
"sub",
"-",
"schema",
"to",
"the",
"main",
"one"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/result.go#L213-L216 |
30,920 | xeipuuv/gojsonschema | utils.go | indexStringInSlice | func indexStringInSlice(s []string, what string) int {
for i := range s {
if s[i] == what {
return i
}
}
return -1
} | go | func indexStringInSlice(s []string, what string) int {
for i := range s {
if s[i] == what {
return i
}
}
return -1
} | [
"func",
"indexStringInSlice",
"(",
"s",
"[",
"]",
"string",
",",
"what",
"string",
")",
"int",
"{",
"for",
"i",
":=",
"range",
"s",
"{",
"if",
"s",
"[",
"i",
"]",
"==",
"what",
"{",
"return",
"i",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"-",
"1",... | // indexStringInSlice returns the index of the first instance of 'what' in s or -1 if it is not found in s. | [
"indexStringInSlice",
"returns",
"the",
"index",
"of",
"the",
"first",
"instance",
"of",
"what",
"in",
"s",
"or",
"-",
"1",
"if",
"it",
"is",
"not",
"found",
"in",
"s",
"."
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/utils.go#L66-L73 |
30,921 | xeipuuv/gojsonschema | schemaLoader.go | NewSchemaLoader | func NewSchemaLoader() *SchemaLoader {
ps := &SchemaLoader{
pool: &schemaPool{
schemaPoolDocuments: make(map[string]*schemaPoolDocument),
},
AutoDetect: true,
Validate: false,
Draft: Hybrid,
}
ps.pool.autoDetect = &ps.AutoDetect
return ps
} | go | func NewSchemaLoader() *SchemaLoader {
ps := &SchemaLoader{
pool: &schemaPool{
schemaPoolDocuments: make(map[string]*schemaPoolDocument),
},
AutoDetect: true,
Validate: false,
Draft: Hybrid,
}
ps.pool.autoDetect = &ps.AutoDetect
return ps
} | [
"func",
"NewSchemaLoader",
"(",
")",
"*",
"SchemaLoader",
"{",
"ps",
":=",
"&",
"SchemaLoader",
"{",
"pool",
":",
"&",
"schemaPool",
"{",
"schemaPoolDocuments",
":",
"make",
"(",
"map",
"[",
"string",
"]",
"*",
"schemaPoolDocument",
")",
",",
"}",
",",
"... | // NewSchemaLoader creates a new NewSchemaLoader | [
"NewSchemaLoader",
"creates",
"a",
"new",
"NewSchemaLoader"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/schemaLoader.go#L33-L46 |
30,922 | xeipuuv/gojsonschema | schemaLoader.go | AddSchema | func (sl *SchemaLoader) AddSchema(url string, loader JSONLoader) error {
ref, err := gojsonreference.NewJsonReference(url)
if err != nil {
return err
}
doc, err := loader.LoadJSON()
if err != nil {
return err
}
if sl.Validate {
if err := sl.validateMetaschema(doc); err != nil {
return err
}
}
... | go | func (sl *SchemaLoader) AddSchema(url string, loader JSONLoader) error {
ref, err := gojsonreference.NewJsonReference(url)
if err != nil {
return err
}
doc, err := loader.LoadJSON()
if err != nil {
return err
}
if sl.Validate {
if err := sl.validateMetaschema(doc); err != nil {
return err
}
}
... | [
"func",
"(",
"sl",
"*",
"SchemaLoader",
")",
"AddSchema",
"(",
"url",
"string",
",",
"loader",
"JSONLoader",
")",
"error",
"{",
"ref",
",",
"err",
":=",
"gojsonreference",
".",
"NewJsonReference",
"(",
"url",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
... | //AddSchema adds a schema under the provided URL to the schema cache | [
"AddSchema",
"adds",
"a",
"schema",
"under",
"the",
"provided",
"URL",
"to",
"the",
"schema",
"cache"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/schemaLoader.go#L123-L144 |
30,923 | xeipuuv/gojsonschema | schemaLoader.go | Compile | func (sl *SchemaLoader) Compile(rootSchema JSONLoader) (*Schema, error) {
ref, err := rootSchema.JsonReference()
if err != nil {
return nil, err
}
d := Schema{}
d.pool = sl.pool
d.pool.jsonLoaderFactory = rootSchema.LoaderFactory()
d.documentReference = ref
d.referencePool = newSchemaReferencePool()
var ... | go | func (sl *SchemaLoader) Compile(rootSchema JSONLoader) (*Schema, error) {
ref, err := rootSchema.JsonReference()
if err != nil {
return nil, err
}
d := Schema{}
d.pool = sl.pool
d.pool.jsonLoaderFactory = rootSchema.LoaderFactory()
d.documentReference = ref
d.referencePool = newSchemaReferencePool()
var ... | [
"func",
"(",
"sl",
"*",
"SchemaLoader",
")",
"Compile",
"(",
"rootSchema",
"JSONLoader",
")",
"(",
"*",
"Schema",
",",
"error",
")",
"{",
"ref",
",",
"err",
":=",
"rootSchema",
".",
"JsonReference",
"(",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"r... | // Compile loads and compiles a schema | [
"Compile",
"loads",
"and",
"compiles",
"a",
"schema"
] | 354ad34c2300dd6e84920ac70b41487336219e43 | https://github.com/xeipuuv/gojsonschema/blob/354ad34c2300dd6e84920ac70b41487336219e43/schemaLoader.go#L147-L206 |
30,924 | letsencrypt/boulder | mocks/mocks.go | GetRegistration | func (sa *StorageAuthority) GetRegistration(_ context.Context, id int64) (core.Registration, error) {
if id == 100 {
// Tag meaning "Missing"
return core.Registration{}, errors.New("missing")
}
if id == 101 {
// Tag meaning "Malformed"
return core.Registration{}, nil
}
if id == 102 {
// Tag meaning "Not ... | go | func (sa *StorageAuthority) GetRegistration(_ context.Context, id int64) (core.Registration, error) {
if id == 100 {
// Tag meaning "Missing"
return core.Registration{}, errors.New("missing")
}
if id == 101 {
// Tag meaning "Malformed"
return core.Registration{}, nil
}
if id == 102 {
// Tag meaning "Not ... | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"GetRegistration",
"(",
"_",
"context",
".",
"Context",
",",
"id",
"int64",
")",
"(",
"core",
".",
"Registration",
",",
"error",
")",
"{",
"if",
"id",
"==",
"100",
"{",
"// Tag meaning \"Missing\"",
"return"... | // GetRegistration is a mock | [
"GetRegistration",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L75-L142 |
30,925 | letsencrypt/boulder | mocks/mocks.go | GetAuthorization | func (sa *StorageAuthority) GetAuthorization(_ context.Context, id string) (core.Authorization, error) {
authz := core.Authorization{
ID: "valid",
Status: core.StatusValid,
RegistrationID: 1,
Identifier: core.AcmeIdentifier{Type: "dns", Value: "not-an-example.com"},
Challenges: []core... | go | func (sa *StorageAuthority) GetAuthorization(_ context.Context, id string) (core.Authorization, error) {
authz := core.Authorization{
ID: "valid",
Status: core.StatusValid,
RegistrationID: 1,
Identifier: core.AcmeIdentifier{Type: "dns", Value: "not-an-example.com"},
Challenges: []core... | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"GetAuthorization",
"(",
"_",
"context",
".",
"Context",
",",
"id",
"string",
")",
"(",
"core",
".",
"Authorization",
",",
"error",
")",
"{",
"authz",
":=",
"core",
".",
"Authorization",
"{",
"ID",
":",
... | // GetAuthorization is a mock | [
"GetAuthorization",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L239-L282 |
30,926 | letsencrypt/boulder | mocks/mocks.go | RevokeAuthorizationsByDomain | func (sa *StorageAuthority) RevokeAuthorizationsByDomain(_ context.Context, ident core.AcmeIdentifier) (int64, int64, error) {
return 0, 0, nil
} | go | func (sa *StorageAuthority) RevokeAuthorizationsByDomain(_ context.Context, ident core.AcmeIdentifier) (int64, int64, error) {
return 0, 0, nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"RevokeAuthorizationsByDomain",
"(",
"_",
"context",
".",
"Context",
",",
"ident",
"core",
".",
"AcmeIdentifier",
")",
"(",
"int64",
",",
"int64",
",",
"error",
")",
"{",
"return",
"0",
",",
"0",
",",
"nil... | // RevokeAuthorizationsByDomain is a mock | [
"RevokeAuthorizationsByDomain",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L285-L287 |
30,927 | letsencrypt/boulder | mocks/mocks.go | GetCertificate | func (sa *StorageAuthority) GetCertificate(_ context.Context, serial string) (core.Certificate, error) {
// Serial ee == 238.crt
if serial == "0000000000000000000000000000000000ee" {
certPemBytes, _ := ioutil.ReadFile("test/238.crt")
certBlock, _ := pem.Decode(certPemBytes)
return core.Certificate{
Registrat... | go | func (sa *StorageAuthority) GetCertificate(_ context.Context, serial string) (core.Certificate, error) {
// Serial ee == 238.crt
if serial == "0000000000000000000000000000000000ee" {
certPemBytes, _ := ioutil.ReadFile("test/238.crt")
certBlock, _ := pem.Decode(certPemBytes)
return core.Certificate{
Registrat... | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"GetCertificate",
"(",
"_",
"context",
".",
"Context",
",",
"serial",
"string",
")",
"(",
"core",
".",
"Certificate",
",",
"error",
")",
"{",
"// Serial ee == 238.crt",
"if",
"serial",
"==",
"\"",
"\"",
"{",... | // GetCertificate is a mock | [
"GetCertificate",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L290-L309 |
30,928 | letsencrypt/boulder | mocks/mocks.go | GetCertificateStatus | func (sa *StorageAuthority) GetCertificateStatus(_ context.Context, serial string) (core.CertificateStatus, error) {
// Serial ee == 238.crt
if serial == "0000000000000000000000000000000000ee" {
return core.CertificateStatus{
Status: core.OCSPStatusGood,
}, nil
} else if serial == "000000000000000000000000000... | go | func (sa *StorageAuthority) GetCertificateStatus(_ context.Context, serial string) (core.CertificateStatus, error) {
// Serial ee == 238.crt
if serial == "0000000000000000000000000000000000ee" {
return core.CertificateStatus{
Status: core.OCSPStatusGood,
}, nil
} else if serial == "000000000000000000000000000... | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"GetCertificateStatus",
"(",
"_",
"context",
".",
"Context",
",",
"serial",
"string",
")",
"(",
"core",
".",
"CertificateStatus",
",",
"error",
")",
"{",
"// Serial ee == 238.crt",
"if",
"serial",
"==",
"\"",
... | // GetCertificateStatus is a mock | [
"GetCertificateStatus",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L312-L325 |
30,929 | letsencrypt/boulder | mocks/mocks.go | AddCertificate | func (sa *StorageAuthority) AddCertificate(_ context.Context, certDER []byte, regID int64, _ []byte, _ *time.Time) (digest string, err error) {
return
} | go | func (sa *StorageAuthority) AddCertificate(_ context.Context, certDER []byte, regID int64, _ []byte, _ *time.Time) (digest string, err error) {
return
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"AddCertificate",
"(",
"_",
"context",
".",
"Context",
",",
"certDER",
"[",
"]",
"byte",
",",
"regID",
"int64",
",",
"_",
"[",
"]",
"byte",
",",
"_",
"*",
"time",
".",
"Time",
")",
"(",
"digest",
"st... | // AddCertificate is a mock | [
"AddCertificate",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L328-L330 |
30,930 | letsencrypt/boulder | mocks/mocks.go | FinalizeAuthorization | func (sa *StorageAuthority) FinalizeAuthorization(_ context.Context, authz core.Authorization) (err error) {
return
} | go | func (sa *StorageAuthority) FinalizeAuthorization(_ context.Context, authz core.Authorization) (err error) {
return
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"FinalizeAuthorization",
"(",
"_",
"context",
".",
"Context",
",",
"authz",
"core",
".",
"Authorization",
")",
"(",
"err",
"error",
")",
"{",
"return",
"\n",
"}"
] | // FinalizeAuthorization is a mock | [
"FinalizeAuthorization",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L333-L335 |
30,931 | letsencrypt/boulder | mocks/mocks.go | MarkCertificateRevoked | func (sa *StorageAuthority) MarkCertificateRevoked(_ context.Context, serial string, reasonCode revocation.Reason) (err error) {
return
} | go | func (sa *StorageAuthority) MarkCertificateRevoked(_ context.Context, serial string, reasonCode revocation.Reason) (err error) {
return
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"MarkCertificateRevoked",
"(",
"_",
"context",
".",
"Context",
",",
"serial",
"string",
",",
"reasonCode",
"revocation",
".",
"Reason",
")",
"(",
"err",
"error",
")",
"{",
"return",
"\n",
"}"
] | // MarkCertificateRevoked is a mock | [
"MarkCertificateRevoked",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L338-L340 |
30,932 | letsencrypt/boulder | mocks/mocks.go | NewPendingAuthorization | func (sa *StorageAuthority) NewPendingAuthorization(_ context.Context, authz core.Authorization) (core.Authorization, error) {
return authz, nil
} | go | func (sa *StorageAuthority) NewPendingAuthorization(_ context.Context, authz core.Authorization) (core.Authorization, error) {
return authz, nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"NewPendingAuthorization",
"(",
"_",
"context",
".",
"Context",
",",
"authz",
"core",
".",
"Authorization",
")",
"(",
"core",
".",
"Authorization",
",",
"error",
")",
"{",
"return",
"authz",
",",
"nil",
"\n"... | // NewPendingAuthorization is a mock | [
"NewPendingAuthorization",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L343-L345 |
30,933 | letsencrypt/boulder | mocks/mocks.go | NewRegistration | func (sa *StorageAuthority) NewRegistration(_ context.Context, reg core.Registration) (regR core.Registration, err error) {
return
} | go | func (sa *StorageAuthority) NewRegistration(_ context.Context, reg core.Registration) (regR core.Registration, err error) {
return
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"NewRegistration",
"(",
"_",
"context",
".",
"Context",
",",
"reg",
"core",
".",
"Registration",
")",
"(",
"regR",
"core",
".",
"Registration",
",",
"err",
"error",
")",
"{",
"return",
"\n",
"}"
] | // NewRegistration is a mock | [
"NewRegistration",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L348-L350 |
30,934 | letsencrypt/boulder | mocks/mocks.go | UpdateRegistration | func (sa *StorageAuthority) UpdateRegistration(_ context.Context, reg core.Registration) (err error) {
return
} | go | func (sa *StorageAuthority) UpdateRegistration(_ context.Context, reg core.Registration) (err error) {
return
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"UpdateRegistration",
"(",
"_",
"context",
".",
"Context",
",",
"reg",
"core",
".",
"Registration",
")",
"(",
"err",
"error",
")",
"{",
"return",
"\n",
"}"
] | // UpdateRegistration is a mock | [
"UpdateRegistration",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L353-L355 |
30,935 | letsencrypt/boulder | mocks/mocks.go | CountFQDNSets | func (sa *StorageAuthority) CountFQDNSets(_ context.Context, since time.Duration, names []string) (int64, error) {
return 0, nil
} | go | func (sa *StorageAuthority) CountFQDNSets(_ context.Context, since time.Duration, names []string) (int64, error) {
return 0, nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"CountFQDNSets",
"(",
"_",
"context",
".",
"Context",
",",
"since",
"time",
".",
"Duration",
",",
"names",
"[",
"]",
"string",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"0",
",",
"nil",
"\n"... | // CountFQDNSets is a mock | [
"CountFQDNSets",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L358-L360 |
30,936 | letsencrypt/boulder | mocks/mocks.go | FQDNSetExists | func (sa *StorageAuthority) FQDNSetExists(_ context.Context, names []string) (bool, error) {
return false, nil
} | go | func (sa *StorageAuthority) FQDNSetExists(_ context.Context, names []string) (bool, error) {
return false, nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"FQDNSetExists",
"(",
"_",
"context",
".",
"Context",
",",
"names",
"[",
"]",
"string",
")",
"(",
"bool",
",",
"error",
")",
"{",
"return",
"false",
",",
"nil",
"\n",
"}"
] | // FQDNSetExists is a mock | [
"FQDNSetExists",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L363-L365 |
30,937 | letsencrypt/boulder | mocks/mocks.go | GetValidAuthorizations | func (sa *StorageAuthority) GetValidAuthorizations(_ context.Context, regID int64, names []string, now time.Time) (map[string]*core.Authorization, error) {
if regID == 1 {
auths := make(map[string]*core.Authorization)
for _, name := range names {
if sa.authorizedDomains[name] || name == "not-an-example.com" {
... | go | func (sa *StorageAuthority) GetValidAuthorizations(_ context.Context, regID int64, names []string, now time.Time) (map[string]*core.Authorization, error) {
if regID == 1 {
auths := make(map[string]*core.Authorization)
for _, name := range names {
if sa.authorizedDomains[name] || name == "not-an-example.com" {
... | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"GetValidAuthorizations",
"(",
"_",
"context",
".",
"Context",
",",
"regID",
"int64",
",",
"names",
"[",
"]",
"string",
",",
"now",
"time",
".",
"Time",
")",
"(",
"map",
"[",
"string",
"]",
"*",
"core",
... | // GetValidAuthorizations is a mock | [
"GetValidAuthorizations",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L382-L413 |
30,938 | letsencrypt/boulder | mocks/mocks.go | CountCertificatesByNames | func (sa *StorageAuthority) CountCertificatesByNames(_ context.Context, _ []string, _, _ time.Time) (ret []*sapb.CountByNames_MapElement, err error) {
return
} | go | func (sa *StorageAuthority) CountCertificatesByNames(_ context.Context, _ []string, _, _ time.Time) (ret []*sapb.CountByNames_MapElement, err error) {
return
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"CountCertificatesByNames",
"(",
"_",
"context",
".",
"Context",
",",
"_",
"[",
"]",
"string",
",",
"_",
",",
"_",
"time",
".",
"Time",
")",
"(",
"ret",
"[",
"]",
"*",
"sapb",
".",
"CountByNames_MapEleme... | // CountCertificatesByNames is a mock | [
"CountCertificatesByNames",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L416-L418 |
30,939 | letsencrypt/boulder | mocks/mocks.go | CountRegistrationsByIP | func (sa *StorageAuthority) CountRegistrationsByIP(_ context.Context, _ net.IP, _, _ time.Time) (int, error) {
return 0, nil
} | go | func (sa *StorageAuthority) CountRegistrationsByIP(_ context.Context, _ net.IP, _, _ time.Time) (int, error) {
return 0, nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"CountRegistrationsByIP",
"(",
"_",
"context",
".",
"Context",
",",
"_",
"net",
".",
"IP",
",",
"_",
",",
"_",
"time",
".",
"Time",
")",
"(",
"int",
",",
"error",
")",
"{",
"return",
"0",
",",
"nil",... | // CountRegistrationsByIP is a mock | [
"CountRegistrationsByIP",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L426-L428 |
30,940 | letsencrypt/boulder | mocks/mocks.go | CountPendingAuthorizations | func (sa *StorageAuthority) CountPendingAuthorizations(_ context.Context, _ int64) (int, error) {
return 0, nil
} | go | func (sa *StorageAuthority) CountPendingAuthorizations(_ context.Context, _ int64) (int, error) {
return 0, nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"CountPendingAuthorizations",
"(",
"_",
"context",
".",
"Context",
",",
"_",
"int64",
")",
"(",
"int",
",",
"error",
")",
"{",
"return",
"0",
",",
"nil",
"\n",
"}"
] | // CountPendingAuthorizations is a mock | [
"CountPendingAuthorizations",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L436-L438 |
30,941 | letsencrypt/boulder | mocks/mocks.go | CountOrders | func (sa *StorageAuthority) CountOrders(_ context.Context, _ int64, _, _ time.Time) (int, error) {
return 0, nil
} | go | func (sa *StorageAuthority) CountOrders(_ context.Context, _ int64, _, _ time.Time) (int, error) {
return 0, nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"CountOrders",
"(",
"_",
"context",
".",
"Context",
",",
"_",
"int64",
",",
"_",
",",
"_",
"time",
".",
"Time",
")",
"(",
"int",
",",
"error",
")",
"{",
"return",
"0",
",",
"nil",
"\n",
"}"
] | // CountOrders is a mock | [
"CountOrders",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L441-L443 |
30,942 | letsencrypt/boulder | mocks/mocks.go | DeactivateAuthorization | func (sa *StorageAuthority) DeactivateAuthorization(_ context.Context, _ string) error {
return nil
} | go | func (sa *StorageAuthority) DeactivateAuthorization(_ context.Context, _ string) error {
return nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"DeactivateAuthorization",
"(",
"_",
"context",
".",
"Context",
",",
"_",
"string",
")",
"error",
"{",
"return",
"nil",
"\n",
"}"
] | // DeactivateAuthorization is a mock | [
"DeactivateAuthorization",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L446-L448 |
30,943 | letsencrypt/boulder | mocks/mocks.go | DeactivateRegistration | func (sa *StorageAuthority) DeactivateRegistration(_ context.Context, _ int64) error {
return nil
} | go | func (sa *StorageAuthority) DeactivateRegistration(_ context.Context, _ int64) error {
return nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"DeactivateRegistration",
"(",
"_",
"context",
".",
"Context",
",",
"_",
"int64",
")",
"error",
"{",
"return",
"nil",
"\n",
"}"
] | // DeactivateRegistration is a mock | [
"DeactivateRegistration",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L451-L453 |
30,944 | letsencrypt/boulder | mocks/mocks.go | NewOrder | func (sa *StorageAuthority) NewOrder(_ context.Context, order *corepb.Order) (*corepb.Order, error) {
return order, nil
} | go | func (sa *StorageAuthority) NewOrder(_ context.Context, order *corepb.Order) (*corepb.Order, error) {
return order, nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"NewOrder",
"(",
"_",
"context",
".",
"Context",
",",
"order",
"*",
"corepb",
".",
"Order",
")",
"(",
"*",
"corepb",
".",
"Order",
",",
"error",
")",
"{",
"return",
"order",
",",
"nil",
"\n",
"}"
] | // NewOrder is a mock | [
"NewOrder",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L456-L458 |
30,945 | letsencrypt/boulder | mocks/mocks.go | SetOrderProcessing | func (sa *StorageAuthority) SetOrderProcessing(_ context.Context, order *corepb.Order) error {
return nil
} | go | func (sa *StorageAuthority) SetOrderProcessing(_ context.Context, order *corepb.Order) error {
return nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"SetOrderProcessing",
"(",
"_",
"context",
".",
"Context",
",",
"order",
"*",
"corepb",
".",
"Order",
")",
"error",
"{",
"return",
"nil",
"\n",
"}"
] | // SetOrderProcessing is a mock | [
"SetOrderProcessing",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L461-L463 |
30,946 | letsencrypt/boulder | mocks/mocks.go | GetOrder | func (sa *StorageAuthority) GetOrder(_ context.Context, req *sapb.OrderRequest) (*corepb.Order, error) {
if *req.Id == 2 {
return nil, berrors.NotFoundError("bad")
} else if *req.Id == 3 {
return nil, errors.New("very bad")
}
status := string(core.StatusValid)
one := int64(1)
serial := "serial"
exp := sa.cl... | go | func (sa *StorageAuthority) GetOrder(_ context.Context, req *sapb.OrderRequest) (*corepb.Order, error) {
if *req.Id == 2 {
return nil, berrors.NotFoundError("bad")
} else if *req.Id == 3 {
return nil, errors.New("very bad")
}
status := string(core.StatusValid)
one := int64(1)
serial := "serial"
exp := sa.cl... | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"GetOrder",
"(",
"_",
"context",
".",
"Context",
",",
"req",
"*",
"sapb",
".",
"OrderRequest",
")",
"(",
"*",
"corepb",
".",
"Order",
",",
"error",
")",
"{",
"if",
"*",
"req",
".",
"Id",
"==",
"2",
... | // GetOrder is a mock | [
"GetOrder",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L476-L529 |
30,947 | letsencrypt/boulder | mocks/mocks.go | GetAuthorizations | func (sa *StorageAuthority) GetAuthorizations(ctx context.Context, req *sapb.GetAuthorizationsRequest) (*sapb.Authorizations, error) {
return &sapb.Authorizations{}, nil
} | go | func (sa *StorageAuthority) GetAuthorizations(ctx context.Context, req *sapb.GetAuthorizationsRequest) (*sapb.Authorizations, error) {
return &sapb.Authorizations{}, nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"GetAuthorizations",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"sapb",
".",
"GetAuthorizationsRequest",
")",
"(",
"*",
"sapb",
".",
"Authorizations",
",",
"error",
")",
"{",
"return",
"&",
"sap... | // GetAuthorizations is a mock | [
"GetAuthorizations",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L540-L542 |
30,948 | letsencrypt/boulder | mocks/mocks.go | CountInvalidAuthorizations | func (sa *StorageAuthority) CountInvalidAuthorizations(ctx context.Context, req *sapb.CountInvalidAuthorizationsRequest) (count *sapb.Count, err error) {
return &sapb.Count{}, nil
} | go | func (sa *StorageAuthority) CountInvalidAuthorizations(ctx context.Context, req *sapb.CountInvalidAuthorizationsRequest) (count *sapb.Count, err error) {
return &sapb.Count{}, nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"CountInvalidAuthorizations",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"sapb",
".",
"CountInvalidAuthorizationsRequest",
")",
"(",
"count",
"*",
"sapb",
".",
"Count",
",",
"err",
"error",
")",
"... | // CountInvalidAuthorizations is a mock | [
"CountInvalidAuthorizations",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L545-L547 |
30,949 | letsencrypt/boulder | mocks/mocks.go | AddPendingAuthorizations | func (sa *StorageAuthority) AddPendingAuthorizations(ctx context.Context, req *sapb.AddPendingAuthorizationsRequest) (*sapb.AuthorizationIDs, error) {
return &sapb.AuthorizationIDs{}, nil
} | go | func (sa *StorageAuthority) AddPendingAuthorizations(ctx context.Context, req *sapb.AddPendingAuthorizationsRequest) (*sapb.AuthorizationIDs, error) {
return &sapb.AuthorizationIDs{}, nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"AddPendingAuthorizations",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"sapb",
".",
"AddPendingAuthorizationsRequest",
")",
"(",
"*",
"sapb",
".",
"AuthorizationIDs",
",",
"error",
")",
"{",
"return... | // AddPendingAuthorizations is a mock | [
"AddPendingAuthorizations",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L550-L552 |
30,950 | letsencrypt/boulder | mocks/mocks.go | NewAuthorizations2 | func (sa *StorageAuthority) NewAuthorizations2(ctx context.Context, req *sapb.AddPendingAuthorizationsRequest) (*sapb.Authorization2IDs, error) {
return &sapb.Authorization2IDs{}, nil
} | go | func (sa *StorageAuthority) NewAuthorizations2(ctx context.Context, req *sapb.AddPendingAuthorizationsRequest) (*sapb.Authorization2IDs, error) {
return &sapb.Authorization2IDs{}, nil
} | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"NewAuthorizations2",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"sapb",
".",
"AddPendingAuthorizationsRequest",
")",
"(",
"*",
"sapb",
".",
"Authorization2IDs",
",",
"error",
")",
"{",
"return",
... | // NewAuthorizations is a mock | [
"NewAuthorizations",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L555-L557 |
30,951 | letsencrypt/boulder | mocks/mocks.go | GetAuthorization2 | func (sa *StorageAuthority) GetAuthorization2(ctx context.Context, id *sapb.AuthorizationID2) (*corepb.Authorization, error) {
authz := core.Authorization{
Status: core.StatusValid,
RegistrationID: 1,
Identifier: core.AcmeIdentifier{Type: "dns", Value: "not-an-example.com"},
V2: true,
... | go | func (sa *StorageAuthority) GetAuthorization2(ctx context.Context, id *sapb.AuthorizationID2) (*corepb.Authorization, error) {
authz := core.Authorization{
Status: core.StatusValid,
RegistrationID: 1,
Identifier: core.AcmeIdentifier{Type: "dns", Value: "not-an-example.com"},
V2: true,
... | [
"func",
"(",
"sa",
"*",
"StorageAuthority",
")",
"GetAuthorization2",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"*",
"sapb",
".",
"AuthorizationID2",
")",
"(",
"*",
"corepb",
".",
"Authorization",
",",
"error",
")",
"{",
"authz",
":=",
"core",
".... | // GetAuthorization2 is a mock | [
"GetAuthorization2",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L604-L647 |
30,952 | letsencrypt/boulder | mocks/mocks.go | SubmitToSingleCTWithResult | func (*Publisher) SubmitToSingleCTWithResult(_ context.Context, _ *pubpb.Request) (*pubpb.Result, error) {
return nil, nil
} | go | func (*Publisher) SubmitToSingleCTWithResult(_ context.Context, _ *pubpb.Request) (*pubpb.Result, error) {
return nil, nil
} | [
"func",
"(",
"*",
"Publisher",
")",
"SubmitToSingleCTWithResult",
"(",
"_",
"context",
".",
"Context",
",",
"_",
"*",
"pubpb",
".",
"Request",
")",
"(",
"*",
"pubpb",
".",
"Result",
",",
"error",
")",
"{",
"return",
"nil",
",",
"nil",
"\n",
"}"
] | // SubmitToSingleCTWithResult is a mock | [
"SubmitToSingleCTWithResult",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L660-L662 |
30,953 | letsencrypt/boulder | mocks/mocks.go | SendMail | func (m *Mailer) SendMail(to []string, subject, msg string) error {
for _, rcpt := range to {
m.Messages = append(m.Messages, MailerMessage{
To: rcpt,
Subject: subject,
Body: msg,
})
}
return nil
} | go | func (m *Mailer) SendMail(to []string, subject, msg string) error {
for _, rcpt := range to {
m.Messages = append(m.Messages, MailerMessage{
To: rcpt,
Subject: subject,
Body: msg,
})
}
return nil
} | [
"func",
"(",
"m",
"*",
"Mailer",
")",
"SendMail",
"(",
"to",
"[",
"]",
"string",
",",
"subject",
",",
"msg",
"string",
")",
"error",
"{",
"for",
"_",
",",
"rcpt",
":=",
"range",
"to",
"{",
"m",
".",
"Messages",
"=",
"append",
"(",
"m",
".",
"Me... | // SendMail is a mock | [
"SendMail",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/mocks.go#L682-L691 |
30,954 | letsencrypt/boulder | probs/probs.go | ProblemDetailsToStatusCode | func ProblemDetailsToStatusCode(prob *ProblemDetails) int {
if prob.HTTPStatus != 0 {
return prob.HTTPStatus
}
switch prob.Type {
case
ConnectionProblem,
MalformedProblem,
BadSignatureAlgorithmProblem,
BadPublicKeyProblem,
TLSProblem,
UnknownHostProblem,
BadNonceProblem,
InvalidEmailProblem,
Rej... | go | func ProblemDetailsToStatusCode(prob *ProblemDetails) int {
if prob.HTTPStatus != 0 {
return prob.HTTPStatus
}
switch prob.Type {
case
ConnectionProblem,
MalformedProblem,
BadSignatureAlgorithmProblem,
BadPublicKeyProblem,
TLSProblem,
UnknownHostProblem,
BadNonceProblem,
InvalidEmailProblem,
Rej... | [
"func",
"ProblemDetailsToStatusCode",
"(",
"prob",
"*",
"ProblemDetails",
")",
"int",
"{",
"if",
"prob",
".",
"HTTPStatus",
"!=",
"0",
"{",
"return",
"prob",
".",
"HTTPStatus",
"\n",
"}",
"\n",
"switch",
"prob",
".",
"Type",
"{",
"case",
"ConnectionProblem",... | // ProblemDetailsToStatusCode inspects the given ProblemDetails to figure out
// what HTTP status code it should represent. It should only be used by the WFE
// but is included in this package because of its reliance on ProblemTypes. | [
"ProblemDetailsToStatusCode",
"inspects",
"the",
"given",
"ProblemDetails",
"to",
"figure",
"out",
"what",
"HTTP",
"status",
"code",
"it",
"should",
"represent",
".",
"It",
"should",
"only",
"be",
"used",
"by",
"the",
"WFE",
"but",
"is",
"included",
"in",
"thi... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L56-L84 |
30,955 | letsencrypt/boulder | probs/probs.go | BadNonce | func BadNonce(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: BadNonceProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | go | func BadNonce(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: BadNonceProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | [
"func",
"BadNonce",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"BadNonceProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
",",
"a"... | // BadNonce returns a ProblemDetails with a BadNonceProblem and a 400 Bad
// Request status code. | [
"BadNonce",
"returns",
"a",
"ProblemDetails",
"with",
"a",
"BadNonceProblem",
"and",
"a",
"400",
"Bad",
"Request",
"status",
"code",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L88-L94 |
30,956 | letsencrypt/boulder | probs/probs.go | RejectedIdentifier | func RejectedIdentifier(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: RejectedIdentifierProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | go | func RejectedIdentifier(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: RejectedIdentifierProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | [
"func",
"RejectedIdentifier",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"RejectedIdentifierProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"d... | // RejectedIdentifier returns a ProblemDetails with a RejectedIdentifierProblem and a 400 Bad
// Request status code. | [
"RejectedIdentifier",
"returns",
"a",
"ProblemDetails",
"with",
"a",
"RejectedIdentifierProblem",
"and",
"a",
"400",
"Bad",
"Request",
"status",
"code",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L98-L104 |
30,957 | letsencrypt/boulder | probs/probs.go | Conflict | func Conflict(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: MalformedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusConflict,
}
} | go | func Conflict(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: MalformedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusConflict,
}
} | [
"func",
"Conflict",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"MalformedProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
",",
"a... | // Conflict returns a ProblemDetails with a MalformedProblem and a 409 Conflict
// status code. | [
"Conflict",
"returns",
"a",
"ProblemDetails",
"with",
"a",
"MalformedProblem",
"and",
"a",
"409",
"Conflict",
"status",
"code",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L108-L114 |
30,958 | letsencrypt/boulder | probs/probs.go | AlreadyRevoked | func AlreadyRevoked(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: AlreadyRevokedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | go | func AlreadyRevoked(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: AlreadyRevokedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | [
"func",
"AlreadyRevoked",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"AlreadyRevokedProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
... | // AlreadyRevoked returns a ProblemDetails with a AlreadyRevokedProblem and a 400 Bad
// Request status code. | [
"AlreadyRevoked",
"returns",
"a",
"ProblemDetails",
"with",
"a",
"AlreadyRevokedProblem",
"and",
"a",
"400",
"Bad",
"Request",
"status",
"code",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L118-L124 |
30,959 | letsencrypt/boulder | probs/probs.go | Malformed | func Malformed(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: MalformedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | go | func Malformed(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: MalformedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | [
"func",
"Malformed",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"MalformedProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
",",
"... | // Malformed returns a ProblemDetails with a MalformedProblem and a 400 Bad
// Request status code. | [
"Malformed",
"returns",
"a",
"ProblemDetails",
"with",
"a",
"MalformedProblem",
"and",
"a",
"400",
"Bad",
"Request",
"status",
"code",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L128-L134 |
30,960 | letsencrypt/boulder | probs/probs.go | BadSignatureAlgorithm | func BadSignatureAlgorithm(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: BadSignatureAlgorithmProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | go | func BadSignatureAlgorithm(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: BadSignatureAlgorithmProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | [
"func",
"BadSignatureAlgorithm",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"BadSignatureAlgorithmProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"("... | // BadSignatureAlgorithm returns a ProblemDetails with a BadSignatureAlgorithmProblem
// and a 400 Bad Request status code. | [
"BadSignatureAlgorithm",
"returns",
"a",
"ProblemDetails",
"with",
"a",
"BadSignatureAlgorithmProblem",
"and",
"a",
"400",
"Bad",
"Request",
"status",
"code",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L138-L144 |
30,961 | letsencrypt/boulder | probs/probs.go | BadPublicKey | func BadPublicKey(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: BadPublicKeyProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | go | func BadPublicKey(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: BadPublicKeyProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | [
"func",
"BadPublicKey",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"BadPublicKeyProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
",... | // BadPublicKey returns a ProblemDetails with a BadPublicKeyProblem and a 400 Bad
// Request status code. | [
"BadPublicKey",
"returns",
"a",
"ProblemDetails",
"with",
"a",
"BadPublicKeyProblem",
"and",
"a",
"400",
"Bad",
"Request",
"status",
"code",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L148-L154 |
30,962 | letsencrypt/boulder | probs/probs.go | NotFound | func NotFound(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: MalformedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusNotFound,
}
} | go | func NotFound(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: MalformedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusNotFound,
}
} | [
"func",
"NotFound",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"MalformedProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
",",
"a... | // NotFound returns a ProblemDetails with a MalformedProblem and a 404 Not Found
// status code. | [
"NotFound",
"returns",
"a",
"ProblemDetails",
"with",
"a",
"MalformedProblem",
"and",
"a",
"404",
"Not",
"Found",
"status",
"code",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L158-L164 |
30,963 | letsencrypt/boulder | probs/probs.go | ServerInternal | func ServerInternal(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: ServerInternalProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusInternalServerError,
}
} | go | func ServerInternal(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: ServerInternalProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusInternalServerError,
}
} | [
"func",
"ServerInternal",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"ServerInternalProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
... | // ServerInternal returns a ProblemDetails with a ServerInternalProblem and a
// 500 Internal Server Failure status code. | [
"ServerInternal",
"returns",
"a",
"ProblemDetails",
"with",
"a",
"ServerInternalProblem",
"and",
"a",
"500",
"Internal",
"Server",
"Failure",
"status",
"code",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L168-L174 |
30,964 | letsencrypt/boulder | probs/probs.go | Unauthorized | func Unauthorized(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: UnauthorizedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusForbidden,
}
} | go | func Unauthorized(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: UnauthorizedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusForbidden,
}
} | [
"func",
"Unauthorized",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"UnauthorizedProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
",... | // Unauthorized returns a ProblemDetails with an UnauthorizedProblem and a 403
// Forbidden status code. | [
"Unauthorized",
"returns",
"a",
"ProblemDetails",
"with",
"an",
"UnauthorizedProblem",
"and",
"a",
"403",
"Forbidden",
"status",
"code",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L178-L184 |
30,965 | letsencrypt/boulder | probs/probs.go | InvalidContentType | func InvalidContentType(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: MalformedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusUnsupportedMediaType,
}
} | go | func InvalidContentType(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: MalformedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusUnsupportedMediaType,
}
} | [
"func",
"InvalidContentType",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"MalformedProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
... | // InvalidContentType returns a ProblemDetails suitable for a missing
// ContentType header, or an incorrect ContentType header | [
"InvalidContentType",
"returns",
"a",
"ProblemDetails",
"suitable",
"for",
"a",
"missing",
"ContentType",
"header",
"or",
"an",
"incorrect",
"ContentType",
"header"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L208-L214 |
30,966 | letsencrypt/boulder | probs/probs.go | InvalidEmail | func InvalidEmail(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: InvalidEmailProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | go | func InvalidEmail(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: InvalidEmailProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | [
"func",
"InvalidEmail",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"InvalidEmailProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
",... | // InvalidEmail returns a ProblemDetails representing an invalid email address
// error | [
"InvalidEmail",
"returns",
"a",
"ProblemDetails",
"representing",
"an",
"invalid",
"email",
"address",
"error"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L218-L224 |
30,967 | letsencrypt/boulder | probs/probs.go | ConnectionFailure | func ConnectionFailure(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: ConnectionProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | go | func ConnectionFailure(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: ConnectionProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | [
"func",
"ConnectionFailure",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"ConnectionProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
... | // ConnectionFailure returns a ProblemDetails representing a ConnectionProblem
// error | [
"ConnectionFailure",
"returns",
"a",
"ProblemDetails",
"representing",
"a",
"ConnectionProblem",
"error"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L228-L234 |
30,968 | letsencrypt/boulder | probs/probs.go | UnknownHost | func UnknownHost(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: UnknownHostProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | go | func UnknownHost(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: UnknownHostProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | [
"func",
"UnknownHost",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"UnknownHostProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
",",... | // UnknownHost returns a ProblemDetails representing an UnknownHostProblem error | [
"UnknownHost",
"returns",
"a",
"ProblemDetails",
"representing",
"an",
"UnknownHostProblem",
"error"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L237-L243 |
30,969 | letsencrypt/boulder | probs/probs.go | RateLimited | func RateLimited(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: RateLimitedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: statusTooManyRequests,
}
} | go | func RateLimited(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: RateLimitedProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: statusTooManyRequests,
}
} | [
"func",
"RateLimited",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"RateLimitedProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
",",... | // RateLimited returns a ProblemDetails representing a RateLimitedProblem error | [
"RateLimited",
"returns",
"a",
"ProblemDetails",
"representing",
"a",
"RateLimitedProblem",
"error"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L246-L252 |
30,970 | letsencrypt/boulder | probs/probs.go | TLSError | func TLSError(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: TLSProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | go | func TLSError(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: TLSProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | [
"func",
"TLSError",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"TLSProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
",",
"a",
"... | // TLSError returns a ProblemDetails representing a TLSProblem error | [
"TLSError",
"returns",
"a",
"ProblemDetails",
"representing",
"a",
"TLSProblem",
"error"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L255-L261 |
30,971 | letsencrypt/boulder | probs/probs.go | AccountDoesNotExist | func AccountDoesNotExist(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: AccountDoesNotExistProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | go | func AccountDoesNotExist(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: AccountDoesNotExistProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | [
"func",
"AccountDoesNotExist",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"AccountDoesNotExistProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
... | // AccountDoesNotExist returns a ProblemDetails representing an
// AccountDoesNotExistProblem error | [
"AccountDoesNotExist",
"returns",
"a",
"ProblemDetails",
"representing",
"an",
"AccountDoesNotExistProblem",
"error"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L265-L271 |
30,972 | letsencrypt/boulder | probs/probs.go | CAA | func CAA(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: CAAProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusForbidden,
}
} | go | func CAA(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: CAAProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusForbidden,
}
} | [
"func",
"CAA",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"CAAProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
",",
"a",
"...",... | // CAA returns a ProblemDetails representing a CAAProblem | [
"CAA",
"returns",
"a",
"ProblemDetails",
"representing",
"a",
"CAAProblem"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L274-L280 |
30,973 | letsencrypt/boulder | probs/probs.go | DNS | func DNS(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: DNSProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | go | func DNS(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: DNSProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusBadRequest,
}
} | [
"func",
"DNS",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"DNSProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
",",
"a",
"...",... | // DNS returns a ProblemDetails representing a DNSProblem | [
"DNS",
"returns",
"a",
"ProblemDetails",
"representing",
"a",
"DNSProblem"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L283-L289 |
30,974 | letsencrypt/boulder | probs/probs.go | OrderNotReady | func OrderNotReady(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: OrderNotReadyProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusForbidden,
}
} | go | func OrderNotReady(detail string, a ...interface{}) *ProblemDetails {
return &ProblemDetails{
Type: OrderNotReadyProblem,
Detail: fmt.Sprintf(detail, a...),
HTTPStatus: http.StatusForbidden,
}
} | [
"func",
"OrderNotReady",
"(",
"detail",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"*",
"ProblemDetails",
"{",
"return",
"&",
"ProblemDetails",
"{",
"Type",
":",
"OrderNotReadyProblem",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"detail",
... | // OrderNotReady returns a ProblemDetails representing a OrderNotReadyProblem | [
"OrderNotReady",
"returns",
"a",
"ProblemDetails",
"representing",
"a",
"OrderNotReadyProblem"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/probs/probs.go#L292-L298 |
30,975 | letsencrypt/boulder | mocks/ca.go | IssueCertificate | func (ca *MockCA) IssueCertificate(ctx context.Context, _ *caPB.IssueCertificateRequest) (core.Certificate, error) {
if ca.PEM == nil {
return core.Certificate{}, fmt.Errorf("MockCA's PEM field must be set before calling IssueCertificate")
}
block, _ := pem.Decode(ca.PEM)
cert, err := x509.ParseCertificate(block.... | go | func (ca *MockCA) IssueCertificate(ctx context.Context, _ *caPB.IssueCertificateRequest) (core.Certificate, error) {
if ca.PEM == nil {
return core.Certificate{}, fmt.Errorf("MockCA's PEM field must be set before calling IssueCertificate")
}
block, _ := pem.Decode(ca.PEM)
cert, err := x509.ParseCertificate(block.... | [
"func",
"(",
"ca",
"*",
"MockCA",
")",
"IssueCertificate",
"(",
"ctx",
"context",
".",
"Context",
",",
"_",
"*",
"caPB",
".",
"IssueCertificateRequest",
")",
"(",
"core",
".",
"Certificate",
",",
"error",
")",
"{",
"if",
"ca",
".",
"PEM",
"==",
"nil",
... | // IssueCertificate is a mock | [
"IssueCertificate",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/ca.go#L22-L34 |
30,976 | letsencrypt/boulder | mocks/ca.go | IssuePrecertificate | func (ca *MockCA) IssuePrecertificate(ctx context.Context, _ *caPB.IssueCertificateRequest) (*caPB.IssuePrecertificateResponse, error) {
if ca.PEM == nil {
return nil, fmt.Errorf("MockCA's PEM field must be set before calling IssueCertificate")
}
block, _ := pem.Decode(ca.PEM)
cert, err := x509.ParseCertificate(b... | go | func (ca *MockCA) IssuePrecertificate(ctx context.Context, _ *caPB.IssueCertificateRequest) (*caPB.IssuePrecertificateResponse, error) {
if ca.PEM == nil {
return nil, fmt.Errorf("MockCA's PEM field must be set before calling IssueCertificate")
}
block, _ := pem.Decode(ca.PEM)
cert, err := x509.ParseCertificate(b... | [
"func",
"(",
"ca",
"*",
"MockCA",
")",
"IssuePrecertificate",
"(",
"ctx",
"context",
".",
"Context",
",",
"_",
"*",
"caPB",
".",
"IssueCertificateRequest",
")",
"(",
"*",
"caPB",
".",
"IssuePrecertificateResponse",
",",
"error",
")",
"{",
"if",
"ca",
".",
... | // IssuePrecertificate is a mock | [
"IssuePrecertificate",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/ca.go#L37-L49 |
30,977 | letsencrypt/boulder | mocks/ca.go | IssueCertificateForPrecertificate | func (ca *MockCA) IssueCertificateForPrecertificate(ctx context.Context, req *caPB.IssueCertificateForPrecertificateRequest) (core.Certificate, error) {
return core.Certificate{DER: req.DER}, nil
} | go | func (ca *MockCA) IssueCertificateForPrecertificate(ctx context.Context, req *caPB.IssueCertificateForPrecertificateRequest) (core.Certificate, error) {
return core.Certificate{DER: req.DER}, nil
} | [
"func",
"(",
"ca",
"*",
"MockCA",
")",
"IssueCertificateForPrecertificate",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"caPB",
".",
"IssueCertificateForPrecertificateRequest",
")",
"(",
"core",
".",
"Certificate",
",",
"error",
")",
"{",
"return",
... | // IssueCertificateForPrecertificate is a mock | [
"IssueCertificateForPrecertificate",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/ca.go#L52-L54 |
30,978 | letsencrypt/boulder | mocks/ca.go | GenerateOCSP | func (ca *MockCA) GenerateOCSP(ctx context.Context, xferObj core.OCSPSigningRequest) (ocsp []byte, err error) {
return
} | go | func (ca *MockCA) GenerateOCSP(ctx context.Context, xferObj core.OCSPSigningRequest) (ocsp []byte, err error) {
return
} | [
"func",
"(",
"ca",
"*",
"MockCA",
")",
"GenerateOCSP",
"(",
"ctx",
"context",
".",
"Context",
",",
"xferObj",
"core",
".",
"OCSPSigningRequest",
")",
"(",
"ocsp",
"[",
"]",
"byte",
",",
"err",
"error",
")",
"{",
"return",
"\n",
"}"
] | // GenerateOCSP is a mock | [
"GenerateOCSP",
"is",
"a",
"mock"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mocks/ca.go#L57-L59 |
30,979 | letsencrypt/boulder | va/tlsalpn.go | tlsDial | func (va *ValidationAuthorityImpl) tlsDial(ctx context.Context, hostPort string, config *tls.Config) (*tls.Conn, error) {
ctx, cancel := context.WithTimeout(ctx, va.singleDialTimeout)
defer cancel()
dialer := &net.Dialer{}
netConn, err := dialer.DialContext(ctx, "tcp", hostPort)
if err != nil {
return nil, err
... | go | func (va *ValidationAuthorityImpl) tlsDial(ctx context.Context, hostPort string, config *tls.Config) (*tls.Conn, error) {
ctx, cancel := context.WithTimeout(ctx, va.singleDialTimeout)
defer cancel()
dialer := &net.Dialer{}
netConn, err := dialer.DialContext(ctx, "tcp", hostPort)
if err != nil {
return nil, err
... | [
"func",
"(",
"va",
"*",
"ValidationAuthorityImpl",
")",
"tlsDial",
"(",
"ctx",
"context",
".",
"Context",
",",
"hostPort",
"string",
",",
"config",
"*",
"tls",
".",
"Config",
")",
"(",
"*",
"tls",
".",
"Conn",
",",
"error",
")",
"{",
"ctx",
",",
"can... | // tlsDial does the equivalent of tls.Dial, but obeying a context. Once
// tls.DialContextWithDialer is available, switch to that. | [
"tlsDial",
"does",
"the",
"equivalent",
"of",
"tls",
".",
"Dial",
"but",
"obeying",
"a",
"context",
".",
"Once",
"tls",
".",
"DialContextWithDialer",
"is",
"available",
"switch",
"to",
"that",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/tlsalpn.go#L154-L174 |
30,980 | letsencrypt/boulder | va/va.go | NewValidationAuthorityImpl | func NewValidationAuthorityImpl(
pc *cmd.PortConfig,
resolver bdns.DNSClient,
remoteVAs []RemoteVA,
maxRemoteFailures int,
userAgent string,
issuerDomain string,
stats metrics.Scope,
clk clock.Clock,
logger blog.Logger,
accountURIPrefixes []string,
) (*ValidationAuthorityImpl, error) {
if pc.HTTPPort == 0 {
... | go | func NewValidationAuthorityImpl(
pc *cmd.PortConfig,
resolver bdns.DNSClient,
remoteVAs []RemoteVA,
maxRemoteFailures int,
userAgent string,
issuerDomain string,
stats metrics.Scope,
clk clock.Clock,
logger blog.Logger,
accountURIPrefixes []string,
) (*ValidationAuthorityImpl, error) {
if pc.HTTPPort == 0 {
... | [
"func",
"NewValidationAuthorityImpl",
"(",
"pc",
"*",
"cmd",
".",
"PortConfig",
",",
"resolver",
"bdns",
".",
"DNSClient",
",",
"remoteVAs",
"[",
"]",
"RemoteVA",
",",
"maxRemoteFailures",
"int",
",",
"userAgent",
"string",
",",
"issuerDomain",
"string",
",",
... | // NewValidationAuthorityImpl constructs a new VA | [
"NewValidationAuthorityImpl",
"constructs",
"a",
"new",
"VA"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/va.go#L160-L206 |
30,981 | letsencrypt/boulder | va/va.go | detailedError | func detailedError(err error) *probs.ProblemDetails {
// net/http wraps net.OpError in a url.Error. Unwrap them.
if urlErr, ok := err.(*url.Error); ok {
prob := detailedError(urlErr.Err)
prob.Detail = fmt.Sprintf("Fetching %s: %s", urlErr.URL, prob.Detail)
return prob
}
if tlsErr, ok := err.(tls.RecordHeader... | go | func detailedError(err error) *probs.ProblemDetails {
// net/http wraps net.OpError in a url.Error. Unwrap them.
if urlErr, ok := err.(*url.Error); ok {
prob := detailedError(urlErr.Err)
prob.Detail = fmt.Sprintf("Fetching %s: %s", urlErr.URL, prob.Detail)
return prob
}
if tlsErr, ok := err.(tls.RecordHeader... | [
"func",
"detailedError",
"(",
"err",
"error",
")",
"*",
"probs",
".",
"ProblemDetails",
"{",
"// net/http wraps net.OpError in a url.Error. Unwrap them.",
"if",
"urlErr",
",",
"ok",
":=",
"err",
".",
"(",
"*",
"url",
".",
"Error",
")",
";",
"ok",
"{",
"prob",
... | // detailedError returns a ProblemDetails corresponding to an error
// that occurred during HTTP-01 or TLS-ALPN domain validation. Specifically it
// tries to unwrap known Go error types and present something a little more
// meaningful. It additionally handles `berrors.ConnectionFailure` errors by
// passing through t... | [
"detailedError",
"returns",
"a",
"ProblemDetails",
"corresponding",
"to",
"an",
"error",
"that",
"occurred",
"during",
"HTTP",
"-",
"01",
"or",
"TLS",
"-",
"ALPN",
"domain",
"validation",
".",
"Specifically",
"it",
"tries",
"to",
"unwrap",
"known",
"Go",
"erro... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/va.go#L223-L270 |
30,982 | letsencrypt/boulder | va/va.go | validate | func (va *ValidationAuthorityImpl) validate(
ctx context.Context,
identifier core.AcmeIdentifier,
challenge core.Challenge,
authz core.Authorization,
) ([]core.ValidationRecord, *probs.ProblemDetails) {
// If the identifier is a wildcard domain we need to validate the base
// domain by removing the "*." wildcard... | go | func (va *ValidationAuthorityImpl) validate(
ctx context.Context,
identifier core.AcmeIdentifier,
challenge core.Challenge,
authz core.Authorization,
) ([]core.ValidationRecord, *probs.ProblemDetails) {
// If the identifier is a wildcard domain we need to validate the base
// domain by removing the "*." wildcard... | [
"func",
"(",
"va",
"*",
"ValidationAuthorityImpl",
")",
"validate",
"(",
"ctx",
"context",
".",
"Context",
",",
"identifier",
"core",
".",
"AcmeIdentifier",
",",
"challenge",
"core",
".",
"Challenge",
",",
"authz",
"core",
".",
"Authorization",
",",
")",
"("... | // validate performs a challenge validation and, in parallel,
// checks CAA and GSB for the identifier. If any of those steps fails, it
// returns a ProblemDetails plus the validation records created during the
// validation attempt. | [
"validate",
"performs",
"a",
"challenge",
"validation",
"and",
"in",
"parallel",
"checks",
"CAA",
"and",
"GSB",
"for",
"the",
"identifier",
".",
"If",
"any",
"of",
"those",
"steps",
"fails",
"it",
"returns",
"a",
"ProblemDetails",
"plus",
"the",
"validation",
... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/va.go#L276-L316 |
30,983 | letsencrypt/boulder | va/va.go | processRemoteResults | func (va *ValidationAuthorityImpl) processRemoteResults(
domain string,
challengeType string,
primaryResult *probs.ProblemDetails,
remoteErrors chan *probs.ProblemDetails,
numRemoteVAs int) *probs.ProblemDetails {
state := "failure"
start := va.clk.Now()
defer func() {
va.metrics.remoteValidationTime.With(p... | go | func (va *ValidationAuthorityImpl) processRemoteResults(
domain string,
challengeType string,
primaryResult *probs.ProblemDetails,
remoteErrors chan *probs.ProblemDetails,
numRemoteVAs int) *probs.ProblemDetails {
state := "failure"
start := va.clk.Now()
defer func() {
va.metrics.remoteValidationTime.With(p... | [
"func",
"(",
"va",
"*",
"ValidationAuthorityImpl",
")",
"processRemoteResults",
"(",
"domain",
"string",
",",
"challengeType",
"string",
",",
"primaryResult",
"*",
"probs",
".",
"ProblemDetails",
",",
"remoteErrors",
"chan",
"*",
"probs",
".",
"ProblemDetails",
",... | // processRemoteResults evaluates a primary VA result, and a channel of remote
// VA problems to produce a single overall validation result based on configured
// feature flags. The overall result is calculated based on the VA's configured
// `maxRemoteFailures` value.
//
// If the `MultiVAFullResults` feature is enabl... | [
"processRemoteResults",
"evaluates",
"a",
"primary",
"VA",
"result",
"and",
"a",
"channel",
"of",
"remote",
"VA",
"problems",
"to",
"produce",
"a",
"single",
"overall",
"validation",
"result",
"based",
"on",
"configured",
"feature",
"flags",
".",
"The",
"overall... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/va.go#L407-L482 |
30,984 | letsencrypt/boulder | va/va.go | logRemoteValidationDifferentials | func (va *ValidationAuthorityImpl) logRemoteValidationDifferentials(
domain string,
primaryResult *probs.ProblemDetails,
remoteProbs []*probs.ProblemDetails) {
var successes []*probs.ProblemDetails
var failures []*probs.ProblemDetails
allEqual := true
for _, e := range remoteProbs {
if e != primaryResult {
... | go | func (va *ValidationAuthorityImpl) logRemoteValidationDifferentials(
domain string,
primaryResult *probs.ProblemDetails,
remoteProbs []*probs.ProblemDetails) {
var successes []*probs.ProblemDetails
var failures []*probs.ProblemDetails
allEqual := true
for _, e := range remoteProbs {
if e != primaryResult {
... | [
"func",
"(",
"va",
"*",
"ValidationAuthorityImpl",
")",
"logRemoteValidationDifferentials",
"(",
"domain",
"string",
",",
"primaryResult",
"*",
"probs",
".",
"ProblemDetails",
",",
"remoteProbs",
"[",
"]",
"*",
"probs",
".",
"ProblemDetails",
")",
"{",
"var",
"s... | // logRemoteValidationDifferentials is called by `processRemoteResults` when the
// `MultiVAFullResults` feature flag is enabled. It produces a JSON log line
// that contains the primary VA result and the results each remote VA returned. | [
"logRemoteValidationDifferentials",
"is",
"called",
"by",
"processRemoteResults",
"when",
"the",
"MultiVAFullResults",
"feature",
"flag",
"is",
"enabled",
".",
"It",
"produces",
"a",
"JSON",
"log",
"line",
"that",
"contains",
"the",
"primary",
"VA",
"result",
"and",... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/va.go#L487-L542 |
30,985 | letsencrypt/boulder | errors/errors.go | New | func New(errType ErrorType, msg string, args ...interface{}) error {
return &BoulderError{
Type: errType,
Detail: fmt.Sprintf(msg, args...),
}
} | go | func New(errType ErrorType, msg string, args ...interface{}) error {
return &BoulderError{
Type: errType,
Detail: fmt.Sprintf(msg, args...),
}
} | [
"func",
"New",
"(",
"errType",
"ErrorType",
",",
"msg",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"return",
"&",
"BoulderError",
"{",
"Type",
":",
"errType",
",",
"Detail",
":",
"fmt",
".",
"Sprintf",
"(",
"msg",
",",
"a... | // New is a convenience function for creating a new BoulderError | [
"New",
"is",
"a",
"convenience",
"function",
"for",
"creating",
"a",
"new",
"BoulderError"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/errors/errors.go#L36-L41 |
30,986 | letsencrypt/boulder | errors/errors.go | Is | func Is(err error, errType ErrorType) bool {
bErr, ok := err.(*BoulderError)
if !ok {
return false
}
return bErr.Type == errType
} | go | func Is(err error, errType ErrorType) bool {
bErr, ok := err.(*BoulderError)
if !ok {
return false
}
return bErr.Type == errType
} | [
"func",
"Is",
"(",
"err",
"error",
",",
"errType",
"ErrorType",
")",
"bool",
"{",
"bErr",
",",
"ok",
":=",
"err",
".",
"(",
"*",
"BoulderError",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"bErr",
".",
"Type",
"... | // Is is a convenience function for testing the internal type of an BoulderError | [
"Is",
"is",
"a",
"convenience",
"function",
"for",
"testing",
"the",
"internal",
"type",
"of",
"an",
"BoulderError"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/errors/errors.go#L44-L50 |
30,987 | letsencrypt/boulder | reloader/reloader.go | New | func New(filename string, dataCallback func([]byte) error, errorCallback func(error)) (*Reloader, error) {
if errorCallback == nil {
errorCallback = func(e error) {}
}
fileInfo, err := os.Stat(filename)
if err != nil {
return nil, err
}
b, err := readFile(filename)
if err != nil {
return nil, err
}
stopC... | go | func New(filename string, dataCallback func([]byte) error, errorCallback func(error)) (*Reloader, error) {
if errorCallback == nil {
errorCallback = func(e error) {}
}
fileInfo, err := os.Stat(filename)
if err != nil {
return nil, err
}
b, err := readFile(filename)
if err != nil {
return nil, err
}
stopC... | [
"func",
"New",
"(",
"filename",
"string",
",",
"dataCallback",
"func",
"(",
"[",
"]",
"byte",
")",
"error",
",",
"errorCallback",
"func",
"(",
"error",
")",
")",
"(",
"*",
"Reloader",
",",
"error",
")",
"{",
"if",
"errorCallback",
"==",
"nil",
"{",
"... | // New loads the filename provided, and calls the callback. It then spawns a
// goroutine to check for updates to that file, calling the callback again with
// any new contents. The first load, and the first call to callback, are run
// synchronously, so it is easy for the caller to check for errors and fail
// fast. ... | [
"New",
"loads",
"the",
"filename",
"provided",
"and",
"calls",
"the",
"callback",
".",
"It",
"then",
"spawns",
"a",
"goroutine",
"to",
"check",
"for",
"updates",
"to",
"that",
"file",
"calling",
"the",
"callback",
"again",
"with",
"any",
"new",
"contents",
... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/reloader/reloader.go#L35-L84 |
30,988 | letsencrypt/boulder | va/dns.go | availableAddresses | func availableAddresses(allAddrs []net.IP) (v4 []net.IP, v6 []net.IP) {
for _, addr := range allAddrs {
if addr.To4() != nil {
v4 = append(v4, addr)
} else {
v6 = append(v6, addr)
}
}
return
} | go | func availableAddresses(allAddrs []net.IP) (v4 []net.IP, v6 []net.IP) {
for _, addr := range allAddrs {
if addr.To4() != nil {
v4 = append(v4, addr)
} else {
v6 = append(v6, addr)
}
}
return
} | [
"func",
"availableAddresses",
"(",
"allAddrs",
"[",
"]",
"net",
".",
"IP",
")",
"(",
"v4",
"[",
"]",
"net",
".",
"IP",
",",
"v6",
"[",
"]",
"net",
".",
"IP",
")",
"{",
"for",
"_",
",",
"addr",
":=",
"range",
"allAddrs",
"{",
"if",
"addr",
".",
... | // availableAddresses takes a ValidationRecord and splits the AddressesResolved
// into a list of IPv4 and IPv6 addresses. | [
"availableAddresses",
"takes",
"a",
"ValidationRecord",
"and",
"splits",
"the",
"AddressesResolved",
"into",
"a",
"list",
"of",
"IPv4",
"and",
"IPv6",
"addresses",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/dns.go#L35-L44 |
30,989 | letsencrypt/boulder | cmd/boulder-wfe2/main.go | loadCertificateFile | func loadCertificateFile(aiaIssuerURL, certFile string) ([]byte, error) {
pemBytes, err := ioutil.ReadFile(certFile)
if err != nil {
return nil, fmt.Errorf(
"CertificateChain entry for AIA issuer url %q has an "+
"invalid chain file: %q - error reading contents: %s",
aiaIssuerURL, certFile, err)
}
if by... | go | func loadCertificateFile(aiaIssuerURL, certFile string) ([]byte, error) {
pemBytes, err := ioutil.ReadFile(certFile)
if err != nil {
return nil, fmt.Errorf(
"CertificateChain entry for AIA issuer url %q has an "+
"invalid chain file: %q - error reading contents: %s",
aiaIssuerURL, certFile, err)
}
if by... | [
"func",
"loadCertificateFile",
"(",
"aiaIssuerURL",
",",
"certFile",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"pemBytes",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"certFile",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"retu... | // loadCertificateFile loads a PEM certificate from the certFile provided. It
// validates that the PEM is well-formed with no leftover bytes, and contains
// only a well-formed X509 certificate. If the cert file meets these
// requirements the PEM bytes from the file are returned, otherwise an error is
// returned. If... | [
"loadCertificateFile",
"loads",
"a",
"PEM",
"certificate",
"from",
"the",
"certFile",
"provided",
".",
"It",
"validates",
"that",
"the",
"PEM",
"is",
"well",
"-",
"formed",
"with",
"no",
"leftover",
"bytes",
"and",
"contains",
"only",
"a",
"well",
"-",
"form... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/boulder-wfe2/main.go#L88-L139 |
30,990 | letsencrypt/boulder | cmd/boulder-wfe2/main.go | loadCertificateChains | func loadCertificateChains(chainConfig map[string][]string) (map[string][]byte, error) {
results := make(map[string][]byte, len(chainConfig))
// For each AIA Issuer URL we need to read the chain cert files
for aiaIssuerURL, certFiles := range chainConfig {
var buffer bytes.Buffer
// There must be at least one ... | go | func loadCertificateChains(chainConfig map[string][]string) (map[string][]byte, error) {
results := make(map[string][]byte, len(chainConfig))
// For each AIA Issuer URL we need to read the chain cert files
for aiaIssuerURL, certFiles := range chainConfig {
var buffer bytes.Buffer
// There must be at least one ... | [
"func",
"loadCertificateChains",
"(",
"chainConfig",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
")",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"results",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"b... | // loadCertificateChains processes the provided chainConfig of AIA Issuer URLs
// and cert filenames. For each AIA issuer URL all of its cert filenames are
// read, validated as PEM certificates, and concatenated together separated by
// newlines. The combined PEM certificate chain contents for each are returned
// in ... | [
"loadCertificateChains",
"processes",
"the",
"provided",
"chainConfig",
"of",
"AIA",
"Issuer",
"URLs",
"and",
"cert",
"filenames",
".",
"For",
"each",
"AIA",
"issuer",
"URL",
"all",
"of",
"its",
"cert",
"filenames",
"are",
"read",
"validated",
"as",
"PEM",
"ce... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/boulder-wfe2/main.go#L146-L181 |
30,991 | letsencrypt/boulder | publisher/mock_publisher/mock_publisher.go | NewMockPublisher | func NewMockPublisher(ctrl *gomock.Controller) *MockPublisher {
mock := &MockPublisher{ctrl: ctrl}
mock.recorder = &MockPublisherMockRecorder{mock}
return mock
} | go | func NewMockPublisher(ctrl *gomock.Controller) *MockPublisher {
mock := &MockPublisher{ctrl: ctrl}
mock.recorder = &MockPublisherMockRecorder{mock}
return mock
} | [
"func",
"NewMockPublisher",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockPublisher",
"{",
"mock",
":=",
"&",
"MockPublisher",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockPublisherMockRecorder",
"{",
"mock",
... | // NewMockPublisher creates a new mock instance | [
"NewMockPublisher",
"creates",
"a",
"new",
"mock",
"instance"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/publisher/mock_publisher/mock_publisher.go#L26-L30 |
30,992 | letsencrypt/boulder | publisher/mock_publisher/mock_publisher.go | SubmitToSingleCTWithResult | func (m *MockPublisher) SubmitToSingleCTWithResult(arg0 context.Context, arg1 *proto.Request) (*proto.Result, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SubmitToSingleCTWithResult", arg0, arg1)
ret0, _ := ret[0].(*proto.Result)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockPublisher) SubmitToSingleCTWithResult(arg0 context.Context, arg1 *proto.Request) (*proto.Result, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SubmitToSingleCTWithResult", arg0, arg1)
ret0, _ := ret[0].(*proto.Result)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockPublisher",
")",
"SubmitToSingleCTWithResult",
"(",
"arg0",
"context",
".",
"Context",
",",
"arg1",
"*",
"proto",
".",
"Request",
")",
"(",
"*",
"proto",
".",
"Result",
",",
"error",
")",
"{",
"m",
".",
"ctrl",
".",
"T",
"... | // SubmitToSingleCTWithResult mocks base method | [
"SubmitToSingleCTWithResult",
"mocks",
"base",
"method"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/publisher/mock_publisher/mock_publisher.go#L38-L44 |
30,993 | letsencrypt/boulder | publisher/mock_publisher/mock_publisher.go | SubmitToSingleCTWithResult | func (mr *MockPublisherMockRecorder) SubmitToSingleCTWithResult(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitToSingleCTWithResult", reflect.TypeOf((*MockPublisher)(nil).SubmitToSingleCTWithResult), arg0, arg1)
} | go | func (mr *MockPublisherMockRecorder) SubmitToSingleCTWithResult(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitToSingleCTWithResult", reflect.TypeOf((*MockPublisher)(nil).SubmitToSingleCTWithResult), arg0, arg1)
} | [
"func",
"(",
"mr",
"*",
"MockPublisherMockRecorder",
")",
"SubmitToSingleCTWithResult",
"(",
"arg0",
",",
"arg1",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"mr",
".",
"mock",
".",
"ctrl",
".",
"T",
".",
"Helper",
"(",
")",
"\n",
"ret... | // SubmitToSingleCTWithResult indicates an expected call of SubmitToSingleCTWithResult | [
"SubmitToSingleCTWithResult",
"indicates",
"an",
"expected",
"call",
"of",
"SubmitToSingleCTWithResult"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/publisher/mock_publisher/mock_publisher.go#L47-L50 |
30,994 | letsencrypt/boulder | sa/sa.go | NewSQLStorageAuthority | func NewSQLStorageAuthority(
dbMap *gorp.DbMap,
clk clock.Clock,
logger blog.Logger,
scope metrics.Scope,
parallelismPerRPC int,
) (*SQLStorageAuthority, error) {
SetSQLDebug(dbMap, logger)
ssa := &SQLStorageAuthority{
dbMap: dbMap,
clk: clk,
log: logger,
parallel... | go | func NewSQLStorageAuthority(
dbMap *gorp.DbMap,
clk clock.Clock,
logger blog.Logger,
scope metrics.Scope,
parallelismPerRPC int,
) (*SQLStorageAuthority, error) {
SetSQLDebug(dbMap, logger)
ssa := &SQLStorageAuthority{
dbMap: dbMap,
clk: clk,
log: logger,
parallel... | [
"func",
"NewSQLStorageAuthority",
"(",
"dbMap",
"*",
"gorp",
".",
"DbMap",
",",
"clk",
"clock",
".",
"Clock",
",",
"logger",
"blog",
".",
"Logger",
",",
"scope",
"metrics",
".",
"Scope",
",",
"parallelismPerRPC",
"int",
",",
")",
"(",
"*",
"SQLStorageAutho... | // NewSQLStorageAuthority provides persistence using a SQL backend for
// Boulder. It will modify the given gorp.DbMap by adding relevant tables. | [
"NewSQLStorageAuthority",
"provides",
"persistence",
"using",
"a",
"SQL",
"backend",
"for",
"Boulder",
".",
"It",
"will",
"modify",
"the",
"given",
"gorp",
".",
"DbMap",
"by",
"adding",
"relevant",
"tables",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L93-L118 |
30,995 | letsencrypt/boulder | sa/sa.go | GetRegistration | func (ssa *SQLStorageAuthority) GetRegistration(ctx context.Context, id int64) (core.Registration, error) {
const query = "WHERE id = ?"
model, err := selectRegistration(ssa.dbMap.WithContext(ctx), query, id)
if err == sql.ErrNoRows {
return core.Registration{}, berrors.NotFoundError("registration with ID '%d' not... | go | func (ssa *SQLStorageAuthority) GetRegistration(ctx context.Context, id int64) (core.Registration, error) {
const query = "WHERE id = ?"
model, err := selectRegistration(ssa.dbMap.WithContext(ctx), query, id)
if err == sql.ErrNoRows {
return core.Registration{}, berrors.NotFoundError("registration with ID '%d' not... | [
"func",
"(",
"ssa",
"*",
"SQLStorageAuthority",
")",
"GetRegistration",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"int64",
")",
"(",
"core",
".",
"Registration",
",",
"error",
")",
"{",
"const",
"query",
"=",
"\"",
"\"",
"\n",
"model",
",",
"er... | // GetRegistration obtains a Registration by ID | [
"GetRegistration",
"obtains",
"a",
"Registration",
"by",
"ID"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L183-L193 |
30,996 | letsencrypt/boulder | sa/sa.go | GetRegistrationByKey | func (ssa *SQLStorageAuthority) GetRegistrationByKey(ctx context.Context, key *jose.JSONWebKey) (core.Registration, error) {
const query = "WHERE jwk_sha256 = ?"
if key == nil {
return core.Registration{}, fmt.Errorf("key argument to GetRegistrationByKey must not be nil")
}
sha, err := core.KeyDigest(key.Key)
if... | go | func (ssa *SQLStorageAuthority) GetRegistrationByKey(ctx context.Context, key *jose.JSONWebKey) (core.Registration, error) {
const query = "WHERE jwk_sha256 = ?"
if key == nil {
return core.Registration{}, fmt.Errorf("key argument to GetRegistrationByKey must not be nil")
}
sha, err := core.KeyDigest(key.Key)
if... | [
"func",
"(",
"ssa",
"*",
"SQLStorageAuthority",
")",
"GetRegistrationByKey",
"(",
"ctx",
"context",
".",
"Context",
",",
"key",
"*",
"jose",
".",
"JSONWebKey",
")",
"(",
"core",
".",
"Registration",
",",
"error",
")",
"{",
"const",
"query",
"=",
"\"",
"\... | // GetRegistrationByKey obtains a Registration by JWK | [
"GetRegistrationByKey",
"obtains",
"a",
"Registration",
"by",
"JWK"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L196-L214 |
30,997 | letsencrypt/boulder | sa/sa.go | GetAuthorization | func (ssa *SQLStorageAuthority) GetAuthorization(ctx context.Context, id string) (core.Authorization, error) {
authz := core.Authorization{}
tx, err := ssa.dbMap.Begin()
if err != nil {
return authz, err
}
txWithCtx := tx.WithContext(ctx)
pa, err := selectPendingAuthz(txWithCtx, "WHERE id = ?", id)
if err != ... | go | func (ssa *SQLStorageAuthority) GetAuthorization(ctx context.Context, id string) (core.Authorization, error) {
authz := core.Authorization{}
tx, err := ssa.dbMap.Begin()
if err != nil {
return authz, err
}
txWithCtx := tx.WithContext(ctx)
pa, err := selectPendingAuthz(txWithCtx, "WHERE id = ?", id)
if err != ... | [
"func",
"(",
"ssa",
"*",
"SQLStorageAuthority",
")",
"GetAuthorization",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"string",
")",
"(",
"core",
".",
"Authorization",
",",
"error",
")",
"{",
"authz",
":=",
"core",
".",
"Authorization",
"{",
"}",
"\... | // GetAuthorization obtains an Authorization by ID | [
"GetAuthorization",
"obtains",
"an",
"Authorization",
"by",
"ID"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L217-L253 |
30,998 | letsencrypt/boulder | sa/sa.go | GetValidAuthorizations | func (ssa *SQLStorageAuthority) GetValidAuthorizations(
ctx context.Context,
registrationID int64,
names []string,
now time.Time) (map[string]*core.Authorization, error) {
return ssa.getAuthorizations(
ctx,
authorizationTable,
string(core.StatusValid),
registrationID,
names,
now,
false)
} | go | func (ssa *SQLStorageAuthority) GetValidAuthorizations(
ctx context.Context,
registrationID int64,
names []string,
now time.Time) (map[string]*core.Authorization, error) {
return ssa.getAuthorizations(
ctx,
authorizationTable,
string(core.StatusValid),
registrationID,
names,
now,
false)
} | [
"func",
"(",
"ssa",
"*",
"SQLStorageAuthority",
")",
"GetValidAuthorizations",
"(",
"ctx",
"context",
".",
"Context",
",",
"registrationID",
"int64",
",",
"names",
"[",
"]",
"string",
",",
"now",
"time",
".",
"Time",
")",
"(",
"map",
"[",
"string",
"]",
... | // GetValidAuthorizations returns the latest authorization object for all
// domain names from the parameters that the account has authorizations for. | [
"GetValidAuthorizations",
"returns",
"the",
"latest",
"authorization",
"object",
"for",
"all",
"domain",
"names",
"from",
"the",
"parameters",
"that",
"the",
"account",
"has",
"authorizations",
"for",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L257-L270 |
30,999 | letsencrypt/boulder | sa/sa.go | incrementIP | func incrementIP(ip net.IP, index int) net.IP {
bigInt := new(big.Int)
bigInt.SetBytes([]byte(ip))
incr := new(big.Int).Lsh(big.NewInt(1), 128-uint(index))
bigInt.Add(bigInt, incr)
// bigInt.Bytes can be shorter than 16 bytes, so stick it into a
// full-sized net.IP.
resultBytes := bigInt.Bytes()
if len(resultB... | go | func incrementIP(ip net.IP, index int) net.IP {
bigInt := new(big.Int)
bigInt.SetBytes([]byte(ip))
incr := new(big.Int).Lsh(big.NewInt(1), 128-uint(index))
bigInt.Add(bigInt, incr)
// bigInt.Bytes can be shorter than 16 bytes, so stick it into a
// full-sized net.IP.
resultBytes := bigInt.Bytes()
if len(resultB... | [
"func",
"incrementIP",
"(",
"ip",
"net",
".",
"IP",
",",
"index",
"int",
")",
"net",
".",
"IP",
"{",
"bigInt",
":=",
"new",
"(",
"big",
".",
"Int",
")",
"\n",
"bigInt",
".",
"SetBytes",
"(",
"[",
"]",
"byte",
"(",
"ip",
")",
")",
"\n",
"incr",
... | // incrementIP returns a copy of `ip` incremented at a bit index `index`,
// or in other words the first IP of the next highest subnet given a mask of
// length `index`.
// In order to easily account for overflow, we treat ip as a big.Int and add to
// it. If the increment overflows the max size of a net.IP, return the... | [
"incrementIP",
"returns",
"a",
"copy",
"of",
"ip",
"incremented",
"at",
"a",
"bit",
"index",
"index",
"or",
"in",
"other",
"words",
"the",
"first",
"IP",
"of",
"the",
"next",
"highest",
"subnet",
"given",
"a",
"mask",
"of",
"length",
"index",
".",
"In",
... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L278-L292 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.