> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goakt.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Interfaces Reference

> Actor, Grain, and extension interface definitions.

A quick reference for the key interfaces implemented by users and collaborators. See the linked pages for detailed
explanations.

## Actor

```go theme={"theme":{"light":"github-light","dark":"dracula"}}
type Actor interface {
    PreStart(ctx *Context) error
    Receive(ctx *ReceiveContext)
    PostStop(ctx *Context) error
}
```

Required for all actors. See [Actor Model](/actor/actor-model#the-actor-interface).

## Grain

```go theme={"theme":{"light":"github-light","dark":"dracula"}}
type Grain interface {
    OnActivate(ctx context.Context, props *GrainProps) error
    OnReceive(ctx *GrainContext)
    OnDeactivate(ctx context.Context, props *GrainProps) error
}
```

Required for virtual actors. See [Grains](/grains/overview#the-grain-interface).

## Mailbox

```go theme={"theme":{"light":"github-light","dark":"dracula"}}
type Mailbox interface {
    Enqueue(msg *ReceiveContext) error
    Dequeue() *ReceiveContext
    IsEmpty() bool
    Len() int64
    Dispose()
}
```

Optional; for custom mailbox implementations. See [Extending GoAkt](/contributing/extending#mailbox).

## Serializer

```go theme={"theme":{"light":"github-light","dark":"dracula"}}
type Serializer interface {
    Serialize(message any) ([]byte, error)
    Deserialize(data []byte) (any, error)
}
```

For custom message serialization over the wire.
See [Serialization](/advanced/serialization#the-serializer-interface).

## Extension

```go theme={"theme":{"light":"github-light","dark":"dracula"}}
type Extension interface {
    ID() string
}
```

System-wide plugin. See [Extending GoAkt](/contributing/extending#extension-system-wide).

## Dependency

```go theme={"theme":{"light":"github-light","dark":"dracula"}}
type Dependency interface {
    Serializable  // BinaryMarshaler + BinaryUnmarshaler
    ID() string
}
```

Per-actor injected resource. Must be serializable for relocation.
See [Extending GoAkt](/contributing/extending#dependency-per-actor).

## Discovery Provider

```go theme={"theme":{"light":"github-light","dark":"dracula"}}
type Provider interface {
    ID() string
    Initialize() error
    Register() error
    Deregister() error
    DiscoverPeers() ([]string, error)
    Close() error
}
```

For cluster peer discovery. See [Extending GoAkt](/contributing/extending#discovery-provider).

For custom passivation behavior. See [Passivation](/actor/passivation#strategies).

## Path

```go theme={"theme":{"light":"github-light","dark":"dracula"}}
type Path interface {
    Host() string
    HostPort() string
    Port() int
    Name() string
    Parent() Path
    String() string
    System() string
    Equals(other Path) bool
}
```

Returned by `pid.Path()`. Location-transparent actor identity.
See [Location Transparency](/actor/location-transparency#the-path-interface).
