code.gitea.io/gitea@v1.22.3/modules/structs/miscellaneous.go (about)

     1  // Copyright 2015 The Gogs Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package structs
     5  
     6  // SearchResults results of a successful search
     7  type SearchResults struct {
     8  	OK   bool          `json:"ok"`
     9  	Data []*Repository `json:"data"`
    10  }
    11  
    12  // SearchError error of a failed search
    13  type SearchError struct {
    14  	OK    bool   `json:"ok"`
    15  	Error string `json:"error"`
    16  }
    17  
    18  // MarkupOption markup options
    19  type MarkupOption struct {
    20  	// Text markup to render
    21  	//
    22  	// in: body
    23  	Text string
    24  	// Mode to render (comment, gfm, markdown, file)
    25  	//
    26  	// in: body
    27  	Mode string
    28  	// URL path for rendering issue, media and file links
    29  	// Expected format: /subpath/{user}/{repo}/src/{branch, commit, tag}/{identifier/path}/{file/dir}
    30  	//
    31  	// in: body
    32  	Context string
    33  	// Is it a wiki page ?
    34  	//
    35  	// in: body
    36  	Wiki bool
    37  	// File path for detecting extension in file mode
    38  	//
    39  	// in: body
    40  	FilePath string
    41  }
    42  
    43  // MarkupRender is a rendered markup document
    44  // swagger:response MarkupRender
    45  type MarkupRender string
    46  
    47  // MarkdownOption markdown options
    48  type MarkdownOption struct {
    49  	// Text markdown to render
    50  	//
    51  	// in: body
    52  	Text string
    53  	// Mode to render (comment, gfm, markdown)
    54  	//
    55  	// in: body
    56  	Mode string
    57  	// URL path for rendering issue, media and file links
    58  	// Expected format: /subpath/{user}/{repo}/src/{branch, commit, tag}/{identifier/path}/{file/dir}
    59  	//
    60  	// in: body
    61  	Context string
    62  	// Is it a wiki page ?
    63  	//
    64  	// in: body
    65  	Wiki bool
    66  }
    67  
    68  // MarkdownRender is a rendered markdown document
    69  // swagger:response MarkdownRender
    70  type MarkdownRender string
    71  
    72  // ServerVersion wraps the version of the server
    73  type ServerVersion struct {
    74  	Version string `json:"version"`
    75  }
    76  
    77  // GitignoreTemplateInfo name and text of a gitignore template
    78  type GitignoreTemplateInfo struct {
    79  	Name   string `json:"name"`
    80  	Source string `json:"source"`
    81  }
    82  
    83  // LicensesListEntry is used for the API
    84  type LicensesTemplateListEntry struct {
    85  	Key  string `json:"key"`
    86  	Name string `json:"name"`
    87  	URL  string `json:"url"`
    88  }
    89  
    90  // LicensesInfo contains information about a License
    91  type LicenseTemplateInfo struct {
    92  	Key            string `json:"key"`
    93  	Name           string `json:"name"`
    94  	URL            string `json:"url"`
    95  	Implementation string `json:"implementation"`
    96  	Body           string `json:"body"`
    97  }
    98  
    99  // APIError is an api error with a message
   100  type APIError struct {
   101  	Message string `json:"message"`
   102  	URL     string `json:"url"`
   103  }