Use custom authentication plugin with consumer

I try to develop an authentication plugin with specific logic and already working with service and route.
How can I use custom authentication plugin (Golang, embedded server) in consumer without using built-in authentication plugin (basic-auth, key-auth, jwt etc.)