dtos

package
v0.2.7-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2016 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// EmptyListJSON is the universal JSON encoding for an empty array (or list).
	EmptyListJSON = "[]"
	// JSONCharOpenArray is the character that represents the beginning of a JSON
	// array.
	JSONCharOpenArray = '['
	// JSONCharCloseArray is the character that represents the end of a JSON
	// array.
	JSONCharCloseArray = ']'
	// JSONCharArrayDelimiter is the character that separates different elements =
	// of a JSON array.
	JSONCharArrayDelimiter = ','
)
View Source
const (
	// VersionDTOTypeSemver is the type of version DTO representing a semver
	// version.
	VersionDTOTypeSemver = "semver"
	// VersionDTOTypeRefHash is the type of version DTO representing a git ref.
	VersionDTOTypeRefHash = "refhash"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GitComitCommitterDTO

type GitComitCommitterDTO struct {
	Date time.Time `json:"date"`
}

func (*GitComitCommitterDTO) MarshalJSON

func (mj *GitComitCommitterDTO) MarshalJSON() ([]byte, error)

func (*GitComitCommitterDTO) MarshalJSONBuf

func (mj *GitComitCommitterDTO) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*GitComitCommitterDTO) UnmarshalJSON

func (uj *GitComitCommitterDTO) UnmarshalJSON(input []byte) error

func (*GitComitCommitterDTO) UnmarshalJSONFFLexer

func (uj *GitComitCommitterDTO) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type GitCommitDTO

type GitCommitDTO struct {
	SHA string `json:"sha"`
}

func (*GitCommitDTO) MarshalJSON

func (mj *GitCommitDTO) MarshalJSON() ([]byte, error)

func (*GitCommitDTO) MarshalJSONBuf

func (mj *GitCommitDTO) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*GitCommitDTO) UnmarshalJSON

func (uj *GitCommitDTO) UnmarshalJSON(input []byte) error

func (*GitCommitDTO) UnmarshalJSONFFLexer

func (uj *GitCommitDTO) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type GitCommitDetailDTO

type GitCommitDetailDTO struct {
	Committer *GitComitCommitterDTO `json:"committer"`
}

func (*GitCommitDetailDTO) MarshalJSON

func (mj *GitCommitDetailDTO) MarshalJSON() ([]byte, error)

func (*GitCommitDetailDTO) MarshalJSONBuf

func (mj *GitCommitDetailDTO) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*GitCommitDetailDTO) UnmarshalJSON

func (uj *GitCommitDetailDTO) UnmarshalJSON(input []byte) error

func (*GitCommitDetailDTO) UnmarshalJSONFFLexer

func (uj *GitCommitDetailDTO) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type GitCommitLookUpDTO

type GitCommitLookUpDTO struct {
	Commit *GitCommitDetailDTO `json:"commit"`
}

func (*GitCommitLookUpDTO) MarshalJSON

func (mj *GitCommitLookUpDTO) MarshalJSON() ([]byte, error)

func (*GitCommitLookUpDTO) MarshalJSONBuf

func (mj *GitCommitLookUpDTO) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*GitCommitLookUpDTO) UnmarshalJSON

func (uj *GitCommitLookUpDTO) UnmarshalJSON(input []byte) error

func (*GitCommitLookUpDTO) UnmarshalJSONFFLexer

func (uj *GitCommitLookUpDTO) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type GitHubPackageModelDTO

type GitHubPackageModelDTO struct {
	Package      models.PackageModel
	ResponseBody map[string]interface{}
}

GitHubPackageModelDTO TODO Optimize this

type NewGitHubRepoDTO

type NewGitHubRepoDTO struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Homepage    string `json:"homepage"`
}

NewGitHubRepoDTO used as a DTO for building POST requests to Github to create new repos

func (*NewGitHubRepoDTO) MarshalJSON

func (mj *NewGitHubRepoDTO) MarshalJSON() ([]byte, error)

func (*NewGitHubRepoDTO) MarshalJSONBuf

func (mj *NewGitHubRepoDTO) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*NewGitHubRepoDTO) UnmarshalJSON

func (uj *NewGitHubRepoDTO) UnmarshalJSON(input []byte) error

func (*NewGitHubRepoDTO) UnmarshalJSONFFLexer

func (uj *NewGitHubRepoDTO) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type PackageDTO

type PackageDTO struct {
	Repo        string   `json:"repo"`
	Author      string   `json:"author"`
	Awesome     bool     `json:"awesome"`
	Versions    []string `json:"versions"`
	GodocURL    string   `json:"godocURL"`
	Description string   `json:"description"`
}

PackageDTO is the data transfer object for an individual package.

func (*PackageDTO) MarshalJSON

func (mj *PackageDTO) MarshalJSON() ([]byte, error)

func (*PackageDTO) MarshalJSONBuf

func (mj *PackageDTO) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*PackageDTO) UnmarshalJSON

func (uj *PackageDTO) UnmarshalJSON(input []byte) error

func (*PackageDTO) UnmarshalJSONFFLexer

func (uj *PackageDTO) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type PackageInstallDTO

type PackageInstallDTO struct {
	Author  string      `json:"author"`
	Repo    string      `json:"repo"`
	Version *VersionDTO `json:"version"`
}

func NewPackageInstallDTO

func NewPackageInstallDTO(author, repo, version string) *PackageInstallDTO

func (*PackageInstallDTO) MarshalJSON

func (mj *PackageInstallDTO) MarshalJSON() ([]byte, error)

func (*PackageInstallDTO) MarshalJSONBuf

func (mj *PackageInstallDTO) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*PackageInstallDTO) UnmarshalJSON

func (uj *PackageInstallDTO) UnmarshalJSON(input []byte) error

func (*PackageInstallDTO) UnmarshalJSONFFLexer

func (uj *PackageInstallDTO) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type PackageListDTO

type PackageListDTO []*PackageListItemDTO

PackageListDTO is the data transfer object for a list of PackageListItemDTOs.

func NewPackageListDTOFromPackageModelList

func NewPackageListDTOFromPackageModelList(packageModels []*models.PackageModel) PackageListDTO

NewPackageListDTOFromPackageModelList creates a new PackageListDTO from a list of package models.

func (PackageListDTO) MarshalJSON

func (dto PackageListDTO) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of the PackageListDTO.

type PackageListItemDTO

type PackageListItemDTO struct {
	Repo        string `json:"repo"`
	Author      string `json:"author"`
	Awesome     bool   `json:"awesome"`
	Description string `json:"description"`
}

PackageListItemDTO is the data transfer object for one package represented in a list of other package.

func NewPackageListItemDTO

func NewPackageListItemDTO(packageModel *models.PackageModel) *PackageListItemDTO

NewPackageListItemDTO creates a new PackageListItemDTO.

func (*PackageListItemDTO) MarshalJSON

func (mj *PackageListItemDTO) MarshalJSON() ([]byte, error)

func (*PackageListItemDTO) MarshalJSONBuf

func (mj *PackageListItemDTO) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*PackageListItemDTO) UnmarshalJSON

func (uj *PackageListItemDTO) UnmarshalJSON(input []byte) error

func (*PackageListItemDTO) UnmarshalJSONFFLexer

func (uj *PackageListItemDTO) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type VersionDTO

type VersionDTO struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

VersionDTO is the data transfer object for a package version (either semver or git ref).

func NewVersionDTO

func NewVersionDTO(versionStr string) *VersionDTO

NewVersionDTO creates a new VersionDTO.

func (*VersionDTO) MarshalJSON

func (mj *VersionDTO) MarshalJSON() ([]byte, error)

func (*VersionDTO) MarshalJSONBuf

func (mj *VersionDTO) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*VersionDTO) UnmarshalJSON

func (uj *VersionDTO) UnmarshalJSON(input []byte) error

func (*VersionDTO) UnmarshalJSONFFLexer

func (uj *VersionDTO) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type VersionListDTO

type VersionListDTO []*VersionDTO

VersionListDTO is the data transfer object for a list of VersionDTOs.

func NewVersionListDTO

func NewVersionListDTO() VersionListDTO

NewVersionListDTO creates a new VersionListDTO.

func NewVersionListDTOFromSemverCandidateList

func NewVersionListDTOFromSemverCandidateList(candidates semver.SemverCandidateList) VersionListDTO

NewVersionListDTOFromSemverCandidateList builds a VersionListDTO from a list of version candidates.

func NewVersionListDTOFromVersionStrings

func NewVersionListDTOFromVersionStrings(versionStrings []string) VersionListDTO

NewVersionListDTOFromVersionStrings builds a VersionListDTO from a list of version strings.

func (VersionListDTO) MarshalJSON

func (dto VersionListDTO) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of the VersionListDTO.

Jump to

Keyboard shortcuts

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