Help us shape the future of Go! Take the 2026 Go Developer Survey

github

package
v0.0.0-...-3c969ed Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client handles GitHub operations for backing up dashboards.

func NewClient

func NewClient(opts *ClientOptions) *Client

NewClient creates a new Client with authentication.

func (*Client) BackUpDashboard

func (c *Client) BackUpDashboard(ctx context.Context, namespace, name string, dashboardJSON []byte) error

BackUpDashboard backs up a dashboard to the GitHub repository.

type ClientOptions

type ClientOptions struct {
	Client     *github.Client
	Repository Repository
	Branch     string
	Directory  string
	Logger     *slog.Logger
}

ClientOptions contains options for creating a Client.

type Config

type Config struct {
	Repository Repository `yaml:"repository" validate:"required"`
	Branch     string     `yaml:"branch" validate:"required"`
	Directory  string     `yaml:"directory" validate:"required"`
	APIURL     string     `yaml:"api_url" validate:"omitempty,url"`
}

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

Repository represents a GitHub repository in "owner/repo" format.

func NewRepository

func NewRepository(owner, repo string) (*Repository, error)

NewRepository creates a new Repository with the given owner and repo. NewRepository returns an error if owner or repo is empty.

func (*Repository) Name

func (r *Repository) Name() string

Name returns the full repository name in "owner/repo" format.

func (*Repository) Owner

func (r *Repository) Owner() string

Owner returns the repository owner.

func (*Repository) Repo

func (r *Repository) Repo() string

Repo returns the repository name.

func (*Repository) UnmarshalYAML

func (r *Repository) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements yaml.Unmarshaler for parsing "owner/repo" format.

type Secrets

type Secrets struct {
	Token string `yaml:"token" json:"token" validate:"required"`
}

Jump to

Keyboard shortcuts

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