Documentation ¶
Index ¶
- Constants
- func BuildFileExists(name, apexType string) bool
- func CheckAsyncDeploy(id metadata.ID, instance Instance) (done bool)
- func CheckAsyncRetrieve(id metadata.ID, instance Instance) (done bool, contents []byte)
- func CheckSessionID(instance Instance) bool
- func CheckValidApexType(apexType string) bool
- func CreateBuildFile(memberName, apexType string) (err error)
- func CreateMetadataFile(memberName, apexType string) (err error)
- func Error(errorInfo string) error
- func Errorf(errorInfo string, replace ...string) (err error)
- func FormalizeApexType(shorthand string) (formal string)
- func GetApexExtension(apexType string) (ext string, err error)
- func GetExtensionsForApexType(apexType string) (apexExt, fileExt string, err error)
- func GetFileExtFromApexExt(apexExtension string) string
- func GetFileExtension(apexType string) (ext string, err error)
- func GetFormalApexTypes() []string
- func GetMetadataDirectory() string
- func GetMetadataExtension() string
- func GetPluralApexType(apexType string) string
- func GetPluralApexTypes() []string
- func GetProjectDirectory() string
- func GetShortApexTypes() []string
- func GetSingleApexType(pluralApexType string) string
- func InformalizeApexType(formal string) string
- func InstanceExists(instanceName string) bool
- func MetadataFileExists(name, apexType string) bool
- func RemoveInstance(instanceName string) (err error)
- func SetProjectDirectory(newDir string) (err error)
- func TryDeploy(contents []byte, instance Instance) (id metadata.ID, err error)
- func TryLogIn(instance *Instance) (err error)
- func TryRetrieve(pkg Package, instance Instance) (Id metadata.ID, err error)
- type Command
- type CommandData
- type Instance
- type Members
- type Package
- func ImportPackage(fileName string) (p Package, err error)
- func ImportPackageFrom(fullPath string) (p Package, err error)
- func NewPackageFromName(name string) (p *Package, err error)
- func NewPackageFromVersion(name, version string) (p *Package, err error)
- func NewPackageWithMembers(name, version string, members []Members) (p *Package, err error)
- func (p *Package) AddMemeber(name, fileType string) (err error)
- func (p Package) ExportPackage() (err error)
- func (p Package) ExportPackageTo(targetFile string) (err error)
- func (p Package) GetMembersOfType(targetType string) (r []string, err error)
- func (p Package) HasMemberNamed(name string) (b bool)
- func (p Package) HasMemeber(name, fileType string) bool
- func (p *Package) RemoveMember(name, fileType string) (err error)
- func (p *Package) RemoveMemberByName(name string) (err error)
- func (p *Package) ZipPackageIntoBytes() (contents []byte, err error)
- type UserInfo
Constants ¶
const DefaultVersion = "35.0"
Variables ¶
This section is empty.
Functions ¶
func BuildFileExists ¶
BuildFileExists returns a bool value if it can find a given value in the build files of the current project.
func CheckAsyncDeploy ¶
CheckAsyncDeploy checks the given AsyncProcessId on the given instance, and prints the result to console. This function returns the response.Result.Done value, which will be true once the job has completed.
func CheckAsyncRetrieve ¶
func CheckSessionID ¶
func CheckValidApexType ¶
CheckValidApexType returns a bool value based on if the type provided is a formal or informal apex type.
func CreateBuildFile ¶
CreateBuildFile creates a build file in ./build/apexType based off the memberName, and the apexType provided.
func CreateMetadataFile ¶
CreateMetadataFile creates a metadata file in ./project/metadata based off the memberName, and the apexType provided.
func FormalizeApexType ¶
FormalizeApexType converts a shorthand apex type into a formal apex type.
func GetApexExtension ¶
func GetFileExtFromApexExt ¶
func GetFileExtension ¶
func GetFormalApexTypes ¶
func GetFormalApexTypes() []string
GetFormalApexTypes returns a listing of the formal names of apex types.
func GetMetadataDirectory ¶
func GetMetadataDirectory() string
func GetMetadataExtension ¶
func GetMetadataExtension() string
func GetPluralApexType ¶
GetPluralApexType returns either a string with the plural name of an apex type, or an empty string.
func GetPluralApexTypes ¶
func GetPluralApexTypes() []string
GetPluralApexTypes returns a list of valid, plural apex types.
func GetProjectDirectory ¶
func GetProjectDirectory() string
func GetShortApexTypes ¶
func GetShortApexTypes() []string
GetShortApexTypes returns a listing of acceptable informal apex types.
func GetSingleApexType ¶
func InformalizeApexType ¶
InformalizeApexType returns either a string with the formal name of an apex type, or an empty string.
func InstanceExists ¶
func MetadataFileExists ¶
MetadataFileExists returns a bool value if it can find a given value in the metadata files of the current project
func RemoveInstance ¶
func SetProjectDirectory ¶
TODO: Remove this func + value, Replace with os.Chdir & os.Getwd
Types ¶
type Command ¶
Command : used to define the commands that can be run through the program. Fairly standard & simple as command interfaces go. A few assumptions are made: Help() Will return useful info determined by consts in command files Name() will return a lowercase only name of the command for input matching Run() will only be given parameters which exclude the first two os.Args Ie, when given "dev add package test" only "package test" will be given to the Run() func to be used. Structs should still check to see if there are 0 arguments, unless the command can be run without any parameters. The internal structure of the structs does not matter- as long as these funcs are working, the command will be accepted
type CommandData ¶
type CommandData struct {
NameString, HelpString string
RunCommand func(args []string) (err error)
}
CommandData acts as a data wrapper for commands
func (CommandData) Help ¶
func (c CommandData) Help() string
Help : Provides help to inherit Command interface
func (CommandData) Name ¶
func (c CommandData) Name() string
Name : Provides name to inherit Command interface
func (CommandData) Run ¶
func (c CommandData) Run(args []string) (err error)
type Instance ¶
type Instance struct { UserInfo UserInfo `"xml:"UserInfo` Sandbox bool `xml:"Sandbox,attr"` Version string `xml:"Version,attr"` MetadataURL string ServerURL string Name string }
func GetInstanceByName ¶
func (*Instance) SaveInstance ¶
type Package ¶
type Package struct { Members []Members `xml:"types"` Version string `xml:"version"` Xmlns string `xml:"xmlns,attr"` // contains filtered or unexported fields }
Package : Controls files for deployments. A package
has a name, and a collection of files taken from the json document that is saved to disc
func ImportPackage ¶
ImportPackage : calls ImportPackageFrom(...) on a file located in the default directory. Important to note: only specify a file for this function.
func ImportPackageFrom ¶
ImportPackageFrom : Call on an xml file, that supports the proper schema, and get
a Package struct in return, or an error
func NewPackageFromName ¶
NewPackageFromName : Creates a new package using the default version, the given name, and an empty member array. Returns an error if name is nil.
func NewPackageFromVersion ¶
NewPackageFromVersion : Creates a new package using the given version, and name, and an empty member array
func NewPackageWithMembers ¶
NewPackageWithMembers : Creates a new pacakge using the given values. Might as well call Package{} at this point, but this is cleaner
func (*Package) AddMemeber ¶
AddMember is used to add a new member based on the given name, and filetype. The version of the member is assumed to be the same as the packageDefaultVersion, and the generated metadata will be of that version, with the needed defaults.
func (Package) ExportPackage ¶
ExportPackage : Saves package information to a target file, or, if there is no file, this function defaults to the known save location for packages.
func (Package) ExportPackageTo ¶
ExportPackageTo : Saves package information to a target file, or, if there is no file, this function defaults to the known save location for packages.
func (Package) GetMembersOfType ¶
GetMembersOfType : Returns a collection of file names of the given type, or an
error if there are none of that type.
func (Package) HasMemberNamed ¶
HasMemberNamed returns a boolean value based on if a member object of any file type exists in the given isntance of package. There can be multiple files named the same, but this function will only return true or false, not a number of files. This function will also not return the type.
func (Package) HasMemeber ¶
HasMember checks to see if a given name and type exist in the package instance. Returns either a boolean or an error as needed. Error will probably be very rarely thrown, as a false value will suffice for most situations.
func (*Package) RemoveMember ¶
RemoveMember is used to remove a given member of the same name, and fileType from a package instance. This function does not remove any metadata, or build files. The user assumes responsiblity for removing these values.