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

WebRPCServicesMap - helper variable #69

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

david-littlefarmer
Copy link

Adding WebRPCServicesMap of type map[string]map[string]struct{} for easier checking if service/method exists.

var WebRPCServicesMap = map[string]map[string]struct{}{
	"ExampleAPI": {
		"Ping":     struct{}{},
		"Status":   struct{}{},
		"GetUsers": struct{}{},
	},
}

I know about WebRPCServices but []string is not so convenient for checking if service/method exists, because of iterating of slice.

var WebRPCServices = map[string][]string{
	"ExampleAPI": {
		"Ping",
		"Status",
		"GetUsers",
	},
}

@david-littlefarmer david-littlefarmer changed the title WebRPCServicesMap - helper variabel WebRPCServicesMap - helper variable Apr 29, 2024
@david-littlefarmer david-littlefarmer marked this pull request as draft April 29, 2024 13:00
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

Successfully merging this pull request may close these issues.

None yet

1 participant