...

Source file src/github.com/google/go-github/v47/github/packages.go

Documentation: github.com/google/go-github/v47/github

     1  // Copyright 2020 The go-github AUTHORS. All rights reserved.
     2  //
     3  // Use of this source code is governed by a BSD-style
     4  // license that can be found in the LICENSE file.
     5  
     6  package github
     7  
     8  // Package represents a GitHub package.
     9  type Package struct {
    10  	ID             *int64           `json:"id,omitempty"`
    11  	Name           *string          `json:"name,omitempty"`
    12  	PackageType    *string          `json:"package_type,omitempty"`
    13  	HTMLURL        *string          `json:"html_url,omitempty"`
    14  	CreatedAt      *Timestamp       `json:"created_at,omitempty"`
    15  	UpdatedAt      *Timestamp       `json:"updated_at,omitempty"`
    16  	Owner          *User            `json:"owner,omitempty"`
    17  	PackageVersion *PackageVersion  `json:"package_version,omitempty"`
    18  	Registry       *PackageRegistry `json:"registry,omitempty"`
    19  	URL            *string          `json:"url,omitempty"`
    20  	VersionCount   *int64           `json:"version_count,omitempty"`
    21  	Visibility     *string          `json:"visibility,omitempty"`
    22  	Repository     *Repository      `json:"repository,omitempty"`
    23  }
    24  
    25  func (p Package) String() string {
    26  	return Stringify(p)
    27  }
    28  
    29  // PackageVersion represents a GitHub package version.
    30  type PackageVersion struct {
    31  	ID                  *int64           `json:"id,omitempty"`
    32  	Version             *string          `json:"version,omitempty"`
    33  	Summary             *string          `json:"summary,omitempty"`
    34  	Body                *string          `json:"body,omitempty"`
    35  	BodyHTML            *string          `json:"body_html,omitempty"`
    36  	Release             *PackageRelease  `json:"release,omitempty"`
    37  	Manifest            *string          `json:"manifest,omitempty"`
    38  	HTMLURL             *string          `json:"html_url,omitempty"`
    39  	TagName             *string          `json:"tag_name,omitempty"`
    40  	TargetCommitish     *string          `json:"target_commitish,omitempty"`
    41  	TargetOID           *string          `json:"target_oid,omitempty"`
    42  	Draft               *bool            `json:"draft,omitempty"`
    43  	Prerelease          *bool            `json:"prerelease,omitempty"`
    44  	CreatedAt           *Timestamp       `json:"created_at,omitempty"`
    45  	UpdatedAt           *Timestamp       `json:"updated_at,omitempty"`
    46  	PackageFiles        []*PackageFile   `json:"package_files,omitempty"`
    47  	Author              *User            `json:"author,omitempty"`
    48  	InstallationCommand *string          `json:"installation_command,omitempty"`
    49  	Metadata            *PackageMetadata `json:"metadata,omitempty"`
    50  	PackageHTMLURL      *string          `json:"package_html_url,omitempty"`
    51  	Name                *string          `json:"name,omitempty"`
    52  	URL                 *string          `json:"url,omitempty"`
    53  }
    54  
    55  func (pv PackageVersion) String() string {
    56  	return Stringify(pv)
    57  }
    58  
    59  // PackageRelease represents a GitHub package version release.
    60  type PackageRelease struct {
    61  	URL             *string    `json:"url,omitempty"`
    62  	HTMLURL         *string    `json:"html_url,omitempty"`
    63  	ID              *int64     `json:"id,omitempty"`
    64  	TagName         *string    `json:"tag_name,omitempty"`
    65  	TargetCommitish *string    `json:"target_commitish,omitempty"`
    66  	Name            *string    `json:"name,omitempty"`
    67  	Draft           *bool      `json:"draft,omitempty"`
    68  	Author          *User      `json:"author,omitempty"`
    69  	Prerelease      *bool      `json:"prerelease,omitempty"`
    70  	CreatedAt       *Timestamp `json:"created_at,omitempty"`
    71  	PublishedAt     *Timestamp `json:"published_at,omitempty"`
    72  }
    73  
    74  func (r PackageRelease) String() string {
    75  	return Stringify(r)
    76  }
    77  
    78  // PackageFile represents a GitHub package version release file.
    79  type PackageFile struct {
    80  	DownloadURL *string    `json:"download_url,omitempty"`
    81  	ID          *int64     `json:"id,omitempty"`
    82  	Name        *string    `json:"name,omitempty"`
    83  	SHA256      *string    `json:"sha256,omitempty"`
    84  	SHA1        *string    `json:"sha1,omitempty"`
    85  	MD5         *string    `json:"md5,omitempty"`
    86  	ContentType *string    `json:"content_type,omitempty"`
    87  	State       *string    `json:"state,omitempty"`
    88  	Author      *User      `json:"author,omitempty"`
    89  	Size        *int64     `json:"size,omitempty"`
    90  	CreatedAt   *Timestamp `json:"created_at,omitempty"`
    91  	UpdatedAt   *Timestamp `json:"updated_at,omitempty"`
    92  }
    93  
    94  func (pf PackageFile) String() string {
    95  	return Stringify(pf)
    96  }
    97  
    98  // PackageRegistry represents a GitHub package registry.
    99  type PackageRegistry struct {
   100  	AboutURL *string `json:"about_url,omitempty"`
   101  	Name     *string `json:"name,omitempty"`
   102  	Type     *string `json:"type,omitempty"`
   103  	URL      *string `json:"url,omitempty"`
   104  	Vendor   *string `json:"vendor,omitempty"`
   105  }
   106  
   107  func (r PackageRegistry) String() string {
   108  	return Stringify(r)
   109  }
   110  
   111  // PackageListOptions represents the optional list options for a package.
   112  type PackageListOptions struct {
   113  	// Visibility of packages "public", "internal" or "private".
   114  	Visibility *string `url:"visibility,omitempty"`
   115  
   116  	// PackageType represents the type of package.
   117  	// It can be one of "npm", "maven", "rubygems", "nuget", "docker", or "container".
   118  	PackageType *string `url:"package_type,omitempty"`
   119  
   120  	// State of package either "active" or "deleted".
   121  	State *string `url:"state,omitempty"`
   122  
   123  	ListOptions
   124  }
   125  
   126  // PackageMetadata represents metadata from a package.
   127  type PackageMetadata struct {
   128  	PackageType *string                   `json:"package_type,omitempty"`
   129  	Container   *PackageContainerMetadata `json:"container,omitempty"`
   130  }
   131  
   132  func (r PackageMetadata) String() string {
   133  	return Stringify(r)
   134  }
   135  
   136  // PackageContainerMetadata represents container metadata for docker container packages.
   137  type PackageContainerMetadata struct {
   138  	Tags []string `json:"tags,omitempty"`
   139  }
   140  
   141  func (r PackageContainerMetadata) String() string {
   142  	return Stringify(r)
   143  }
   144  

View as plain text