workload validation before registering elektron. #19

Merged
pradykaushik merged 2 commits from issues/issue-18-workload-validation into master 2019-11-26 08:08:12 +00:00
Showing only changes of commit f84f9ff5dc - Show all commits

View file

@ -24,17 +24,6 @@ import "github.com/pkg/errors"
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
// Validator is a function that performs some sort of validation.
// To keep things generic, this function does not accept any arguments.
// In practice, a validator could be a closure.
// Assume we are validating the below struct.
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
// type A struct { value string }
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
// One could then create a validator for the above struct like this:
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
// func AValidator(a A) Validator {
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
// return func() error {
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
// if a.value == "" {
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
// return errors.New("invalid value")
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
// }
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
// return nil
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
// }
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
// }
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
type Validator func() error
// Validate a list of validators.

ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.
ridv commented 2019-11-25 22:54:02 +00:00 (Migrated from github.com)

Do we need to keep this around?

Do we need to keep this around?
pradykaushik commented 2019-11-26 07:59:30 +00:00 (Migrated from github.com)

Yeah, the example might be an overkill. I'll get rid of it.

Yeah, the example might be an overkill. I'll get rid of it.