...

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

Documentation: github.com/google/go-github/v33/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  }
    20  
    21  func (p Package) String() string {
    22  	return Stringify(p)
    23  }
    24  
    25  // PackageVersion represents a GitHub package version.
    26  type PackageVersion struct {
    27  	ID                  *int64          `json:"id,omitempty"`
    28  	Version             *string         `json:"version,omitempty"`
    29  	Summary             *string         `json:"summary,omitempty"`
    30  	Body                *string         `json:"body,omitempty"`
    31  	BodyHTML            *string         `json:"body_html,omitempty"`
    32  	Release             *PackageRelease `json:"release,omitempty"`
    33  	Manifest            *string         `json:"manifest,omitempty"`
    34  	HTMLURL             *string         `json:"html_url,omitempty"`
    35  	TagName             *string         `json:"tag_name,omitempty"`
    36  	TargetCommitish     *string         `json:"target_commitish,omitempty"`
    37  	TargetOID           *string         `json:"target_oid,omitempty"`
    38  	Draft               *bool           `json:"draft,omitempty"`
    39  	Prerelease          *bool           `json:"prerelease,omitempty"`
    40  	CreatedAt           *Timestamp      `json:"created_at,omitempty"`
    41  	UpdatedAt           *Timestamp      `json:"updated_at,omitempty"`
    42  	PackageFiles        []*PackageFile  `json:"package_files,omitempty"`
    43  	Author              *User           `json:"author,omitempty"`
    44  	InstallationCommand *string         `json:"installation_command,omitempty"`
    45  }
    46  
    47  func (pv PackageVersion) String() string {
    48  	return Stringify(pv)
    49  }
    50  
    51  // PackageRelease represents a GitHub package version release.
    52  type PackageRelease struct {
    53  	URL             *string    `json:"url,omitempty"`
    54  	HTMLURL         *string    `json:"html_url,omitempty"`
    55  	ID              *int64     `json:"id,omitempty"`
    56  	TagName         *string    `json:"tag_name,omitempty"`
    57  	TargetCommitish *string    `json:"target_commitish,omitempty"`
    58  	Name            *string    `json:"name,omitempty"`
    59  	Draft           *bool      `json:"draft,omitempty"`
    60  	Author          *User      `json:"author,omitempty"`
    61  	Prerelease      *bool      `json:"prerelease,omitempty"`
    62  	CreatedAt       *Timestamp `json:"created_at,omitempty"`
    63  	PublishedAt     *Timestamp `json:"published_at,omitempty"`
    64  }
    65  
    66  func (r PackageRelease) String() string {
    67  	return Stringify(r)
    68  }
    69  
    70  // PackageFile represents a GitHub package version release file.
    71  type PackageFile struct {
    72  	DownloadURL *string    `json:"download_url,omitempty"`
    73  	ID          *int64     `json:"id,omitempty"`
    74  	Name        *string    `json:"name,omitempty"`
    75  	SHA256      *string    `json:"sha256,omitempty"`
    76  	SHA1        *string    `json:"sha1,omitempty"`
    77  	MD5         *string    `json:"md5,omitempty"`
    78  	ContentType *string    `json:"content_type,omitempty"`
    79  	State       *string    `json:"state,omitempty"`
    80  	Author      *User      `json:"author,omitempty"`
    81  	Size        *int64     `json:"size,omitempty"`
    82  	CreatedAt   *Timestamp `json:"created_at,omitempty"`
    83  	UpdatedAt   *Timestamp `json:"updated_at,omitempty"`
    84  }
    85  
    86  func (pf PackageFile) String() string {
    87  	return Stringify(pf)
    88  }
    89  
    90  // PackageRegistry represents a GitHub package registry.
    91  type PackageRegistry struct {
    92  	AboutURL *string `json:"about_url,omitempty"`
    93  	Name     *string `json:"name,omitempty"`
    94  	Type     *string `json:"type,omitempty"`
    95  	URL      *string `json:"url,omitempty"`
    96  	Vendor   *string `json:"vendor,omitempty"`
    97  }
    98  
    99  func (r PackageRegistry) String() string {
   100  	return Stringify(r)
   101  }
   102  

View as plain text