How to implement external integration

I want to write an extension in go that should provide some external data. How should I go about it? Would that be a new connection type? Or can it be handled somehow by custom automation functions? I haven’t found any good explanations in docs for adding external integration.