mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 10:12:06 +03:00
2ab6381a94
Included in the changes: - create a new /api root package to hold all API code, migrate /graphql in there - git API handlers all use the cache instead of the repo directly - git API handlers are now tested - git API handlers now require a "repo" mux parameter - lots of untangling of API/handlers/middleware - less code in commands/webui.go
25 lines
487 B
Go
25 lines
487 B
Go
package resolvers
|
|
|
|
import (
|
|
"context"
|
|
"image/color"
|
|
|
|
"github.com/MichaelMure/git-bug/api/graphql/graph"
|
|
)
|
|
|
|
var _ graph.ColorResolver = &colorResolver{}
|
|
|
|
type colorResolver struct{}
|
|
|
|
func (colorResolver) R(_ context.Context, obj *color.RGBA) (int, error) {
|
|
return int(obj.R), nil
|
|
}
|
|
|
|
func (colorResolver) G(_ context.Context, obj *color.RGBA) (int, error) {
|
|
return int(obj.G), nil
|
|
}
|
|
|
|
func (colorResolver) B(_ context.Context, obj *color.RGBA) (int, error) {
|
|
return int(obj.B), nil
|
|
}
|