Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadCfgProto

func DownloadCfgProto(ctx context.Context, client gitiles.GitilesClient, project, committish, path string, msg proto.Message) error

    DownloadCfgProto downloads the config data in proto.Message.

    func GetCachedCfgByIds

    func GetCachedCfgByIds(ctx context.Context, entities []EntityInterface) ([]proto.Message, error)

      GetCachedCfgByIds gets the cached config from datastore by Ids.

      func NewGitilesClient

      func NewGitilesClient(ctx context.Context, host string) (gitiles.GitilesClient, error)

        NewGitilesClient returns a gitiles client to access the device config data.

        func SyncProtoToDatastore

        func SyncProtoToDatastore(ctx context.Context, cfgs []proto.Message, entityBuider func(proto.Message) (EntityInterface, error)) error

          SyncProtoToDatastore save the input proto messages to datastore as proper entities.

          Types

          type EntityInterface

          type EntityInterface interface {
          	SetUpdatedTime(time.Time)
          	GetMessagePayload() (proto.Message, error)
          	GetID() string
          }

            EntityInterface is the interface that entities can sync with cfg file in git repo.

            Source Files