Documentation
¶
Index ¶
- type Config
- type Core
- func (c *Core) AddMeta(ms ...*api.Meta) error
- func (c *Core) AddRepository(repos ...api.Repository) error
- func (c *Core) CloseMongoSession()
- func (c *Core) FindMeta(query interface{}) *mgo.Query
- func (c *Core) FindRepository(query interface{}) *mgo.Query
- func (c *Core) GetContainerLogs(ctx context.Context, opts LogsOptions) error
- func (c *Core) GetMeta(name string) (*api.Meta, error)
- func (c *Core) GetRepository(name string) (*api.Repository, error)
- func (c *Core) GetSize(dir string) int64
- func (c *Core) InitMetas()
- func (c *Core) ListAllMetas() []api.Meta
- func (c *Core) ListAllRepositories() []api.Repository
- func (c *Core) ListContainers(ctx context.Context, filter map[string][]string) ([]types.Container, error)
- func (c *Core) ListImages(ctx context.Context, filter map[string][]string) ([]types.ImageSummary, error)
- func (c *Core) PingMongoSession() error
- func (c *Core) PullImage(ctx context.Context, img string) error
- func (c *Core) RemoveContainer(ctx context.Context, id string) error
- func (c *Core) RemoveImage(ctx context.Context, id string) error
- func (c *Core) RemoveMeta(name string) error
- func (c *Core) RemoveRepository(name string) error
- func (c *Core) StopContainer(ctx context.Context, id string) error
- func (c *Core) Sync(ctx context.Context, opts SyncOptions) (*api.Container, error)
- func (c *Core) UpdatePrevRun(name string) error
- func (c *Core) UpdateRepository(name string, update bson.M) error
- func (c *Core) UpsertRepoMeta(name, dir string, code int) error
- func (c *Core) WaitContainer(ctx context.Context, id string) (int, error)
- type LogsOptions
- type SyncOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Debug bool
// DbURL contains username and password
DbURL string
DbName string
GetSizer fs.GetSizer
DockerEndpoint string
}
Config contains a list of options used when creating `Core`.
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core is the basic type of this package. It provides methods for interaction with MongoDB and Docker API.
func NewWithConfig ¶
NewWithConfig returns a `Core` instance with specified config.
func (*Core) AddRepository ¶
func (c *Core) AddRepository(repos ...api.Repository) error
AddRepository creates one or more Repositories.
func (*Core) CloseMongoSession ¶
func (c *Core) CloseMongoSession()
func (*Core) FindRepository ¶
FindRepository simply re-export the mgo API.
func (*Core) GetContainerLogs ¶
func (c *Core) GetContainerLogs(ctx context.Context, opts LogsOptions) error
GetContainerLogs gets all stdout and stderr logs from the given container.
func (*Core) GetRepository ¶
func (c *Core) GetRepository(name string) (*api.Repository, error)
GetRepository returns the Repository with the given name.
func (*Core) ListAllMetas ¶
ListAllMetas returns the list of metadata of all Repositories.
func (*Core) ListAllRepositories ¶
func (c *Core) ListAllRepositories() []api.Repository
ListAllRepositories returns all Repositories.
func (*Core) ListContainers ¶
func (c *Core) ListContainers(ctx context.Context, filter map[string][]string) ([]types.Container, error)
ListContainers returns a list of containers.
func (*Core) ListImages ¶
func (c *Core) ListImages(ctx context.Context, filter map[string][]string) ([]types.ImageSummary, error)
ListImages returns a list of docker images.
func (*Core) PingMongoSession ¶
func (*Core) RemoveContainer ¶
RemoveContainer removes the given container.
func (*Core) RemoveImage ¶
RemoveImage removes the given docker image.
func (*Core) RemoveMeta ¶
RemoveMeta removes the metadata of the given Repository.
func (*Core) RemoveRepository ¶
RemoveRepository removes the Repository with given name.
func (*Core) StopContainer ¶
StopContainer stops the given container.
func (*Core) UpdatePrevRun ¶
func (*Core) UpdateRepository ¶
UpdateRepository updates the syncing options of the given Repository.
func (*Core) UpsertRepoMeta ¶
UpsertRepoMeta updates the metadata of the given Repository.
type LogsOptions ¶
LogsOptions provides params to the GetContainerLogs function.