api

package
v0.0.0-...-8c30691 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNowReleaseProcessing

func CheckNowReleaseProcessing(settingPath string, serviceName string) bool

リリース処理中かどうか確認

func EcrClient

func EcrClient(region string) (*ecr.Client, error)

ECR クライアント生成

func EcrDescribeImages

func EcrDescribeImages(ctx context.Context, api EcrDescribeImagesAPI, repositoryName string, registryId string) ([]types.ImageDetail, error)

func EcrListImages

func EcrListImages(ctx context.Context, api EcrListImagesAPI, repositoryName string, registryId string) ([]types.ImageIdentifier, error)

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func ImageTag

func ImageTag(ids []types.ImageIdentifier, tags []string, digest string) string

対象のイメージタグを検索

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func RegisterHandlers

func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine

RegisterHandlersWithOptions creates http.Handler with additional options

func RemoveSetting

func RemoveSetting(settingPath string, cronPath string, cronCmd string, serviceName string) error

設定削除

func UpdateSetting

func UpdateSetting(settingPath string, cronPath string, cronCmd string, cronLog string, serviceName string, setting *Setting) error

設定書き込み(上書き)

Types

type ECRAPI

type ECRAPI interface {
	EcrListImagesAPI
	EcrDescribeImagesAPI
}

ECR API interface

type EcrDescribeImagesAPI

type EcrDescribeImagesAPI interface {
	DescribeImages(ctx context.Context, params *ecr.DescribeImagesInput, optFns ...func(*ecr.Options)) (*ecr.DescribeImagesOutput, error)
}

ECR DescribeImages

type EcrListImagesAPI

type EcrListImagesAPI interface {
	ListImages(ctx context.Context, params *ecr.ListImagesInput, optFns ...func(*ecr.Options)) (*ecr.ListImagesOutput, error)
}

ECR ListImages

type Error

type Error struct {
	Message string `json:"message"`
}

Error エラーメッセージモデル

type ErrorResponse

type ErrorResponse = Error

ErrorResponse エラーメッセージモデル

type GinServerOptions

type GinServerOptions struct {
	BaseURL      string
	Middlewares  []MiddlewareFunc
	ErrorHandler func(*gin.Context, error, int)
}

GinServerOptions provides options for the Gin server.

type Image

type Image struct {
	Digest         string    `json:"digest"`
	PushedAt       time.Time `json:"pushed_at"`
	RepositoryName string    `json:"repository_name"`
	Size           float32   `json:"size"`
	Tags           []string  `json:"tags"`
	Uri            string    `json:"uri"`
}

Image コンテナイメージモデル

func GetImageList

func GetImageList(imageIds []types.ImageIdentifier, imageDetails []types.ImageDetail, repositoryName string, repositoryUri string) []Image

ImageList を取得

func ImageList

func ImageList(ctx context.Context, api ECRAPI, repositoryName string, registryId string, repositoryUri string) ([]Image, error)

ECR リポジトリ内イメージ一覧取得

type ImagesResponse

type ImagesResponse = []Image

ImagesResponse defines model for imagesResponse.

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type PostSettingJSONRequestBody

type PostSettingJSONRequestBody = Setting

PostSettingJSONRequestBody defines body for PostSetting for application/json ContentType.

type RepositoriesResponse

type RepositoriesResponse = []Repository

RepositoriesResponse defines model for repositoriesResponse.

type Repository

type Repository struct {
	Name string `json:"name"`
	Uri  string `json:"uri"`
}

Repository リポジトリモデル

func RepositoryList

func RepositoryList(settingPath string, serviceName string) []Repository

サービスのリポジトリ一覧取得

type RepositoryItem

type RepositoryItem struct {
	RegistryId string
	Uri        string
}

type RepositoryKey

type RepositoryKey struct {
	ServiceName    string
	RepositoryName string
}

type RepositoryName

type RepositoryName = string

RepositoryName defines model for repository_name.

type SelectRepository

type SelectRepository struct {
	ServiceName        []string
	RepositoryMap      map[string][]Repository
	RepositoryMap2d    map[RepositoryKey]RepositoryItem
	ServiceSettingPath string
	CronPath           string
	CronCmd            string
	CronLog            string
}

func NewSelectRepository

func NewSelectRepository(workDir string, cronPath string, cronCmd string, cronLog string) *SelectRepository

func ReadConfig

func ReadConfig(workDir string, cronPath string, cronCmd string, cronLog string) *SelectRepository

func (*SelectRepository) DeleteSetting

func (s *SelectRepository) DeleteSetting(c *gin.Context, serviceName ServiceName)

リリース設定の削除(リリース取り消し)

func (*SelectRepository) GetImages

func (s *SelectRepository) GetImages(c *gin.Context, serviceName ServiceName, repositoryName RepositoryName)

コンテナイメージ一覧の取得

func (*SelectRepository) GetRepositories

func (s *SelectRepository) GetRepositories(c *gin.Context, serviceName ServiceName)

リポジトリ一覧の取得

func (*SelectRepository) GetServices

func (s *SelectRepository) GetServices(c *gin.Context)

コンテナサービス一覧の取得

func (*SelectRepository) GetSetting

func (s *SelectRepository) GetSetting(c *gin.Context, serviceName ServiceName)

リリース設定の取得

func (*SelectRepository) PostSetting

func (s *SelectRepository) PostSetting(c *gin.Context, serviceName ServiceName)

リリース設定の生成・更新

type ServerInterface

type ServerInterface interface {
	// コンテナイメージ一覧の取得
	// (GET /images/{service_name}/{repository_name})
	GetImages(c *gin.Context, serviceName ServiceName, repositoryName RepositoryName)
	// リポジトリ一覧の取得
	// (GET /repositories/{service_name})
	GetRepositories(c *gin.Context, serviceName ServiceName)
	// コンテナサービス一覧の取得
	// (GET /services)
	GetServices(c *gin.Context)
	// リリース設定の削除
	// (DELETE /setting/{service_name})
	DeleteSetting(c *gin.Context, serviceName ServiceName)
	// リリース設定の取得
	// (GET /setting/{service_name})
	GetSetting(c *gin.Context, serviceName ServiceName)
	// リリース設定の生成・更新
	// (POST /setting/{service_name})
	PostSetting(c *gin.Context, serviceName ServiceName)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandler       func(*gin.Context, error, int)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) DeleteSetting

func (siw *ServerInterfaceWrapper) DeleteSetting(c *gin.Context)

DeleteSetting operation middleware

func (*ServerInterfaceWrapper) GetImages

func (siw *ServerInterfaceWrapper) GetImages(c *gin.Context)

GetImages operation middleware

func (*ServerInterfaceWrapper) GetRepositories

func (siw *ServerInterfaceWrapper) GetRepositories(c *gin.Context)

GetRepositories operation middleware

func (*ServerInterfaceWrapper) GetServices

func (siw *ServerInterfaceWrapper) GetServices(c *gin.Context)

GetServices operation middleware

func (*ServerInterfaceWrapper) GetSetting

func (siw *ServerInterfaceWrapper) GetSetting(c *gin.Context)

GetSetting operation middleware

func (*ServerInterfaceWrapper) PostSetting

func (siw *ServerInterfaceWrapper) PostSetting(c *gin.Context)

PostSetting operation middleware

type Service

type Service struct {
	Name string `json:"name"`
}

Service サービスモデル

type ServiceName

type ServiceName = string

ServiceName defines model for service_name.

type ServicesResponse

type ServicesResponse = []Service

ServicesResponse defines model for servicesResponse.

type Setting

type Setting struct {
	ImageUri   *string    `json:"image_uri,omitempty"`
	IsReleased bool       `json:"is_released"`
	ReleaseAt  *time.Time `json:"release_at,omitempty"`
}

Setting リリース設定モデル

func ReadSetting

func ReadSetting(settingPath string, serviceName string) Setting

設定読み込み

type SettingItems

type SettingItems struct {
	ImageUri  string
	ReleaseAt time.Time
}

func ReadSettingFromFile

func ReadSettingFromFile(settingFile string) (*SettingItems, error)

指定ファイルから設定を取得

type SettingRequest

type SettingRequest = Setting

SettingRequest リリース設定モデル

Jump to

Keyboard shortcuts

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