solo-kit

command module
v0.35.5 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

solo-kit

A collection of code generation and libraries to for API development.

Description:
  • Define your declarative API in .proto files
  • APIs are defined by top-level protobuf messages in .proto files
  • Run Solo Kit's code generation and import generated files as libraries into your application.
  • These libraries provide an opinionated suite of tools for building a stateless, event-driven application.
  • Currently only Go is supported, but other languages may be supported in the future.
  • We are looking for community feedback and support!
Examples

See test/mock_resources.proto for an example of how to use solo-kit. These protos are generated using the root level generate.go file.

Build

  • clone repo locally
  • gather dependencies: go mod download
  • import cmd.Run(...) into your own code gen code

Usage

  • re-run whenever you change or add an api (.proto file)
  • api objects generated from messages defined in protobuf messages which have the following requirements fulfilled:
    • option (core.solo.io.resource).short_name = "mk";
      option (core.solo.io.resource).plural_name = "mocks";
      core.solo.io.Metadata metadata = 7;
      // Optional
      core.solo.io.Status status = 6 [(extproto.skip_hashing) = true];
      
  • run solo-kit-gen recursively at the root of an api directory containing one or more solo-kit.json files
  • generated files have the .sk.go suffix (generated test files do not include this suffix)

upgrading to v0.12.0 (solo-kit with go.mod)

As of go 1.11, go began introducing support for go modules, its dependency management system. As of solo-kit 0.12.0 we will officially support running solo-kit with go.mod outside of the GOPATH.

This change has been a lot time coming, but it also means a few changes to solo-kit.

As there is no more GOPATH, we cannot rely on the GOPATH as a method of vendoring/importing .proto files. This means that we needed a new way to reliably import protos outside of the GOPATH. Therefore we created protodep. More information on that can be found here.

Chief among the new changes is that the local vendor_any folder has become the solo-kit source of truth for both .proto files, and solo-kit.json files. The GenerateOptions struct now takes in a protodep config. An example of this can be found in generate.go. This is how solo-kit know how to vendor in the protos it needs to run. If this config is nil a warning will be printed, as technically this is valid, but will most likely lead to an error.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
ci
pkg
api/v1/clients/kube/crd/client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
api/v1/clients/kube/crd/client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
api/v1/clients/kube/crd/client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
api/v1/clients/kube/crd/client/clientset/versioned/typed/solo.io/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
api/v1/clients/kube/crd/client/clientset/versioned/typed/solo.io/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
api/v1/clients/kube/crd/solo.io/v1
Package v1 is the v1 version of the API.
Package v1 is the v1 version of the API.
api/v1/clients/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
api/v1/clients/wrapper/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
api/v1/control-plane/cache
Package cache defines a configuration cache for the server.
Package cache defines a configuration cache for the server.
api/v1/control-plane/log
Package log provides a logging interface for use in this library.
Package log provides a logging interface for use in this library.
api/v1/control-plane/server
Package server provides an implementation of a streaming xDS server.
Package server provides an implementation of a streaming xDS server.
api/v1/resources/common/kubernetes/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
test
mocks/v1/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks/v1alpha1/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks/v2alpha1/kube/apis/testing.solo.io/v2alpha1
Package v2alpha1 is the v2alpha1 version of the API.
Package v2alpha1 is the v2alpha1 version of the API.
mocks/v2alpha1/kube/client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
mocks/v2alpha1/kube/client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
mocks/v2alpha1/kube/client/clientset/versioned/typed/testing.solo.io/v2alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
mocks/v2alpha1/kube/client/clientset/versioned/typed/testing.solo.io/v2alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
mocks/v2alpha1/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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