Skip to content

About yaml-parse #10

@slayercat

Description

@slayercat

We now have stats, stats-job, stats-tube. which returns yaml strings.

But from a user perspective, we do not want to deal with yaml. We want data wraped in yaml, not yaml itself.

To achieve this, I have API modification related problem and Implementation-related problem

API modification related problem

Which one looks good to you?

  1. provides a new api, which returns a dict.
parsed_item, err := beanstalkc_conn.StatsTube_Parsed("default")
  1. Modify the existing API definition.
    2a)
parsed_item, err := beanstalkc_conn.StatsTube("default", func(_ string) map[string]interface{} {
    panic("do something")
})

2b)

    parsed_item, err:= beanstalkc_conn.StatsTube("default")

Implementation-related problem

Which one looks good to you?

Of course. If you prefer 2a, we can leave this to users to decide.

  1. use https://github.com/kr/beanstalk/blob/master/parse.go
    This will not have any dependence introduced. and since kr used that, It shall looks good to us.

  2. use https://github.com/go-yaml/yaml
    A huge but seems well-tested library

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions