summaryrefslogtreecommitdiffstats
path: root/modules/structs/miscellaneous.go
blob: bff10f95b7c558ae3f8b94bf926fad555b6f0fdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Copyright 2015 The Gogs Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package structs

// SearchResults results of a successful search
type SearchResults struct {
	OK   bool          `json:"ok"`
	Data []*Repository `json:"data"`
}

// SearchError error of a failed search
type SearchError struct {
	OK    bool   `json:"ok"`
	Error string `json:"error"`
}

// MarkupOption markup options
type MarkupOption struct {
	// Text markup to render
	//
	// in: body
	Text string
	// Mode to render (comment, gfm, markdown, file)
	//
	// in: body
	Mode string
	// Context to render
	//
	// in: body
	Context string
	// Is it a wiki page ?
	//
	// in: body
	Wiki bool
	// File path for detecting extension in file mode
	//
	// in: body
	FilePath string
}

// MarkupRender is a rendered markup document
// swagger:response MarkupRender
type MarkupRender string

// MarkdownOption markdown options
type MarkdownOption struct {
	// Text markdown to render
	//
	// in: body
	Text string
	// Mode to render (comment, gfm, markdown)
	//
	// in: body
	Mode string
	// Context to render
	//
	// in: body
	Context string
	// Is it a wiki page ?
	//
	// in: body
	Wiki bool
}

// MarkdownRender is a rendered markdown document
// swagger:response MarkdownRender
type MarkdownRender string

// ServerVersion wraps the version of the server
type ServerVersion struct {
	Version string `json:"version"`
}

// GitignoreTemplateInfo name and text of a gitignore template
type GitignoreTemplateInfo struct {
	Name   string `json:"name"`
	Source string `json:"source"`
}

// LicensesListEntry is used for the API
type LicensesTemplateListEntry struct {
	Key  string `json:"key"`
	Name string `json:"name"`
	URL  string `json:"url"`
}

// LicensesInfo contains information about a License
type LicenseTemplateInfo struct {
	Key            string `json:"key"`
	Name           string `json:"name"`
	URL            string `json:"url"`
	Implementation string `json:"implementation"`
	Body           string `json:"body"`
}

// APIError is an api error with a message
type APIError struct {
	Message string `json:"message"`
	URL     string `json:"url"`
}