Skip to content
Snippets Groups Projects
Commit 18c42cb3 authored by Neil-Jocelyn Schark's avatar Neil-Jocelyn Schark
Browse files

make methods public

parent 86534d18
No related branches found
No related tags found
3 merge requests!11Big boom integration,!10Add linting,!6Draft: Akms ckms api implementation
Pipeline #180714 failed
......@@ -87,7 +87,7 @@ func (c *DefaultAPIController) GetKey(w http.ResponseWriter, r *http.Request) {
slaveSAEIDParam := params["slave_SAE_ID"]
numberParam, err := parseNumericParameter[int64](
query.Get("number"),
WithParse[int64](parseInt64),
WithParse[int64](ParseInt64),
)
if err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
......@@ -95,7 +95,7 @@ func (c *DefaultAPIController) GetKey(w http.ResponseWriter, r *http.Request) {
}
sizeParam, err := parseNumericParameter[int64](
query.Get("size"),
WithParse[int64](parseInt64),
WithParse[int64](ParseInt64),
)
if err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
......
......@@ -139,8 +139,8 @@ type Number interface {
type ParseString[T Number | string | bool] func(v string) (T, error)
// parseFloat64 parses a string parameter to an float64.
func parseFloat64(param string) (float64, error) {
// ParseFloat64 parses a string parameter to an float64.
func ParseFloat64(param string) (float64, error) {
if param == "" {
return 0, nil
}
......@@ -148,8 +148,8 @@ func parseFloat64(param string) (float64, error) {
return strconv.ParseFloat(param, 64)
}
// parseFloat32 parses a string parameter to an float32.
func parseFloat32(param string) (float32, error) {
// ParseFloat32 parses a string parameter to an float32.
func ParseFloat32(param string) (float32, error) {
if param == "" {
return 0, nil
}
......@@ -158,8 +158,8 @@ func parseFloat32(param string) (float32, error) {
return float32(v), err
}
// parseInt64 parses a string parameter to an int64.
func parseInt64(param string) (int64, error) {
// ParseInt64 parses a string parameter to an int64.
func ParseInt64(param string) (int64, error) {
if param == "" {
return 0, nil
}
......@@ -167,8 +167,8 @@ func parseInt64(param string) (int64, error) {
return strconv.ParseInt(param, 10, 64)
}
// parseInt32 parses a string parameter to an int32.
func parseInt32(param string) (int32, error) {
// ParseInt32 parses a string parameter to an int32.
func ParseInt32(param string) (int32, error) {
if param == "" {
return 0, nil
}
......@@ -177,8 +177,8 @@ func parseInt32(param string) (int32, error) {
return int32(val), err
}
// parseBool parses a string parameter to an bool.
func parseBool(param string) (bool, error) {
// ParseBool parses a string parameter to an bool.
func ParseBool(param string) (bool, error) {
if param == "" {
return false, nil
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment