...

Text file src/github.com/openshift/client-go/INSTALL.md

Documentation: github.com/openshift/client-go

     1# Installing client-go
     2It is described here how to include the APIs provided by this repo into
     3your (GoLang-)project. If it is desired to compile and run examples in
     4the context of this repo, follow the README files in the example folders.
     5
     6## Dependency management
     7
     8### Glide
     9
    10[Glide](https://github.com/Masterminds/glide) is a popular dependency
    11management tool for Go. Here we describe steps which are similar to
    12[k8s client-go](https://github.com/kubernetes/client-go/blob/master/INSTALL.md).
    13
    14
    15First create a `glide.yaml` file at the root of your project:
    16
    17```yaml
    18package: ( your project's import path ) # e.g. github.com/foo/bar
    19import:
    20- package: github.com/openshift/client-go
    21  #version: xxx #you can specify the version if needed
    22```
    23
    24Second, add a Go file that imports `client-go` somewhere in your project,
    25otherwise `client-go`'s dependencies will not be added to your project's
    26vendor/. Then run the following command in the same directory as `glide.yaml`:
    27
    28```sh
    29$ glide update --strip-vendor
    30### Or, for short
    31$ glide up -v
    32```
    33
    34At this point, `k8s.io/client-go` should be added to your project's vendor/.
    35`client-go`'s dependencies should be flattened and be added to your project's
    36vendor/ as well.

View as plain text