Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/selectel/craas-go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/selectel/craas-go

  • v0.2.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

craas-go: Go SDK for Container Registry Service

Go.dev reference Go Report Card Coverage Status

Package craas-go provides Go SDK to work with the Selectel Container Registry Service.

Documentation

The Go library documentation is available at go.dev.

What this library is capable of

You can use this library to work with the following objects of the Selectel Container Registry Service:

Getting started

Installation

You can install needed craas-go packages via go get command:

go get github.com/selectel/craas-go/pkg/v1/registry

Authentication

To work with the Selectel Container Registry API you first need to:

Endpoints

Selectel Container Registry Service currently has the following API endpoints:

URL
https://cr.selcloud.ru/api/v1

Usage example

package main

import (
	"context"
	"fmt"
	"log"

	v1 "github.com/selectel/craas-go/pkg"
	"github.com/selectel/craas-go/pkg/v1/registry"
	"github.com/selectel/craas-go/pkg/v1/repository"
)

func main() {
	// Token to work with Selectel Cloud project.
	token := "gAAAAABeVNzu-..."

	// CRaaS endpoint to work with.
	endpoint := "https://cr.selcloud.ru/api/v1"

	// Create a new CRaaS client.
	crClient := v1.NewCRaaSClientV1(token, endpoint)

	// Prepare empty context.
	ctx := context.Background()

	// Create a new registry.
	createdRegistry, _, err := registry.Create(ctx, crClient, "my-registry")
	if err != nil {
		log.Fatal(err)
	}

	// Print the registry fields.
	fmt.Printf("Created registry: %+v", createdRegistry)

	// Get a list of registry repositories.
	repositories, _, err := repository.ListRepositories(ctx, crClient, createdRegistry.ID)
	if err != nil {
		log.Fatal(err)
	}

	// Print the repository fields.
	for _, repo := range repositories {
		fmt.Printf("Repository: %+v", repo)
	}
}

FAQs

Package last updated on 11 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc