github.com/kotalco/kotal@v0.3.0/clients/graph/graph_node_client.go (about)

     1  package graph
     2  
     3  import (
     4  	graphv1alpha1 "github.com/kotalco/kotal/apis/graph/v1alpha1"
     5  	corev1 "k8s.io/api/core/v1"
     6  )
     7  
     8  // GraphNodeClient is graph node client
     9  // https://github.com/graphprotocol/graph-node
    10  type GraphNodeClient struct {
    11  	node *graphv1alpha1.Node
    12  }
    13  
    14  // Images
    15  const (
    16  	// GraphNodeHomeDir is Graph node image home dir
    17  	// TODO: update home dir after creating a new docker image
    18  	GraphNodeHomeDir = "/root"
    19  )
    20  
    21  // Command returns environment variables for the client
    22  func (c *GraphNodeClient) Env() (env []corev1.EnvVar) {
    23  	return
    24  }
    25  
    26  // Command is Graph node client entrypoint
    27  func (c *GraphNodeClient) Command() (command []string) {
    28  
    29  	command = append(command, GraphNodeCommand)
    30  
    31  	return
    32  }
    33  
    34  // Args returns Graph node client args
    35  func (c *GraphNodeClient) Args() (args []string) {
    36  	_ = c.node
    37  
    38  	return
    39  }
    40  
    41  // HomeDir is the home directory of Graph node client image
    42  func (c *GraphNodeClient) HomeDir() string {
    43  	return GraphNodeHomeDir
    44  }