Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Point: more intuitive method for casting Point to lineprotocol string #58

Open
karel-rehor opened this issue Feb 2, 2024 · 0 comments
Assignees

Comments

@karel-rehor
Copy link
Contributor

Use Case

In testing and inspection it's often handy to get a lineprotocol representation of how a Point will be written to Influxdb. This currently can be done by creating a string from the results of the method MarshalBinary. However this is not a friendly or intuitive solution.

Expected behavior

A method with a name like ToLineprotocol would be more intuitive.
e.g.

func (p *Point) ToLineprotocol() string {
	binArr, err := p.MarshalBinary(lineprotocol.Millisecond)
	if err != nil {
		panic(err)
	}
	return string(binArr)
}

Actual behavior

Currently I need to write a similar function in a local project, though ideally it should be a method for the Point type.

Additional info

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant