Unexport client fields
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
8cd882c570
commit
e2db2892ec
14
client.go
14
client.go
@ -44,7 +44,7 @@ type NewClientOpts func(c *Client) error
|
|||||||
|
|
||||||
func WithNamespace(namespace string) NewClientOpts {
|
func WithNamespace(namespace string) NewClientOpts {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
c.Namespace = namespace
|
c.namespace = namespace
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -63,7 +63,7 @@ func New(address string, opts ...NewClientOpts) (*Client, error) {
|
|||||||
}
|
}
|
||||||
c := &Client{
|
c := &Client{
|
||||||
conn: conn,
|
conn: conn,
|
||||||
Runtime: runtime.GOOS,
|
runtime: runtime.GOOS,
|
||||||
}
|
}
|
||||||
for _, o := range opts {
|
for _, o := range opts {
|
||||||
if err := o(c); err != nil {
|
if err := o(c); err != nil {
|
||||||
@ -78,8 +78,8 @@ func New(address string, opts ...NewClientOpts) (*Client, error) {
|
|||||||
type Client struct {
|
type Client struct {
|
||||||
conn *grpc.ClientConn
|
conn *grpc.ClientConn
|
||||||
|
|
||||||
Runtime string
|
runtime string
|
||||||
Namespace string
|
namespace string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Containers returns all containers created in containerd
|
// Containers returns all containers created in containerd
|
||||||
@ -97,8 +97,8 @@ func (c *Client) Containers(ctx context.Context) ([]*Container, error) {
|
|||||||
|
|
||||||
type NewContainerOpts func(ctx context.Context, client *Client, c *containers.Container) error
|
type NewContainerOpts func(ctx context.Context, client *Client, c *containers.Container) error
|
||||||
|
|
||||||
// WithContainerLables adds the provided labels to the container
|
// WithContainerLabels adds the provided labels to the container
|
||||||
func WithContainerLables(labels map[string]string) NewContainerOpts {
|
func WithContainerLabels(labels map[string]string) NewContainerOpts {
|
||||||
return func(_ context.Context, _ *Client, c *containers.Container) error {
|
return func(_ context.Context, _ *Client, c *containers.Container) error {
|
||||||
c.Labels = labels
|
c.Labels = labels
|
||||||
return nil
|
return nil
|
||||||
@ -165,7 +165,7 @@ func (c *Client) NewContainer(ctx context.Context, id string, spec *specs.Spec,
|
|||||||
}
|
}
|
||||||
container := containers.Container{
|
container := containers.Container{
|
||||||
ID: id,
|
ID: id,
|
||||||
Runtime: c.Runtime,
|
Runtime: c.runtime,
|
||||||
Spec: &protobuf.Any{
|
Spec: &protobuf.Any{
|
||||||
TypeUrl: specs.Version,
|
TypeUrl: specs.Version,
|
||||||
Value: data,
|
Value: data,
|
||||||
|
Loading…
Reference in New Issue
Block a user