handler

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Message          string `json:"message"`
	DocumentationURL string `json:"documentaion_url"`
}

ErrorResponse is common errror response format.

type Handler

type Handler struct {
	Repo Repo
}

Handler - handle API request.

func (*Handler) GetCode

func (h *Handler) GetCode(c *gin.Context)

GetCode create GitHub Card Image.

func (*Handler) HealthCheck

func (h *Handler) HealthCheck(c *gin.Context)

HealthCheck checks health.

type Repo

type Repo interface {
	GetRepoData(ctx context.Context, userName string, repoName string) (*entity.Repo, error)
	GetUserImage(ctx context.Context, avatarURL string) (image.Image, error)
	UploadImg(img image.Image, Name string) (string, error)
}

Repo - has repository methods to separate dependencies.

type Response

type Response struct {
	Value         string `json:"value"`
	CardURL       string `json:"card_url"`
	RepositoryURL string `json:"repository_url"`
}

Response is common response format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL