releases

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(c *gin.Context)

func GetLastID added in v0.0.5

func GetLastID(ctx context.Context, projectID, dsn, owner, repository string) (int64, error)
Example
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/itsubaki/fourkeys/handler/releases"
)

func main() {
	lastID, err := releases.GetLastID(context.Background(), os.Getenv("PROJECT_ID"), os.Getenv("DATASET_NAME"), "itsubaki", "fourkeys")
	if err != nil {
		log.Fatalf("get last release ID: %v", err)
	}

	fmt.Println(lastID > -1)

}
Output:

true

func Items added in v0.0.6

func Items(owner, repository string, tags map[string]*github.RepositoryTag, list []*github.RepositoryRelease) []interface{}
Example
package main

import (
	"fmt"

	"github.com/google/go-github/v40/github"
	"github.com/itsubaki/fourkeys/dataset"
	"github.com/itsubaki/fourkeys/handler/releases"
)

func main() {
	tags := make(map[string]*github.RepositoryTag)
	tags["v100"] = &github.RepositoryTag{
		Name: github.String("v100"),
		Commit: &github.Commit{
			SHA: github.String("1234567890"),
		},
	}

	items := releases.Items("itsubaki", "fourkeys", tags, []*github.RepositoryRelease{
		{TagName: github.String("v100")},
	})

	for _, item := range items {
		fmt.Printf("%v %v\n", item.(dataset.Release).TagName, item.(dataset.Release).TagSHA)
	}

}
Output:

v100 1234567890

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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