Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regenerate mocks #160

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.2.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.0/direnvrc" "sha256-5EwyKnkJNQeXrRkYbwwRBcXbibosCJqyIUuz9Xq+LRc="
fi
use flake
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ _obj
_test
bin
vendor/
/.direnv/

# Architecture specific extensions/prefixes
*.[568vq]
Expand Down
3 changes: 3 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ Seán C McCord <[email protected]> Ulexus <[email protected]>
Sheena Artrip <[email protected]> sheenobu <[email protected]>
Sharon Allsup <[email protected]> system_user <[email protected]>
Laurel Lawson <[email protected]> llccs <[email protected]>
Torrey Searle <[email protected]> tsearle <[email protected]>
Torrey Searle <[email protected]> tsearle <[email protected]>
Michael Hall <[email protected]> mikehall76 <[email protected]>
4 changes: 3 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ Danil Matyukhin <[email protected]>
JAF <[email protected]>
Laurel Lawson <[email protected]>
Michael Hall <[email protected]>
Nuno Pereira <[email protected]>
Raian Fernandes Dos Santos <[email protected]>
Seán C McCord <[email protected]>
Sharon Allsup <[email protected]>
Sheena Artrip <[email protected]>
Stamkulov Sattar <[email protected]>
Torrey Searle <[email protected]>
Vipul <[email protected]>
William Edward Lee <[email protected]>
goharahmed <[email protected]>
mikehall76 <[email protected]>
mtryfoss <[email protected]>
realrainer <[email protected]>
seanchann <[email protected]>
serfreeman1337 <[email protected]>
9 changes: 4 additions & 5 deletions application.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package ari
// Application represents a communication path interacting with an Asterisk
// server for application-level resources
type Application interface {

// List returns the list of applications in Asterisk, optionally using the key for filtering
List(*Key) ([]*Key, error)

Expand Down Expand Up @@ -72,10 +71,10 @@ func (ah *ApplicationHandle) Data() (ad *ApplicationData, err error) {

// Subscribe subscribes the application to an event source
// event source may be one of:
// - channel:<channelId>
// - bridge:<bridgeId>
// - endpoint:<tech>/<resource> (e.g. SIP/102)
// - deviceState:<deviceName>
// - channel:<channelId>
// - bridge:<bridgeId>
// - endpoint:<tech>/<resource> (e.g. SIP/102)
// - deviceState:<deviceName>
func (ah *ApplicationHandle) Subscribe(eventSource string) (err error) {
err = ah.a.Subscribe(ah.key, eventSource)
return
Expand Down
13 changes: 3 additions & 10 deletions ari.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@ package asterisk.ari;

option go_package = "ari";

import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";

// Key identifies a unique resource in the system
message Key {
// NOTE: we build our own stringer
option (gogoproto.goproto_stringer) = false;

// Kind indicates the type of resource the Key points to. e.g., "channel",
// "bridge", etc.
string kind = 1;

// ID indicates the unique identifier of the resource
string id = 2 [(gogoproto.customname) = "ID"];
string id = 2;

// Node indicates the unique identifier of the Asterisk node on which the
// resource exists or will be created
Expand All @@ -32,9 +28,6 @@ message Key {

// CallerID describes the name and number which identifies the caller to other endpoints
message CallerID {
// NOTE: we build our own stringer
option (gogoproto.goproto_stringer) = false;

// Name is the name of the party
string name = 1;

Expand All @@ -48,7 +41,7 @@ message ChannelData {
Key key = 1;

// Id is the unique ID for this channel (AMI-style)
string id = 2 [(gogoproto.customname) = "ID"];
string id = 2;

// Name is the name of this channel (tect/name-id)
string name = 3;
Expand All @@ -75,7 +68,7 @@ message ChannelData {
string language = 10;

// ChannelVars is the list of channel variables set on this channel
map<string, string> channelvars = 11 [(gogoproto.customname) = "ChannelVars"];
map<string, string> channel_vars = 11;

}

Expand Down
4 changes: 1 addition & 3 deletions asterisk.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package ari
// Asterisk represents a communication path for
// the Asterisk server for system-level resources
type Asterisk interface {

// Info gets data about the asterisk system
Info(key *Key) (*AsteriskInfo, error)

Expand Down Expand Up @@ -41,7 +40,7 @@ type BuildInfo struct {
// ConfigInfo describes information about the Asterisk configuration
type ConfigInfo struct {
DefaultLanguage string `json:"default_language"`
MaxChannels int `json:"max_channels,omitempty"` //omitempty denotes an optional field, meaning the field may not be present if no value is assigned.
MaxChannels int `json:"max_channels,omitempty"` // omitempty denotes an optional field, meaning the field may not be present if no value is assigned.
MaxLoad float64 `json:"max_load,omitempty"`
MaxOpenFiles int `json:"max_open_files,omitempty"`
Name string `json:"name"` // Asterisk system name
Expand All @@ -68,7 +67,6 @@ type SystemInfo struct {

// AsteriskVariables is an interface to interact with Asterisk global variables
type AsteriskVariables interface {

// Get returns the value of the given variable; the ID field of the Key is the variable name
Get(key *Key) (string, error)

Expand Down
2 changes: 0 additions & 2 deletions bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package ari
// Bridge represents a communication path to an
// Asterisk server for working with bridge resources
type Bridge interface {

// Create creates a bridge
Create(key *Key, btype string, name string) (*BridgeHandle, error)

Expand Down Expand Up @@ -78,7 +77,6 @@ type BridgeData struct {

// BridgeAddChannelOptions describes additional options to be applied to a channel when it is joined to a bridge
type BridgeAddChannelOptions struct {

// AbsorbDTMF indicates that DTMF coming from this channel will not be passed through to the bridge
AbsorbDTMF bool

Expand Down
4 changes: 2 additions & 2 deletions callerid.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package ari

import "errors"

//NOTE: Direct translation from ARI client 2.0
// NOTE: Direct translation from ARI client 2.0

// CallerIDFromString interprets the provided string
// as a CallerID. Usually, this string will be of the following forms:
// - "Name" <number>
// - <number>
// - "Name" number
func CallerIDFromString(src string) (*CallerID, error) {
//TODO: implement complete callerid parser
// TODO: implement complete callerid parser
return nil, errors.New("CallerIDFromString not yet implemented")
}

Expand Down
1 change: 0 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package ari
// with an Asterisk ARI server. It is agnostic to transport
// and implementation.
type Client interface {

// ApplicationName returns the ARI application name by which this client is connected
ApplicationName() string

Expand Down
17 changes: 1 addition & 16 deletions client/arimocks/Application.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 1 addition & 16 deletions client/arimocks/Asterisk.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 1 addition & 16 deletions client/arimocks/AsteriskVariables.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 1 addition & 16 deletions client/arimocks/Bridge.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 1 addition & 16 deletions client/arimocks/Bus.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 15 additions & 16 deletions client/arimocks/Channel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 0 additions & 33 deletions client/arimocks/ChannelContextOptionFunc.go

This file was deleted.

Loading
Loading