Services
An overview of Services
Services are the main unit of organization in the AssemblyLift framework. Primarily, they serve as a logical grouping of related functions.

Make a New Service

You can create a new service in an existing AssemblyLift application via the make command:
1
$ asml make service myservice
Copied!
This will create a directory under services/ named myservice containing a default service.toml manifest.
In order for a service to be recognized by cast, it must be listed in the application manifest assemblylift.toml.
assemblylift.toml
1
[project]
2
name = "my-amazing-project"
3
4
[services]
5
default = { name = "myservice" }
Copied!

The Service Manifest

Each service is defined by its manifest, service.toml.
service.toml
1
# Each service must have a service table
2
[service]
3
name = "service-name" # A name is required
4
5
# The API table contains functions and authorizers
6
[api.functions.function-id]
7
name = "function-name" # A name is required
8
9
[api.authorizers.authorizer-id]
10
auth_type = "type"
11
12
# The IOmod table defines service dependencies
13
[iomod.dependencies.dependency-id]
14
version = "x.x.x"
15
coordinates = "organization.namespace.name"
Copied!
The service manifest defines the service's API, as well as an IOmods we wish to use in our service's functions. Each section of the service manifest is described in greater detail in the following sections.
Last modified 4mo ago