blob: d3c3fa617d1467da307416942342451b921b094d [file] [log] [blame]
// This file was auto-generated by the veyron vdl tool.
// Source: repository.vdl
// Package repository contains implementation of the interface for
// storing and serving various veyron management objects.
package repository
import (
// VDL system imports
"v.io/v23"
"v.io/v23/context"
"v.io/v23/ipc"
"v.io/v23/vdl"
// VDL user imports
"v.io/v23/services/mgmt/application"
"v.io/v23/services/mgmt/repository"
"v.io/v23/services/security/access"
"v.io/v23/services/security/access/object"
"v.io/x/ref/services/mgmt/profile"
)
// ApplicationClientMethods is the client interface
// containing Application methods.
//
// Application describes an application repository internally. Besides
// the public Application interface, it allows to add and remove
// application envelopes.
type ApplicationClientMethods interface {
// Application provides access to application envelopes. An
// application envelope is identified by an application name and an
// application version, which are specified through the object name,
// and a profile name, which is specified using a method argument.
//
// Example:
// /apps/search/v1.Match([]string{"base", "media"})
// returns an application envelope that can be used for downloading
// and executing the "search" application, version "v1", runnable
// on either the "base" or "media" profile.
repository.ApplicationClientMethods
// Put adds the given tuple of application version (specified
// through the object name suffix) and application envelope to all
// of the given application profiles.
Put(ctx *context.T, Profiles []string, Envelope application.Envelope, opts ...ipc.CallOpt) error
// Remove removes the application envelope for the given profile
// name and application version (specified through the object name
// suffix). If no version is specified as part of the suffix, the
// method removes all versions for the given profile.
//
// TODO(jsimsa): Add support for using "*" to specify all profiles
// when Matt implements Globing (or Ken implements querying).
Remove(ctx *context.T, Profile string, opts ...ipc.CallOpt) error
}
// ApplicationClientStub adds universal methods to ApplicationClientMethods.
type ApplicationClientStub interface {
ApplicationClientMethods
ipc.UniversalServiceMethods
}
// ApplicationClient returns a client stub for Application.
func ApplicationClient(name string, opts ...ipc.BindOpt) ApplicationClientStub {
var client ipc.Client
for _, opt := range opts {
if clientOpt, ok := opt.(ipc.Client); ok {
client = clientOpt
}
}
return implApplicationClientStub{name, client, repository.ApplicationClient(name, client)}
}
type implApplicationClientStub struct {
name string
client ipc.Client
repository.ApplicationClientStub
}
func (c implApplicationClientStub) c(ctx *context.T) ipc.Client {
if c.client != nil {
return c.client
}
return v23.GetClient(ctx)
}
func (c implApplicationClientStub) Put(ctx *context.T, i0 []string, i1 application.Envelope, opts ...ipc.CallOpt) (err error) {
var call ipc.ClientCall
if call, err = c.c(ctx).StartCall(ctx, c.name, "Put", []interface{}{i0, i1}, opts...); err != nil {
return
}
err = call.Finish()
return
}
func (c implApplicationClientStub) Remove(ctx *context.T, i0 string, opts ...ipc.CallOpt) (err error) {
var call ipc.ClientCall
if call, err = c.c(ctx).StartCall(ctx, c.name, "Remove", []interface{}{i0}, opts...); err != nil {
return
}
err = call.Finish()
return
}
// ApplicationServerMethods is the interface a server writer
// implements for Application.
//
// Application describes an application repository internally. Besides
// the public Application interface, it allows to add and remove
// application envelopes.
type ApplicationServerMethods interface {
// Application provides access to application envelopes. An
// application envelope is identified by an application name and an
// application version, which are specified through the object name,
// and a profile name, which is specified using a method argument.
//
// Example:
// /apps/search/v1.Match([]string{"base", "media"})
// returns an application envelope that can be used for downloading
// and executing the "search" application, version "v1", runnable
// on either the "base" or "media" profile.
repository.ApplicationServerMethods
// Put adds the given tuple of application version (specified
// through the object name suffix) and application envelope to all
// of the given application profiles.
Put(call ipc.ServerCall, Profiles []string, Envelope application.Envelope) error
// Remove removes the application envelope for the given profile
// name and application version (specified through the object name
// suffix). If no version is specified as part of the suffix, the
// method removes all versions for the given profile.
//
// TODO(jsimsa): Add support for using "*" to specify all profiles
// when Matt implements Globing (or Ken implements querying).
Remove(call ipc.ServerCall, Profile string) error
}
// ApplicationServerStubMethods is the server interface containing
// Application methods, as expected by ipc.Server.
// There is no difference between this interface and ApplicationServerMethods
// since there are no streaming methods.
type ApplicationServerStubMethods ApplicationServerMethods
// ApplicationServerStub adds universal methods to ApplicationServerStubMethods.
type ApplicationServerStub interface {
ApplicationServerStubMethods
// Describe the Application interfaces.
Describe__() []ipc.InterfaceDesc
}
// ApplicationServer returns a server stub for Application.
// It converts an implementation of ApplicationServerMethods into
// an object that may be used by ipc.Server.
func ApplicationServer(impl ApplicationServerMethods) ApplicationServerStub {
stub := implApplicationServerStub{
impl: impl,
ApplicationServerStub: repository.ApplicationServer(impl),
}
// Initialize GlobState; always check the stub itself first, to handle the
// case where the user has the Glob method defined in their VDL source.
if gs := ipc.NewGlobState(stub); gs != nil {
stub.gs = gs
} else if gs := ipc.NewGlobState(impl); gs != nil {
stub.gs = gs
}
return stub
}
type implApplicationServerStub struct {
impl ApplicationServerMethods
repository.ApplicationServerStub
gs *ipc.GlobState
}
func (s implApplicationServerStub) Put(call ipc.ServerCall, i0 []string, i1 application.Envelope) error {
return s.impl.Put(call, i0, i1)
}
func (s implApplicationServerStub) Remove(call ipc.ServerCall, i0 string) error {
return s.impl.Remove(call, i0)
}
func (s implApplicationServerStub) Globber() *ipc.GlobState {
return s.gs
}
func (s implApplicationServerStub) Describe__() []ipc.InterfaceDesc {
return []ipc.InterfaceDesc{ApplicationDesc, repository.ApplicationDesc, object.ObjectDesc}
}
// ApplicationDesc describes the Application interface.
var ApplicationDesc ipc.InterfaceDesc = descApplication
// descApplication hides the desc to keep godoc clean.
var descApplication = ipc.InterfaceDesc{
Name: "Application",
PkgPath: "v.io/x/ref/services/mgmt/repository",
Doc: "// Application describes an application repository internally. Besides\n// the public Application interface, it allows to add and remove\n// application envelopes.",
Embeds: []ipc.EmbedDesc{
{"Application", "v.io/v23/services/mgmt/repository", "// Application provides access to application envelopes. An\n// application envelope is identified by an application name and an\n// application version, which are specified through the object name,\n// and a profile name, which is specified using a method argument.\n//\n// Example:\n// /apps/search/v1.Match([]string{\"base\", \"media\"})\n// returns an application envelope that can be used for downloading\n// and executing the \"search\" application, version \"v1\", runnable\n// on either the \"base\" or \"media\" profile."},
},
Methods: []ipc.MethodDesc{
{
Name: "Put",
Doc: "// Put adds the given tuple of application version (specified\n// through the object name suffix) and application envelope to all\n// of the given application profiles.",
InArgs: []ipc.ArgDesc{
{"Profiles", ``}, // []string
{"Envelope", ``}, // application.Envelope
},
Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Write"))},
},
{
Name: "Remove",
Doc: "// Remove removes the application envelope for the given profile\n// name and application version (specified through the object name\n// suffix). If no version is specified as part of the suffix, the\n// method removes all versions for the given profile.\n//\n// TODO(jsimsa): Add support for using \"*\" to specify all profiles\n// when Matt implements Globing (or Ken implements querying).",
InArgs: []ipc.ArgDesc{
{"Profile", ``}, // string
},
Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Write"))},
},
},
}
// ProfileClientMethods is the client interface
// containing Profile methods.
//
// Profile describes a profile internally. Besides the public Profile
// interface, it allows to add and remove profile specifications.
type ProfileClientMethods interface {
// Profile abstracts a device's ability to run binaries, and hides
// specifics such as the operating system, hardware architecture, and
// the set of installed libraries. Profiles describe binaries and
// devices, and are used to match them.
repository.ProfileClientMethods
// Specification returns the profile specification for the profile
// identified through the object name suffix.
Specification(*context.T, ...ipc.CallOpt) (profile.Specification, error)
// Put sets the profile specification for the profile identified
// through the object name suffix.
Put(ctx *context.T, Specification profile.Specification, opts ...ipc.CallOpt) error
// Remove removes the profile specification for the profile
// identified through the object name suffix.
Remove(*context.T, ...ipc.CallOpt) error
}
// ProfileClientStub adds universal methods to ProfileClientMethods.
type ProfileClientStub interface {
ProfileClientMethods
ipc.UniversalServiceMethods
}
// ProfileClient returns a client stub for Profile.
func ProfileClient(name string, opts ...ipc.BindOpt) ProfileClientStub {
var client ipc.Client
for _, opt := range opts {
if clientOpt, ok := opt.(ipc.Client); ok {
client = clientOpt
}
}
return implProfileClientStub{name, client, repository.ProfileClient(name, client)}
}
type implProfileClientStub struct {
name string
client ipc.Client
repository.ProfileClientStub
}
func (c implProfileClientStub) c(ctx *context.T) ipc.Client {
if c.client != nil {
return c.client
}
return v23.GetClient(ctx)
}
func (c implProfileClientStub) Specification(ctx *context.T, opts ...ipc.CallOpt) (o0 profile.Specification, err error) {
var call ipc.ClientCall
if call, err = c.c(ctx).StartCall(ctx, c.name, "Specification", nil, opts...); err != nil {
return
}
err = call.Finish(&o0)
return
}
func (c implProfileClientStub) Put(ctx *context.T, i0 profile.Specification, opts ...ipc.CallOpt) (err error) {
var call ipc.ClientCall
if call, err = c.c(ctx).StartCall(ctx, c.name, "Put", []interface{}{i0}, opts...); err != nil {
return
}
err = call.Finish()
return
}
func (c implProfileClientStub) Remove(ctx *context.T, opts ...ipc.CallOpt) (err error) {
var call ipc.ClientCall
if call, err = c.c(ctx).StartCall(ctx, c.name, "Remove", nil, opts...); err != nil {
return
}
err = call.Finish()
return
}
// ProfileServerMethods is the interface a server writer
// implements for Profile.
//
// Profile describes a profile internally. Besides the public Profile
// interface, it allows to add and remove profile specifications.
type ProfileServerMethods interface {
// Profile abstracts a device's ability to run binaries, and hides
// specifics such as the operating system, hardware architecture, and
// the set of installed libraries. Profiles describe binaries and
// devices, and are used to match them.
repository.ProfileServerMethods
// Specification returns the profile specification for the profile
// identified through the object name suffix.
Specification(ipc.ServerCall) (profile.Specification, error)
// Put sets the profile specification for the profile identified
// through the object name suffix.
Put(call ipc.ServerCall, Specification profile.Specification) error
// Remove removes the profile specification for the profile
// identified through the object name suffix.
Remove(ipc.ServerCall) error
}
// ProfileServerStubMethods is the server interface containing
// Profile methods, as expected by ipc.Server.
// There is no difference between this interface and ProfileServerMethods
// since there are no streaming methods.
type ProfileServerStubMethods ProfileServerMethods
// ProfileServerStub adds universal methods to ProfileServerStubMethods.
type ProfileServerStub interface {
ProfileServerStubMethods
// Describe the Profile interfaces.
Describe__() []ipc.InterfaceDesc
}
// ProfileServer returns a server stub for Profile.
// It converts an implementation of ProfileServerMethods into
// an object that may be used by ipc.Server.
func ProfileServer(impl ProfileServerMethods) ProfileServerStub {
stub := implProfileServerStub{
impl: impl,
ProfileServerStub: repository.ProfileServer(impl),
}
// Initialize GlobState; always check the stub itself first, to handle the
// case where the user has the Glob method defined in their VDL source.
if gs := ipc.NewGlobState(stub); gs != nil {
stub.gs = gs
} else if gs := ipc.NewGlobState(impl); gs != nil {
stub.gs = gs
}
return stub
}
type implProfileServerStub struct {
impl ProfileServerMethods
repository.ProfileServerStub
gs *ipc.GlobState
}
func (s implProfileServerStub) Specification(call ipc.ServerCall) (profile.Specification, error) {
return s.impl.Specification(call)
}
func (s implProfileServerStub) Put(call ipc.ServerCall, i0 profile.Specification) error {
return s.impl.Put(call, i0)
}
func (s implProfileServerStub) Remove(call ipc.ServerCall) error {
return s.impl.Remove(call)
}
func (s implProfileServerStub) Globber() *ipc.GlobState {
return s.gs
}
func (s implProfileServerStub) Describe__() []ipc.InterfaceDesc {
return []ipc.InterfaceDesc{ProfileDesc, repository.ProfileDesc}
}
// ProfileDesc describes the Profile interface.
var ProfileDesc ipc.InterfaceDesc = descProfile
// descProfile hides the desc to keep godoc clean.
var descProfile = ipc.InterfaceDesc{
Name: "Profile",
PkgPath: "v.io/x/ref/services/mgmt/repository",
Doc: "// Profile describes a profile internally. Besides the public Profile\n// interface, it allows to add and remove profile specifications.",
Embeds: []ipc.EmbedDesc{
{"Profile", "v.io/v23/services/mgmt/repository", "// Profile abstracts a device's ability to run binaries, and hides\n// specifics such as the operating system, hardware architecture, and\n// the set of installed libraries. Profiles describe binaries and\n// devices, and are used to match them."},
},
Methods: []ipc.MethodDesc{
{
Name: "Specification",
Doc: "// Specification returns the profile specification for the profile\n// identified through the object name suffix.",
OutArgs: []ipc.ArgDesc{
{"", ``}, // profile.Specification
},
Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Read"))},
},
{
Name: "Put",
Doc: "// Put sets the profile specification for the profile identified\n// through the object name suffix.",
InArgs: []ipc.ArgDesc{
{"Specification", ``}, // profile.Specification
},
Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Write"))},
},
{
Name: "Remove",
Doc: "// Remove removes the profile specification for the profile\n// identified through the object name suffix.",
Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Write"))},
},
},
}