Giter Site home page Giter Site logo

microcks / microcks-go-client Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 59 KB

Go client for accessing and using Microcks API

Home Page: https://microcks.io

License: Apache License 2.0

Makefile 46.99% Go 53.01%
api-client contract-testing go microcks mocking

microcks-go-client's Introduction

GitHub Workflow Status Container Version License Project Chat

Microcks - Kubernetes native tool for API Mocking & Testing

Microcks is a platform for turning your API and microservices assets - OpenAPI specs, AsyncAPI specs, gRPC protobuf, GraphQL schema, Postman collections, SoapUI projects - into live mocks in seconds.

It also reuses these assets for running compliance and non-regression tests against your API implementation. We provide integrations with Jenkins, GitHub Actions, Tekton and many others through a simple CLI.

Getting Started

To get involved with our community, please make sure you are familiar with the project's Code of Conduct.

Build Status

The current development version is 1.10.0-SNAPSHOT. GitHub Workflow Status

Sonarcloud Quality metrics

Code Smells Reliability Rating Bugs Coverage Technical Debt Security Rating Maintainability Rating

Versions

Here are the naming conventions we're using for current releases, ongoing development maintenance activities.

Status Version Branch Container images tags
Stable 1.9.1 master 1.9.1, latest
Dev 1.10.0-SNAPSHOT 1.10.x nightly
Maintenance 1.9.2-SNAPSHOT 1.9.x maintenance

How to build Microcks

The build instructions are available in the contribution guide.

Thanks to community!

Stargazers repo roster for @microcks/microcks Forkers repo roster for @microcks/microcks

microcks-go-client's People

Contributors

julienbreux avatar lbroudoux avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

julienbreux

microcks-go-client's Issues

[feature] Initializing the new Go client

Reason/Context

Hi awesome Microcks community!

Today, I want to propose the new Go client for Microcks.

Regarding the contributing process, I start to open a new issue to describe the idea.

Description

We need a strong Go client that following the Microcks core releases.

In this vision, I'd like to propose that the new Go client be generated using the Open API schemas.

My choice was the following tool: github.com/deepmap/oapi-codegen

In addition, we need to add some helpers to facilitate the go Client usage (for example missing enums, etc)

Implementation ideas

Implementation

This is my idea of implementation: https://github.com/JulienBreux/microcks-client-go/tree/main

How to use it?

package main

import (
    "github.com/microcks/microcks-go-client"
)

const server = "http://localhost:8080/api"

fun main() {
	// Create client
	client, err := api.NewClientWithResponses(server)
	if err != nil {
		fatal(err)
	}

	// Request the Keycloak configuration
	ctx := context.Background()
	resp, err := c.actions.GetKeycloakConfigWithResponse(ctx)
	if err != nil {
		fatal(err)
	}

	// Print the response
	fmt.Printf("%+v\n\n", resp.JSON200)
}

I can also work with the owners of the Microcks project to get a much cooler package address.
For example:

import (
    "microcks.io/microcks-go-client"
)

(Just use the following meta <meta name="go-import" content="...">)

Final note

Regarding the contributing process. After validation of this feature/idea, I will create the PR (+ roadmap of others ideas (live integration testing, etc...)).

Invalid go version '1.21.3': must match format 1.23

Describe the bug

Facing a Go version conflict when simply running make on this repo:

$ make
go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen -config generate.yaml api/microcks-openapi-v1.8.yaml
go: errors parsing go.mod:
/Users/laurent/Development/github/microcks-go-client/go.mod:3: invalid go version '1.21.3': must match format 1.23
make: *** [generate-client] Error 1

Expected behavior

I expected to be able to generate something...

Actual behavior

Fails. Nothing got generated.

Here's the output of my go version:

$ go version
go version go1.20.6 darwin/arm64

How to Reproduce?

  1. Git clone the repository on main branch
  2. Execute make

Microcks version or git rev

main

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

NA

Additional information

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.